colocated-vitest-test-discovery: Colocated Vitest Test Discovery #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/colocated-vitest-test-discovery"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Assigned idea
Benchmark authoring specification.
Summary: Update zca-bridge's Vitest configuration so source-adjacent tests under src/**/*.test.ts are discovered while preserving the existing Node test setup and coverage boundaries.
Task intent: Make an ordinary upstream-facing config change: Vitest should continue running test//*.test.ts, also run colocated src//.test.ts files, keep globals enabled, keep environment set to node, keep v8 coverage for src/**/.ts, and keep src/main.ts plus colocated test files out of coverage.
Benchmark plan: Construct the package from the fixed commit and present the solver with only the upstream-facing request to support colocated Vitest tests. The expected patch is a small config edit. The hidden checker should add temporary tests under src/ and test/ to prove both discovery paths work and then verify coverage exclusion behavior.
Environment plan: Task/environment: use a Node.js environment with the repository dependencies installed and Vitest available. Environment/repo: materialize diendh/zca-bridge at 27a88edaf4d96eb037dc3aef3f54872e9435481f, run the repo's normal dependency install process, and execute checks from the repository root without changing package metadata for this config-only change.
Verifier plan: test_outputs.py should require that vitest.config.ts still defines globals: true, environment: "node", coverage provider "v8", coverage include src/**/*.ts, and coverage exclude src/main.ts. It should create temporary files such as src/vitest_config_colocated.test.ts and test/vitest_config_legacy.test.ts, run Vitest with the repo config, assert both files are collected, then run coverage and assert the colocated test file and src/main.ts do not appear in the coverage-final.json paths.
Oracle plan: The oracle solution edits vitest.config.ts only: extend test.include from ["test//*.test.ts"] to include "src//.test.ts" as well, and extend coverage.exclude so colocated test files such as "src/**/.test.ts" are excluded while preserving "src/main.ts".
Difficulty plan: Coding agents may replace the existing include glob instead of appending to it, accidentally disable globals, change the Node environment, remove the v8 provider, or forget that adding src/**/*.test.ts also requires excluding those test files from coverage.
Repo patch scope: Expected upstream edit scope is limited to vitest.config.ts. The verifier may create temporary check files under src/ and test/, but the submitted patch should not modify application source, dependency manifests, or package scripts.
Anti-leakage notes: Do not expose solver-facing benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context. The prompt should read like a normal maintainer request about Vitest configuration.
Approach: Use the existing Vitest config as the anchor: preserve its Node/global/v8 coverage behavior, add source-adjacent test discovery, and protect coverage from counting test files.
Verification: Run
python3 test_outputs.py; it should inspectvitest.config.ts, invokenpx vitest --config vitest.config.ts run --reporter=json --outputFile .vitest-config-report.json __vitest_config_, and run a coverage command such asnpx vitest --config vitest.config.ts run --coverage --coverage.reporter=json --coverage.reportsDirectory .vitest-coverage __vitest_config_.Risk: If the repository lacks the v8 coverage package in its installed dependencies, the coverage portion could fail for environmental reasons; the checker should report that distinctly from a config failure.
Path rules: task package is tasks/; mutable upstream checkout is tasks//environment/repo; benchmark package files are under tasks//task; verifier/container environment belongs under tasks//task/environment; regular and UI verifier logic belongs in task/tests/test_outputs.py and test.sh only runs that file through pytest.
Agent context
Task slug: colocated-vitest-test-discovery
Branch: task/colocated-vitest-test-discovery
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.