Repository navigation
✅ Integration tests against a fake Ceedling, and the final review - #25
Merged
Merged
Conversation
The integration suite now opens two workspace folders: the existing one without a project, and a temporary copy of a fixture project whose ceedlingExplorer.ceedlingCommand runs tests/fixtures/fake-ceedling/ceedling.js. The fake answers version, dumpconfig --stdout, files:test, test tasks, clean, and clobber from the project's scenario file. Its reports follow the captured CppUnit reports' structure, and its compiler failure is a captured one. Nine new tests cover the wiring between the engine and VS Code: - a folder without a project gets no TestController; - the discovered tree, its labels and lines; - file and function runs with their results; - an unreported test; - a compile failure in the Testing view and the Problems panel; - cancellation; - a test file created and deleted on disk; - an unsaved edit. On the Windows CI leg the engine runs with Windows paths, which unit tests can't reach. VS Code's API can't read another extension's TestItems or run results, so activate() returns CeedlingExplorerApi, a handle giving the tests each folder's controller. The controller adds onDidReport, whenDiscovered(), and run() for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd test gaps Windows: - testFileAt compared paths exactly. Discovery uppercases the drive letter for gcov, and VS Code reports `c:\…`, so unsaved-edit, save, and close reparses never matched a file. The new Windows integration leg showed it. pathKey compares Windows paths case-insensitively. - Directory locks and discovery groups key on pathKey too. An absolute project path also gets an uppercase drive letter, so two spellings of one directory can't build at once. Engine and parsing: - A cancelled clean or clobber is no failure, so cancelling shows no error. - extractTestFunctionName splits at the first `::`. A case argument such as "a::b" produced a false collision and a needless whole-file rerun. - A captured line or column of 0, as GCC reports for `<command-line>`, places a problem at the start. It became -1, and vscode.Position threw, losing the pattern's diagnostics for the run. Controller: - A discovery in flight at disposal no longer shows an error, or creates a TestController or watchers, for a removed folder. - activate() returns the test API only in test mode. run() does nothing for a folder without a TestController. Tests and tooling: - The fake's --test-case filter is a substring match, as Ceedling's is. An integration test covers the resulting whole-file rerun. - Both integration folders run the fake, so the one without a project proves Ceedling never runs there. The Clean test waits for discovery. - The launcher retries removing its temporary workspace. - npm test compiles the test build once. clean also removes out-test and coverage. - CI's coverage step uses bash's pipefail. - The lint ban on synchronous fs covers every synchronous call. Docs: the debug executable's layout before and from Ceedling 1.2.0, stale comments, and just clean's description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mkarlesky
marked this pull request as ready for review
October 23, 2026 19:08
A failed listing gave its project no test files, so the Testing view silently showed no tests. The listing now fails discovery like any other load problem. A CeedlingLoadError names each project whose listing failed, in settings order, and the settings to check. The engine keeps its last good projects for runs and watchers, as for every failed discovery. Ceedling's output is logged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mkarlesky
changed the base branch from
refactor/adapter-extraction
to
next_version
October 23, 2026 19:21
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.
Fifth and last PR in the lint-and-coverage series, stacked on #24. It adds integration tests that drive the real extension in VS Code against a fake Ceedling. It also carries the series' final pass: a last lint, and a thorough review of every change in #21–#25, with its findings fixed here.
Fake Ceedling
tests/fixtures/fake-ceedling/ceedling.jsis a Node script. It answersversion,dumpconfig --stdout,files:test,test:tasks,cleanandclobberas Ceedling 1.2.0 does, from the scenario filefake-ceedling.jsonin the project.ceedling-1.0.0/compile-failure-stderr.txt.tests/integration/main.tscopiestests/fixtures/workspace-fake-ceedlingto a temporary directory and pointsceedlingExplorer.ceedlingCommandat the fake. It opens that copy alongside the existingworkspace-without-projectas a two-folder workspace, so builds never write into the repository.activate()returnsCeedlingExplorerApi, which gives the tests each folder's controller. The controller addsonDidReport,whenDiscovered()andrun()for them.Scenarios (10 new; 14 integration tests in all)
files:test, functions and cases with their pretty labels and lines, and the controller named for its folder.--force-test-rerunand the bundled mixin.--test-case=<name>reaches Ceedling, and only that function reports.On the Windows CI leg these run the engine with Windows paths, which unit tests can't reach.
Final pass
Lint: 0 findings. The ban on synchronous
fscalls insrc/now covers every synchronousfsmethod.Review: four parallel reviews covered every change in #21–#25 against
next_version, by area:Each finding was checked against the code before any fix, and each fix that changes behavior was written test-first.
Fixed
testFileAtnever matched. Discovery uppercases the drive letter for gcov, but VS Code reportsc:\…, and the comparison was exact. Unsaved-edit, save, and close reparses silently did nothing. The new Windows integration leg failed on it. Introduced onnext_version, never released.ceedlingEngine.tspathKey()compares Windows paths case-insensitively.projects[].pathkept a lowercase drive letter, and directory locks keyed on the raw path. Two spellings of one directory could then build at once, the corruption the lock exists to prevent.ceedlingProjectConfig.ts,ceedlingEngine.tspathKey().<command-line>:0:0:) became −1.vscode.Positionthen threw, dropping every diagnostic from that pattern for the run. Shipped in 2.0.1.problemMatching.tsextractTestFunctionNamesplit at the last::.test_s("a::b")gaveb"), causing a false collision warning and a whole-file rerun. Shipped in 2.0.1.ceedlingOutputParsing.ts::. Added to the CHANGELOG.ceedlingEngine.tstestController.tsdisposedguard.dispose().main.tsExtensionMode.Test.run()could create a TestController for a folder without a project.testController.ts--test-casewas an exact match, unlike Ceedling's substring match, so the engine's rerun path went untested in VS Code.extension.test.tstests/integration/main.tstee.ci.ymlshell: bash(pipefail).npm testcompiled the test build twice;cleanleftout-test/andcoverage/.package.jsonSourceEventunion.testController.tsceedling files:testemptied the project silently. The project loaded with no test files. Shipped in 2.0.1.ceedlingEngine.tsCeedlingLoadErrornaming each project whose listing failed and the settings to check. The engine keeps its last good projects, as for every failed discovery. Added to the CHANGELOG.Deferred, with reasons
debugLaunch.tsis unit-tested, and the manual checklist covers debugging.TEST_RANGE()without a range beside a valid one) still lists the valid marker's cases. The warning explains why they go unreported, as it already does for a zero step.Reviewed and found sound
versionholds its directory lock.src/.??fallbacks can fire.lineAt: the binary search is equivalent to the old linear scan.CI is green on Linux, macOS, and Windows. 356 unit tests and 14 integration tests pass.
🤖 Generated with Claude Code