#528 Add e2e test for the module organization FIXED#569
Open
felladaniel36-hash wants to merge 4 commits into
Open
#528 Add e2e test for the module organization FIXED#569felladaniel36-hash wants to merge 4 commits into
felladaniel36-hash wants to merge 4 commits into
Conversation
Contributor
|
@felladaniel36-hash thanks for tackling #528! CI is red on this run though — could you fix the failing check and ping me back? I'll merge as soon as it goes green. 🙏 |
Author
|
DONE... SORRY FOR THE LATE REPLY... |
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.
Findings
Missing E2E Module Coverage
The existing E2E suite only tested the root endpoint and CSRF behavior. It did not verify that NestJS modules and controllers were properly registered and serving routes, allowing missing controller imports to go undetected.
Integration Test Coverage Gap
The existing
module-organization.test.tsfocused on Rust/Soroban contract structure and provided no validation of NestJS module or controller registration at runtime.Missing CI E2E Validation
The CI pipeline executed only unit tests through
npm testand did not runnpm run test:e2e, allowing broken route registrations to pass CI and reach deployment.Route Discovery Source Identified
NestJS registers controller routes through Express. The Express router stack provides a reliable runtime source for discovering all registered routes without hardcoded route lists.
Fix Features
Dynamic Route Discovery Helper
Added
discoverGetRoutes()to automatically inspect the Express router stack and collect all registered GET routes. The solution adapts automatically as controllers and modules change.Module Registration Assertions
Added three new E2E checks to verify:
AppControlleris loaded.Live HTTP Route Validation
Implemented runtime verification by sending actual HTTP requests to all discovered GET routes and ensuring responses never return HTTP 500 errors.
CI Deployment Gate
Added a new
backend-e2eworkflow job that:npm run test:e2eBackward Compatibility
Retained all existing E2E tests, including root route and CSRF validation, ensuring no regressions.
Test Results
Files Modified
app/backend/test/app.e2e-spec.tsAdded route discovery, module-registration validation, and runtime route resolution tests.
.github/workflows/ci.ymlAdded the
backend-e2ejob and integrated E2E testing into the deployment gate.CLOSE #528