Repository navigation
cli tests: cover --color, --diagnostics short, -j, --interval, --strict, --timing - #431
Merged
Merged
Conversation
…ct, --timing Tests only, in the existing crates/flashtex-cli/tests/cli.rs style (CARGO_BIN_EXE_flashtex, real output bytes). No source changes; no bugs found. - --color: never strips ANSI (both spellings) even with a real diagnostic present; auto respects NO_COLOR; always overrides it. - --diagnostics short (both spellings): one line per diagnostic, no source excerpt or gutter. - -j/--jobs: accepted and ignored for valid values; a non-numeric or missing value is a usage error (exit 2), matching the documented "accepted for compatibility" behavior. - --interval: bad values exit 2 fast; 0 clamps to the documented 20ms floor (killed immediately after the banner appears, so the test stays fast). - --strict: a clean document exits 0 either way (the error-document half was already covered elsewhere). - --timing: labeled wall-time lines appear only with the flag. Independently re-verified by the reviewer outside the Muse sandbox: `cargo test` in crates/flashtex-cli, 20 passed, 0 failed, including bundled_share_layout_resolves_fonts_without_host_tex, which the implementer correctly flagged as failing only inside Muse's own nested sandbox-exec (an environmental artifact, verified there via git stash against the clean tree) -- passes cleanly outside it. Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane cli-flag-tests, slice 1) Commit-Executor: daniel-muse-lead (Claude Sonnet) Reviewed-by: daniel-muse-lead (Claude Sonnet) Muse-Lane-Head: e7de12ff Co-authored-by: muse-spark-1.3-contributor <[email protected]>
Contributor
Author
|
daniel-parent review of #431 at 497721d: REQUEST_CHANGES. These are coverage tests, and several of them can't fail. This came from an independent read-only Codex pass.
This comes after the #417 → #418 → #406 fixes in your queue. |
Fixes daniel-parent's review of #431: 1. --color=auto with NO_COLOR set can never distinguish NO_COLOR's effect: piped stderr is never a tty, so auto is uncoloured in this harness regardless of NO_COLOR. Dropped the assertion rather than pin a false claim about it; --color=always overriding NO_COLOR (the one precedence this harness genuinely can observe) stays. 2. --diagnostics short's assertions matched piped stderr's own default shape, so a parsed-and-ignored flag would still pass. Now diffs against --diagnostics full on the same input to prove the flag actually changes the output. 3. -j was only exercised on `check`, though main.rs documents it for `build` too. Added `flashtex build ... -j 4`. 4. The --interval 0 watch test's blocking read() ignored its own 30s deadline if the child never wrote anything -- a real hang would block past cargo test's own timeout, not fail cleanly. Moved the read to a background thread and bounded the wait with recv_timeout, so the deadline is actually enforced. Implementation-Agent: daniel-muse-lead (Claude Sonnet, fixing muse-spark-1.3-contributor's earlier commit per daniel-parent's review) Commit-Executor: daniel-muse-lead (Claude Sonnet) Reviewed-by: daniel-muse-lead (Claude Sonnet)
Contributor
Author
|
daniel-parent re-review of #431 at f3d87bf: two tests still pass under a no-op mutation. The watch hang,
Do the mutation check the lane rules require: comment out the flag's effect locally, confirm each test fails, then restore. |
d-q222
added a commit
that referenced
this pull request
Sep 15, 2026
Conflict in crates/flashtex-cli/tests/cli.rs was additive on both sides (the --fix test helpers/tests from this branch vs. the restored diagnostics_short_is_one_line_per_diagnostic and color precedence tests from #431/#459 on main); resolved by keeping both blocks intact. Generated artefacts (supported-latex.json, coverage.md, docs/user/compiler.md, the Mac bundled copy) regenerated via the project scripts, not hand-merged -- confirmed byte-identical to git's own auto-merge, so no drift. Implementation-Agent: daniel-muse-lead (Claude Sonnet) Commit-Executor: daniel-muse-lead (Claude Sonnet) Lane-Owner: daniel-parent
GoKubar
pushed a commit
that referenced
this pull request
Sep 15, 2026
…pt diff (#459) * cli tests: prove --color=never precedence and pin short-vs-full excerpt diff Follow-up to #431, which merged before its review round landed (opened as a new PR off current main per daniel-parent's instruction, not pushed to the merged branch). Read main.rs first: no CLICOLOR_FORCE/FORCE_COLOR or any override exists (only NO_COLOR is read), and no config/env defaults --diagnostics to full. The flag loop overwrites per occurrence, so the last flag wins. - color_never_strips_ansi_and_always_overrides_no_color: adds a --color=always-alone control (colours a pipe), then proves --color=always --color=never keeps the full shape with zero ESC bytes in both spellings, and the flipped order stays coloured (positional last-wins, not never-always-wins). - diagnostics_short_is_one_line_per_diagnostic: the full side now reuses diagnostics_full_shows_the_source_line_and_carets's exact assertion shape on the identical input, plus assert_ne! against short. (Short's proven-absent artifacts are the --> header and | gutter, not \input{nothere} itself -- short's own one-line message contains that path.) Mutation-tested: a no-op "never" => {} makes the colour test fail with uncoloured-expected-but-coloured output; restoring passes. A no-op "short" => {} does NOT fail the diagnostics test (proving short is unobservable-by-omission in a pipe, which is exactly why the fix compares against full instead); misrouting "short" to Full does fail it, and restoring passes again. All mutations applied to main.rs temporarily and confirmed byte-identical afterward (`git diff` empty). cargo test -p flashtex-cli: 20 passed, 0 failed (bundled_share_layout_ resolves_fonts_without_host_tex, which fails only inside Muse's own sandboxed environment, passes cleanly here outside it). Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane fix431, slice 1) Commit-Executor: daniel-muse-lead (Claude Sonnet) Reviewed-by: daniel-muse-lead (Claude Sonnet) Co-authored-by: muse-spark-1.3-contributor <[email protected]> * cli tests: drop the vacuous diagnostics_short_is_one_line_per_diagnostic Fixes daniel-parent's re-review of #459: this test could not prove anything real from a pipe. Its short-shape assertions pass against piped stderr's own default even if --diagnostics=short were parsed and ignored; its full-output assertions duplicated diagnostics_full_shows_the_source_line_and_carets byte for byte; and assert_ne!(short, full) only proved full differs from the default. No directly-testable argument-parser unit exists to test this properly instead: --diagnostics is parsed by a private fn in the binary crate, which has no lib target, so an integration test in tests/cli.rs cannot reach it. Deleted the test rather than keep a no-op or leave an empty shell. color_never_strips_ansi_and_always_overrides_no_color is untouched. Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane fix459v2, slice 1) Commit-Executor: daniel-muse-lead (Claude Sonnet) Reviewed-by: daniel-muse-lead (Claude Sonnet) * cli tests: restore diagnostics_short_is_one_line_per_diagnostic The previous round dropped this test along with a vacuous assert_ne! it had gained; that also removed main's own real coverage of --diagnostics short's one-line shape, which wasn't the intent. Restored verbatim from main, plus a comment noting that TTY auto-detection isn't observable through this piped-stdio test harness -- this test covers the explicit flag's own behavior only. Implementation-Agent: daniel-muse-lead (Claude Sonnet) Commit-Executor: daniel-muse-lead (Claude Sonnet) --------- Co-authored-by: muse-spark-1.3-contributor <[email protected]>
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.
Scope
GH-CLI-FLAG-TESTS. Integration tests for--color,--diagnostics short,-j/--jobs,--interval,--strict,--timing.crates/flashtex-cli/tests/cli.rsonly — tests only, nosrc/change.Overlap check
git grep -n "fn color_never_strips_ansi\|fn diagnostics_short_is_one_line\|fn jobs_flag_is_accepted\|fn watch_interval_rejects\|fn strict_leaves_a_clean\|fn timing_prints_labeled" origin/main— no output before this PR.cli-fix) also editscrates/flashtex-cli/tests/cli.rs— it's a draft blocked on a design question, landing this one first.Test results (head
f3d87bfd, re-run on this exact commit)CI: not yet reported on this branch as of this update (
gh pr checks 431).Fixes in this update (all 4 REQUEST_CHANGES defects)
--color=auto+NO_COLORcouldn't distinguish anything: piped stderr is never a tty, soautois uncoloured in this harness regardless ofNO_COLOR. Dropped that specific assertion rather than pin a false claim;--color=alwaysoverridingNO_COLOR(the precedence this harness can actually observe) stays.--diagnostics shortmatched the default shape: a parsed-and-ignored flag would still have passed. Now diffs against--diagnostics fullon the identical input to prove the flag changes the output.-jonly tested oncheck: addedflashtex build ... -j 4(documented forbuildtoo).--interval 0watch test could hang past its own 30s deadline: a blockingread()ignores the deadline if the child never writes. Moved the read to a background thread bounded byrecv_timeout, so the deadline is actually enforced.Not done
Nothing further deferred.