Skip to content

test(cli): cover apps/cli/tests with effect lint (CLI-2852) - #7327

Merged
7ttp merged 7 commits into
developfrom
7ttp/cli-2852-tests-coverage
Oct 26, 2026
Merged

7ttp merged 7 commits into
developfrom
7ttp/cli-2852-tests-coverage

Conversation

@7ttp

@7ttp 7ttp commented Oct 26, 2026

Copy link
Copy Markdown
Member

TL;DR

brings apps/cli/tests and apps/cli/vitest.config.ts under the effect lint

whats introduced?

  • apps/cli/tests/** and apps/cli/vitest.config.ts join the allow list, replacing the seven per-file tests/helpers entries
  • the test helpers, smoke tests and vitest config run on FileSystem, Path, Config and ChildProcess, and promise helpers like runSupabase keep their call shape and reject with the same values
  • spawnSupabase and makeTempHome become scoped effects, and seedLegacyStateDecoys and setLinkedRefFile become effects, so their e2e and integration call sites yield them
  • a timed out until run now kills its child and removes its temp home instead of leaving both behind

ref

@7ttp 7ttp self-assigned this Oct 26, 2026
@7ttp
7ttp requested a review from a team as a code owner October 26, 2026 08:40

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by a newer AI review

🤖 AI Review

Reviewed both findings against the checked-out code and trusted conventions. The subprocess cleanup finding remains uncertain because the dependency implementation needed to verify teardown behavior is unavailable. The duplication nit is refuted under the documented testing conventions. No runtime checks were possible without installed dependencies.

Findings

Severity Location Category Sources Claim
🟠 MAJOR apps/cli/tests/helpers/cli.ts:678 resource-lifecycle codex Interruption during subprocess acquisition can bypass the harness's effective cleanup, leaving a long-running CLI alive or blocking teardown.
Refuted findings (kept for transparency, not posted as review comments)
  • apps/cli/tests/smoke-test-windows.ts:26 (duplication): The withFinally cleanup algorithm is repeated in live.ts, smoke-test-macos.ts, and smoke-test-windows.ts, creating a potential maintenance drift concern.
    Refuted: The repetition exists, although the implementations are not literally word for word identical. trusted/CLAUDE.md:159 explicitly accepts some duplication instead of unnecessary test abstractions, and trusted/apps/cli/CLAUDE.md:34–38 cautions against automatically extracting repeated helpers. These small local helpers have equivalent behavior; the finding identifies no existing divergence or correctness defect that overrides those conventions.

Stats

Claude findings: 1 · Codex findings: 1 · Confirmed: 0 · Refuted: 1 · Uncertain: 1


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/tests/helpers/cli.ts Outdated
@7ttp

7ttp commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

/ai-review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Verified all three findings from both independent reviews. Confirmed the minor stdin error-reporting race, refuted the storage compatibility concern, and left the cleanup finding uncertain because Effect's spawner implementation is unavailable in this checkout.

Findings

Severity Location Category Sources Claim
🟡 MINOR apps/cli/src/commands/experimental/stack/start/start.e2e.test.ts:344 resource-cleanup claude Scope closure may not await the log follower's exit, despite the new comment, allowing subsequent stack cleanup to race with the exiting follower.
🟡 MINOR apps/cli/tests/helpers/cli.ts:783 error-handling codex The exit path can silently drop stdin write failures because it never waits for the forked writer.
Refuted findings (kept for transparency, not posted as review comments)
  • apps/cli/tests/helpers/storage.ts:318 (test-reliability): Moving fixture writes from setupStorage invocation to first layer acquisition introduces an undocumented compatibility regression that can overwrite intervening test edits.
    Refuted: The timing change is real, but storage.ts:316-317 explicitly documents initialization 'on first use'. The callers do not establish the claimed regression: for example, cp.integration.test.ts:58-77 builds the layer before executing file preparation, and ls.integration.test.ts:358-375 writes ancestor configuration before setupStorage without supplying conflicting fixture contents. No caller depending on eager fixture writes was found. trusted/CLAUDE.md:144-152 permits reshaping internal APIs based on current consumer requirements.

Stats

Claude findings: 2 · Codex findings: 1 · Confirmed: 1 · Refuted: 1 · Uncertain: 1


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/src/commands/experimental/stack/start/start.e2e.test.ts
Comment thread apps/cli/tests/helpers/cli.ts
@7ttp 7ttp added the run-flaky-check Run the flaky-test check on this PR label Oct 26, 2026
@github-actions github-actions Bot removed the run-flaky-check Run the flaky-test check on this PR label Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Flaky test check: ✅ no flaky tests

Commit 476e3b0e2c77 · focused ×10 (5 executions each), 13963 tests · integration ×10, 5621 tests · unit ×10, 8342 tests · workflow run

Each execution is a separate Vitest process; Where lists failing runs, as run.iteration for suites executed more than once per run. The full data is in the flaky-check-report artifact.

@7ttp
7ttp added this pull request to the merge queue Oct 26, 2026
Merged via the queue into develop with commit 0238c48 Oct 26, 2026
43 checks passed
@7ttp
7ttp deleted the 7ttp/cli-2852-tests-coverage branch October 26, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants