Skip to content

ci:local fails on Linux — cross-platform test hardening (unbreak npm-publish.yml) #26

Description

@pitimon

Problem

npm run ci:local is green on macOS but fails on Linux CI. Because npm-publish.yml's test job runs on ubuntu-latest (and publish has needs: test), the automated publish path has been broken on every push to main since ≥#17 — every release has been hand-published via npm publish --otp.

The new PR gate (.github/workflows/ci.yml, #23) runs on macos-latest as a deliberate workaround so the gate is enforceable today. This issue tracks fixing the underlying Linux failures so CI can run on ubuntu-latest and npm-publish.yml goes green again.

Known failures (Linux, clean checkout)

The runner stops at the first failure, so more may hide behind these two:

  1. test/init-local-runtime-reinstall.test.js — "installLocalTrackerApp … writes a package marker" — ✅ already fixed in ci: run ci:local on every PR into main (#18 follow-up) #23. Root cause: the test asserts dashboard/dist/index.html is copied, but installLocalTrackerApp guards that copy on the repo's dashboard/dist existing (src/commands/init.js:1073), and ci:local built the dashboard last → ENOENT on a clean checkout. Fixed by reordering ci:local to build the dashboard first. (Passed locally only on stale build artifacts.)

  2. test/rollout-parser.test.js:3365 — "parseCopilotIncremental re-reads from start when file is rotated (inode change)" — ❌ open. On Linux the OS reuses the inode after unlink+recreate at the same path, so parseCopilotIncremental's rotation detection reads incrementally from the old cursor instead of re-reading from start → actual 1, expected 2. macOS does not reuse the inode, so it passes there.

    • Fix direction: detect rotation by more than inode identity alone — e.g. also treat a size shrink / cursor-past-EOF as a rotation signal, so a reused inode with a smaller-or-reset file still triggers a full re-read. Then the test is valid on both platforms.

Definition of done

  • npm run ci:local passes on a clean ubuntu-latest checkout (chase down any failures beyond Fix local dashboard cloud side effects #2 — the runner stops at the first)
  • Switch .github/workflows/ci.yml runs-on back to ubuntu-latest (cheaper minutes) — or keep macOS by choice, but then close the npm-publish gap another way
  • npm-publish.yml's test job goes green → automated publish works without manual OTP
  • Add a regression note for the inode case so it doesn't silently pass again on macOS-only

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions