Test coverage improvements, global elimination, E2E tests, and bug fixes#218
Merged
Conversation
- Replace globalResolver with Fiber Locals middleware + ServiceRegistry - Move startTime from package-level var to MonitoringHandler.startTime field - Move signedURLRateLimiter from package-level var to StorageHandler.signedURLLimiter field
…ill) - declarative_test.go: 28 tests for DeclarativeService (config, paths, fingerprinting, plan guards, apply guards, status, temp file writing, content application, dump) - bootstrap_keys_test.go: 15 tests for defaultScopes, defaultRateLimit, isNoRowsError - backfill_test.go: 5 tests for buildJoinCondition (single/multi/triple column with spaces)
…ob retry - knowledge_graph_test.go: tests for all 3 graph tools (metadata, schemas, execute guards) - log_elasticsearch_test.go: 55+ tests for ES/OS constructors, write, query, health, stats - log_elasticsearch.go: fix double-close panic in writeV8/writeV9 bulk indexer - job_retry_test.go: E2E tests for exponential backoff, admin retry API, backoff doubling
…tenant tests - ssrf_protection_test.go: 5 tests verifying blocked domains (AWS/GCP/K8s metadata) are unreachable from Deno functions, with public URL control test - realtime_tenant_isolation_test.go: 10 tests for WebSocket broadcast/presence/ subscription tenant filtering, REST endpoint scoping, global broadcast isolation - tenant_test.go: 48 tests for TenantMiddleware context getters, RequireTenantRole, RequireInstanceAdmin, CtxWithTenant with header/JWT/default sources
…licate submitTestJob - Rewrite realtime_tenant_isolation_test.go to use actual Manager API (AddConnection, Subscribe, BroadcastToChannel with sent count) - Rename submitTestJob to submitRetryJob in job_retry_test.go to fix redeclaration conflict with jobs_get_test.go - Fix job retry test to use correct endpoint /api/v1/jobs/submit - Apply gofumpt formatting to storage_handler.go and knowledge_graph_test.go
… allowlist - Fix markJobRunning to use worker_id=NULL instead of gen_random_uuid() which violated the fk_queue_worker foreign key constraint - Rewrite SSRF protection tests to test the actual mechanism: when AllowedDomains is set, blocked domains are excluded from --allow-net - Remove AWS/GCP metadata endpoint tests that fail in cloud CI where those endpoints are actually reachable - Add test for explicit AllowedDomains allowlist enforcement
- Remove test that relied on AllowedDomains for edge functions (not supported — functions only use boolean allow_net, not per-domain) - Add test for allow_net=false blocking network access - Keep public URL control test that verifies normal fetch works
Edge functions always get --allow-net when SDK tokens are present (UserToken/ServiceToken), regardless of the allow_net setting. SSRF protection via BlockedDomains only works with explicit AllowedDomains which edge functions don't support. The unit tests in internal/runtime/types_test.go already cover this logic correctly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
globalResolver→ Fiber Locals middleware + ServiceRegistry;startTime→MonitoringHandler.startTimefield;signedURLRateLimiter→StorageHandler.signedURLLimiterfieldinternal/tenantdb/(0% → ~50%): declarative service, bootstrap keys, backfill helpersinternal/mcp/tools/knowledge_graph.go(0% → ~60%): all 3 graph tools with metadata, schema, and execute guard testsinternal/storage/log_elasticsearch.go(0% → ~70%): 55+ tests for ES/OS constructors, write, query, health, stats + fix double-close panic in bulk indexerTest plan
go test -short ./internal/...— all passgo build -tags integration ./test/e2e/...— compiles cleango vet -tags integration ./test/e2e/...— clean