Tests: cover the least-tested code (77% → toward 90%), and the bugs they found - #65
Closed
antonarnaudov wants to merge 6 commits into
Closed
antonarnaudov wants to merge 6 commits into
antonarnaudov wants to merge 6 commits into
Conversation
- Git: disposing a git that failed to spawn signalled pid 0, the whole process group, which is the extension host (it killed the test runner). Every kill now needs a real pid. - Desktop: a chat cancelled just before its message went out wrote to the stdin it had just ended, an uncaught 'error' in the main process. - Desktop: the AI settings started as a shallow copy of a shared constant, so the first connection added before any settings file existed was pushed into @gitstudio/ai's EMPTY_AI_SETTINGS. - AI: an Azure base URL ending in "/" before its ?api-version query produced ".../gpt//chat/completions". - Refs: annotated tags (most releases) came back with no date, because %(committerdate) is empty for a tag object; %(creatordate) is the commit's date for a commit and the tagger's for a tag. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…renderer Tests written against real temp repositories, a local bare remote and fakes for GitHub, the AI providers and the CLI — never the network. Every test asserts behaviour: the git state left behind, what a page is sent, what the person is asked and told. Bugs they found and that are not fixed yet are marked test.todo / skip with the correct behaviour written down. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A single c8 run over the whole repo merges V8's raw coverage by script URL and assumes every process ran the same code. A package's source is transpiled once for its own tests and differently again when an app's tests load it through the workspace link, so shared files were read against the wrong text: host-bridge's scrubber reported 13% with every line tested. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ct" too Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n Windows Killing git.exe left the ssh it had started running and holding the clone's pipes, so the clone never reported that it ended — the test for it hung a Windows CI runner for four hours. taskkill /T takes the tree. The test is capped at 30s, and the desktop, extension and git-service suites now fail a test after five minutes instead of waiting forever. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Superseded by #66, which contains every commit here plus the fixes for the bugs these tests found; landing them together. |
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.
Raises line coverage by testing the least-covered code: the desktop main-process bridges (git, GitHub, AI, CLI, updater), the desktop renderer's UI and dialogs, the extension's graph, blame, views, status bar, rebase, history, PR and Changes surfaces, and git-service, engine, ai, merge-vscode, webview-ui, host-bridge and mcp.
How the tests are written
Bugs the tests found, fixed here
'error'in the main process.EMPTY_AI_SETTINGS, so the first added connection was pushed into the shared constant./before?api-versionproduced…//chat/completions.%(creatordate).Bugs found and not yet fixed stay marked
test.todo/skipwith the correct behaviour written down. They are being fixed in a follow-up PR.The coverage number itself was wrong. A single
c8 npm testover the monorepo merges V8's raw coverage by script URL, assuming every process ran the same code. A package's source is transpiled differently when an app's tests load it through the workspace link, so shared files were measured against the wrong text: host-bridge's scrubber showed 13% on Codecov while its own tests cover every line.scripts/test/coverage.mjsnow runs c8 once per workspace and merges the hits line by line, the same way Codecov merges several reports. CI uses it on the Ubuntu leg.🤖 Generated with Claude Code