test audit#44
Merged
Merged
Conversation
hugoh
commented
Jul 1, 2026
Owner
- fix(runner): guard errgroup.SetLimit against zero concurrency
- test(tui): wire goleak into TestMain and fix shared-fixture leak risk
- test(backend): isolate git/jj integration tests from ambient config
- chore(mise): remove unused test-int task
- test: cover previously-untested code paths and add subtests
A zero-value Concurrency (e.g. a bare model/config struct in tests, or future misconfiguration) made every errgroup.Go() block forever on a zero-capacity semaphore, permanently leaking the fan-out goroutine. Caught by wiring goleak into the tui test suite. Also isolates the git-shelling runner tests from the developer's ambient global git config, skips them consistently when git isn't on PATH, and adds coverage for ResultColor and the zero-concurrency path.
Detects goroutine leaks in internal/tui and cmd; ignores the one known non-fixable leak inside the third-party teatest library. Also converts internal/tui's shared package-level test config into a constructor so future test mutations can't leak across tests, and switches update_test.go's bash-based git setup to exec.CommandContext, isolated from the developer's ambient git config.
git and jj tests that shell out to real binaries now skip consistently when the binary is missing (previously jj tests skipped but git tests hard-failed), and set HOME/GIT_CONFIG_GLOBAL/JJ_CONFIG so a developer's or CI runner's global VCS config can't change test behavior. jj tests also configure a fixed user identity instead of relying on ambient jj config for commits/describes.
No test in the repo carries //go:build integration, so test-int has always been a no-op; drop it and its ci-core dependency instead of keeping dead scaffolding around.
Adds coverage for runShellInteractive (cmd), Repo.ActiveBackend (config), the confirmModel bubbletea component and Out/Warnf/WarnStyle (ui). Also splits theme.TestStateColor/TestColorCode into named, parallel subtests instead of one bulk assertion loop.
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Go | Jul 1, 2026 11:44a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44 +/- ##
==========================================
+ Coverage 87.54% 88.78% +1.24%
==========================================
Files 34 34
Lines 3637 3638 +1
==========================================
+ Hits 3184 3230 +46
+ Misses 354 311 -43
+ Partials 99 97 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.


