Skip to content

fix: two environment-sensitive test failures blocking CI - #925

Merged
will-lamerton merged 2 commits into
Nano-Collective:mainfrom
bigattichouse:fix/location-step-ansi
Aug 30, 2026
Merged

will-lamerton merged 2 commits into
Nano-Collective:mainfrom
bigattichouse:fix/location-step-ansi

Conversation

@bigattichouse

@bigattichouse bigattichouse commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follow-up to #923. With CI now getting as far as the test step, two long-hidden test failures are the last red checks. Both are test-only; no source changes.

1. location-step compares a styled line against a bare string

LocationStep shows the resolved project path next to the option compares a rendered Ink line against a bare path with only .trim() applied. The styled path carries SGR escapes that trim() doesn't touch, so the test passes whenever colour is off and fails whenever it's on — with characteristically baffling output, two visually identical strings:

Difference (- actual, + expected):

- '/test/project'
+ '/test/project'

CI sets FORCE_COLOR=1, so this has been broken there all along. strip-ansi is already a devDependency and is the convention the other render-comparing specs use (see user-input.spec.tsx).

2. prompt-history teardown races its own debounced write

The after.always hook already passed recursive/force, but addPrompt persists on a debounced timer, so a write can land while rmSync is walking the tree:

ENOTEMPTY: directory not empty, rmdir '/tmp/nanocoder-test-...'
1 hook failed
11 tests skipped

Node exposes maxRetries/retryDelay on fs.rm precisely for this class of error, so the teardown now backs off instead of failing the run. This one is intermittent — it passed on two other runs of the same suite, which is what makes it worth pinning down rather than just re-running.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Changeset

  • Added a changeset (empty — test-only, nothing user-facing to release)

Testing

Full suite under CI conditions (FORCE_COLOR=1 CI=true NODE_ENV=test): 6565 passed, 0 failed.

location-step.spec.tsx now passes with FORCE_COLOR=1 and FORCE_COLOR=0, where previously only the latter passed.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No breaking changes

🤖 Generated with Claude Code

https://claude.ai/code/session_01J7jWv6TLZ5UCr5BVfE2FP7

Follow-up to Nano-Collective#923. With CI now reaching the test step, this is the last
red check on main.

The assertion compares a rendered Ink line against a bare path string
with only .trim() applied, so it passes whenever colour is off and fails
whenever it is on — the styled path carries SGR escapes that trim() does
not touch. The failure output is characteristically baffling, two
visually identical strings:

    Difference (- actual, + expected):
    - '/test/project'
    + '/test/project'

CI sets FORCE_COLOR=1, so this has been broken there all along. It was
invisible only because the coverage job used to die at `pnpm build` or
at AVA startup long before it reached this test.

strip-ansi is already a devDependency and is the convention used by the
other render-comparing specs (see user-input.spec.tsx).

Full suite under CI conditions (FORCE_COLOR=1, CI=true): 6565 passed,
0 failed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01J7jWv6TLZ5UCr5BVfE2FP7
@bigattichouse bigattichouse mentioned this pull request Aug 23, 2026
9 of 12 tasks
The after.always hook already passed recursive+force, but addPrompt
persists on a debounced timer, so a write can land while rmSync is
walking the tree and leave it deleting a directory that just became
non-empty again:

    ENOTEMPTY: directory not empty, rmdir '/tmp/nanocoder-test-...'
    1 hook failed
    11 tests skipped

Node exposes maxRetries/retryDelay on fs.rm precisely for this class of
error (ENOTEMPTY, EBUSY, EPERM, ...), so the teardown now backs off
rather than failing the run.

Seen intermittently in CI - it passed on two other runs of the same
suite, which is what makes it worth pinning down rather than re-running.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01J7jWv6TLZ5UCr5BVfE2FP7
@bigattichouse bigattichouse changed the title fix: strip ANSI before comparing the resolved path in location-step spec fix: two environment-sensitive test failures blocking CI Aug 23, 2026
@bigattichouse

Copy link
Copy Markdown
Contributor Author

Green across all 11 checks — this is the first fully green run the repo has had since the TypeScript 7 and AVA 8 bumps, now that #923 has landed and CI actually reaches the test step.

Flagging that this unblocks #920: that branch is rebased onto current main and passes 10 of 11 checks, with the only remaining failure being the location-step assertion fixed here. Nothing else stands between it and green.

Both fixes are test-only, no source changes:

  • location-step compared a styled Ink line against a bare string with only .trim(), so it passed without colour and failed with it. CI sets FORCE_COLOR=1, so it has been broken there the whole time — it was just never reached, because the coverage job used to die at pnpm build or at AVA startup first.
  • prompt-history raced its own debounced write during teardown. That one is intermittent; it passed on two other runs of the same suite, which is why it seemed worth pinning down rather than re-running.

Happy to split these into two PRs if you'd prefer them reviewed separately.

@will-lamerton
will-lamerton merged commit 1c101a2 into Nano-Collective:main Aug 30, 2026
11 checks passed
@will-lamerton

Copy link
Copy Markdown
Member

Thanks for this @bigattichouse :D

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