test(learning): integration tests for the validation engine against real containers#60
Merged
Merged
Conversation
…ontainers Unit tests mock every Docker/DB call, so they prove validator logic but never contact with reality (container timing, DB readiness, real ASG label resolution). Adds engine.itest.ts: one disposable project with real containers, run through runStepValidators' default (real) dependencies for all 8 validators, pass and fail, from a single static fixture so nothing is mutated between assertions.
…tion tests CI failed with "network akal-lab-network not found": createContainer attaches every container to that network, but it's normally created once at server startup (DockerInitializer.ensureSharedNetwork) and this suite never boots the server, so a fresh Docker daemon doesn't have it yet.
Derssa
approved these changes
Jul 15, 2026
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 of Changes
Adds an integration test suite for the validation engine (
backend/src/modules/learning/engine/engine.itest.ts). The unit tests next to each validator mock every Docker/DB call, so they prove the logic but never the contact with reality (container startup timing, DB readiness, real ASG label resolution). This suite stands up one disposable project with real Docker containers (Postgres/Redis/Mongo seeded with real data, a load balancer, a running auto-scaling group) and runs all 8 validators — pass and fail — throughrunStepValidatorswith its default (real) dependencies. Every pass/fail pair reads the same static fixture with different params, so nothing is mutated between assertions, keeping the suite non-flaky. It stays out of the defaultnpm testrun (existing*.itest.ts/jest.integration.config.jsconvention) and is wired into the existing dedicatedIntegrationGitHub Actions job by extending itspathsfilters.Types of Changes
Verification & Testing
Automated Checks
npm run lintsuccessfully with no errorsnpm run buildsuccessfully with no compilation errorsnpm testsuccessfully (all tests pass — 206/206, unchanged, no Docker dependency)Manual Verification
Ran
npm run test:integrationlocally against a real Docker daemon 3 times in a row: all 16 new assertions pass every time, no flaky result. Ran the full integration suite (both*.itest.tsfiles): 21/21. Confirmed no leftover containers after teardown (docker ps -afiltered on the test project's label).Checklist