fix(tests): repair extension summary assertion in doctor diagnostics test#1014
Merged
Lightheartdevs merged 1 commit intoLight-Heart-Labs:mainfrom Apr 27, 2026
Conversation
…test tests/test-doctor-extension-diagnostics.sh test #9 used grep -q "ext_total.*ext_healthy" which requires ext_total to appear FIRST on a single line. But scripts/dream-doctor.sh:364 emits "{ext_healthy}/{ext_total} healthy, {ext_issues} with issues" — ext_healthy comes first. The test has been permanently failing since the format was introduced. Switches to two chained order-independent substring greps, matching the idiom already used in the same file at test #7 (extensions_total + extensions_healthy + extensions_issues). Future-proof against either variable being reordered in the print statement. All 9 tests now pass (was 8/9 before). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
What
Replaces the order-dependent regex in
tests/test-doctor-extension-diagnostics.shtest #9 ("Extension summary output present") with two order-independent chained greps.Why
The existing assertion
requires
ext_totalto appear first on the matched line. Butscripts/dream-doctor.sh:364emits—
ext_healthycomes first. The grep has been permanently failing since the format was introduced; test #9 has been broken on every branch that inherits frommain.How
Switches to the chained-grep idiom already used elsewhere in the same file (test #7, lines 74–80, which checks for
extensions_total,extensions_healthy, andextensions_issues):Order-independent and future-proof against either variable being reordered in the print statement.
Testing
bash -n tests/test-doctor-extension-diagnostics.sh— cleanshellcheck tests/test-doctor-extension-diagnostics.sh— no new warningsbash tests/test-doctor-extension-diagnostics.sh— all 9 tests pass (was 8/9 before this change)Platform Impact