test: comprehensive TDD test suite for configurable constants & managed-container#991
Open
buihongduc132 wants to merge 1 commit into
Open
test: comprehensive TDD test suite for configurable constants & managed-container#991buihongduc132 wants to merge 1 commit into
buihongduc132 wants to merge 1 commit into
Conversation
Contributor
|
PR author is not in the allowed authors list. |
Contributor
|
Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement. To sign the CLA, please add a comment to this PR with the following text: You only need to sign once. After signing, this check will pass automatically. Troubleshooting
You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**. |
Author
|
I have read the CLA Document and I hereby sign the CLA |
- timeouts.test.ts: 20 tests — 26-key defaults, env overrides, edge cases, KLAVIS array - limits.test.ts: 35 tests — multi-group defaults with key-count guards, env overrides, structural checks - paths.test.ts: 32 tests — 18-key guard, 14 string + 3 numeric defaults, env overrides, edge cases - managed-container.test.ts: top-level import for ContainerNameInUseError (was dynamic) - test-utils.ts: shared spawnWithEnv helper using Bun.spawn subprocess isolation - package.json: add bun test script Env-override tests use Bun.spawn subprocess isolation for clean module cache. Edge cases cover: zero, float, empty string, whitespace, MAX_SAFE_INTEGER overflow.
420eccc to
48b7daa
Compare
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
This PR introduces a TDD-first test suite (114 tests) for the configurable constants modules (
timeouts.ts,limits.ts,paths.ts) and theManagedContainerlifecycle. No implementation changes — test files only.These tests define the contract for the upcoming env-override implementation. They will initially fail (expected in TDD red-green-refactor cycle) and will pass once the feature PR lands.
Test Coverage
timeouts.test.ts— 20 tests, 6 describe blocks"abc"), trailing chars ("10s")limits.test.ts— 35 tests, 14 describe blockspaths.test.ts— 32 tests, 9 describe blocksmanaged-container.test.ts— 27 tests, 10 describe blocksDesign Decisions
Bun.spawn()with inline scripts to guarantee a fresh module cache —process.envis read at import time with the overridden value, no state leakage between tests.test-utils.tsexports a singlespawnWithEnv()helper used by all 3 constant test files (DRY).managed-container.test.tsusesFakeCli/FakeLoader/FakeVminterfaces with amakeFakeDeps()factory — no real Docker/Lima dependencies.AGENT_LIMITS(23),TOOL_LIMITS(3),CONTENT_LIMITS(6),PATHS(18)— catches accidental additions/removals.afterEachcleans temp dirs; spawned processes are drained viaproc.exited.catch().Files Changed
Test Plan
These tests ARE the test plan. Run:
Expected: env-override tests will fail (red phase) — that is correct TDD behavior. Default-value and edge-case tests may pass or fail depending on current parsing logic.
Follow-up
A companion PR will add the env-override implementation (
timeouts.ts,limits.ts,paths.ts,tool-adapter.ts,.env.example) that makes these tests pass (green phase).CLA
I have read the CLA Document and I hereby sign the CLA