Skip to content

test: fold WS port contract drift guard into local suite - #747

Merged
danshapiro merged 4 commits into
mainfrom
the-usual/fold-port-contract-local
Sep 7, 2026
Merged

test: fold WS port contract drift guard into local suite#747
danshapiro merged 4 commits into
mainfrom
the-usual/fold-port-contract-local

Conversation

@danshapiro

Copy link
Copy Markdown
Owner

What

Folds the existing test:port vitest suite (the WS port contract drift guard) into the local npm test standard runner, so every local test run verifies the TS↔Rust wire-protocol contract — previously this only ran in CI via the port-contract workflow.

Why

The user runs all tests locally per repo policy before pushing PRs. The port-contract CI workflow was the only place the cross-language WS protocol drift signal was checked, and it was not part of the local default suite (npm test). This wires it in locally so drift is caught before a PR, not after.

Changes

  • scripts/run-standard-tests.ts: add a port suite to both desktop and aggressive standard test plans, plus the cloud-backend local section (alongside electron). Fix classifySuitePath so test/unit/port/** targets route to the port config instead of misrouting to the client config (which excludes them).
  • test/unit/server/run-standard-tests.test.ts: update plan-structure assertions to include the port suite; add a port-routing test.
  • scripts/test/cloud-vitest-integration.test.sh: add a regression guard for the cloud-path port block (static source check, verified to catch deletion).

The test:port freeze test already regenerates the contract artifacts in-memory and asserts byte-equality with the committed files, fully subsuming the contract:generate idempotency check. No Rust crate checks are folded (those stay a separate manual cargo test step). No CI workflows are modified in this PR.

Built via the-usual workflow: plan review PASSED (1 round), delta review PASSED (2 rounds, 1 Major finding cleared).

Add a 'port' suite to run-standard-tests that runs the existing
config/vitest/vitest.port.config.ts drift guard, so every local 'npm test'
verifies the TS<->Rust wire-protocol contract without relying on the
port-contract CI workflow. The test:port freeze test already regenerates
the contract artifacts in-memory and asserts byte-equality with the committed
files, subsuming the contract:generate idempotency check.

Also extends classifySuitePath so test/unit/port/** targets route to the
port suite under the port config (previously misrouted to the client/default
config, which excludes them), and adds the port suite to the cloud-backend
local section alongside electron.
…tion test

The cloud-backend port execution block in run-standard-tests.ts (added when
folding the port contract drift guard into the local suite) had no regression
guard. Extend the existing cloud-vitest-integration test with a static source
check for the port contract suite log message, following the same pattern as
the existing FRESHELL_VITEST_BACKEND reference checks. A full behavioral test
is not proportionate: the cloud branch blocks on the electron execFileSync for
minutes, so the port log line (emitted after electron returns) is not captured
by the timeout-bounded process-level test.
@danshapiro
danshapiro merged commit a16af16 into main Sep 7, 2026
4 checks passed
@danshapiro
danshapiro deleted the the-usual/fold-port-contract-local branch September 7, 2026 22:29
danshapiro added a commit that referenced this pull request Sep 7, 2026
Remove three CI workflows whose checks are fully covered by the local test
suite (run per repo policy before every PR):

- rust-clippy.yml (clippy + rust-test): the flaky job that was failing PRs
  with timing races (net_bind rapid-rebind, auto_resume_e2e, codex_fork_rebind)
  under CI scheduling load. cargo fmt/clippy/test are run locally.
- typecheck-client.yml: runs 'npm run typecheck:client', which is part of
  'npm run check' (run locally).
- port-contract.yml: the TS side (test:port freeze suite + contract:generate
  idempotency) is now folded into the local default 'npm test' suite (PR #747).
  The Rust crate checks (cargo test -p freshell-protocol/terminal) remain a
  separate manual cargo test step.

Kept: docs-pages-deploy.yml, electron-build.yml, electron-release.yml
(CI-only deploy/build actions, not tests).

Also update port/contract/README.md to reflect that the drift guard now runs
via the local npm test suite instead of the removed CI workflow.
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.

1 participant