Repository navigation
test: expand unit test coverage for safe-static-path, service-health, tracing, and database config - #750
Merged
DeFiVC merged 4 commits intoOct 21, 2026
Conversation
Expands tests/unit/utils/safe-static-path.test.ts with on-disk symlink scenarios: a filename resolving to a symlink inside the upload dir, and an upload dir that is itself a symlink. Confirms resolveSafeStaticPath stays confined to the configured upload dir in both cases, since it never calls fs.realpath and only ever resolves string paths. Closes ChainLearnOfficial#595
Adds cases for the default timeout fallback, immediate-rejection latency recording, per-check latency/seconds consistency, and per-service label correctness in checkServiceHealth. Closes ChainLearnOfficial#596
… coverage Verifies OTLPTraceExporter endpoint selection (default and custom), the resource service-name attribute, that every expected auto-instrumentation is registered, and that NodeSDK.start() is invoked. Adds a separate describe block exercising real @opentelemetry/api span creation and context propagation (with AsyncHooksContextManager registered so context.with() actually propagates instead of being a no-op). Closes ChainLearnOfficial#603
New tests/unit/config/database.test.ts covers connection string wiring (postgresql:// and postgres://), pool size/timeout settings, the pool error handler logging instead of crashing, drizzle wiring, and closeDatabase(). pg.Pool and drizzle-orm/node-postgres are mocked so nothing attempts a real connection. Closes ChainLearnOfficial#606
|
@Wycode569 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Expands/adds unit test coverage for four under-tested modules identified in the Wave 10 batch: the safe static path resolver, the service health check utility, OpenTelemetry tracing setup, and the database pool configuration (which previously had no tests at all).
Closes #595
Closes #596
Closes #603
Closes #606
Changes
#595 - safe-static-path.ts
#596 - service-health.ts
#603 - tracing.ts
#606 - database.ts
Test plan
Caveats