Skip to content

fork(#48): install the relay test workspace before the preflight unit run (slice 12) - #63

Merged
nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-relay-test-deps
Nov 16, 2026
Merged

nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-relay-test-deps

Conversation

@nachumi-a2zoperations

Copy link
Copy Markdown

Refs #48 (slice 12: tests/e2e/relay-region-correction.unit.test.ts, "Cannot find package 'pg'").

Cause

  • The test imports cloud/apps/relay, a separate pnpm workspace (cloud/pnpm-workspace.yaml, its own lockfile). pg is a dependency of that workspace only.
  • CI keeps the two relay integration tests out of the unit shards (UNIT_EXCLUDE in ci-unit-files.mjs). It runs them in their own "relay integration" job in unit-tests.yml, which first runs, in cloud/:
    • pnpm --filter '@orca-cloud/relay...' install --frozen-lockfile --ignore-scripts
    • pnpm --filter '@orca-cloud/relay^...' build
  • The local preflight's vitest related run selects these tests like any other, and nothing there installs cloud/. On a clone where nobody did, the correction test fails at import. relay-region-compatibility happens to pass without it (12/12).

Fix

  • New config/scripts/orca-fork/install-relay-test-dependencies.mjs [--if-missing] [--cloud <dir>]. It finds the gaps: each relay dependency with no package in apps/relay/node_modules ("not installed"), and each workspace: dependency whose main is missing ("not built").
    • With --if-missing, it runs the relay job's two commands only when there is a gap. Otherwise it does nothing.
    • It stops at the first failing command and names it.
  • unitTestPrelude runs it after the release-tag fetch (slice 2's pattern) and before the native runtime step.
  • No product code, and no change to upstream's CI.

Tests (red first)

  • On fork-only 9830b801:
    • the new script test failed at import (the script did not exist);
    • the 2 prelude tests failed (the step was missing).
  • After the fix: 10/10 (install-relay-test-dependencies.test.mjs 8, check-changed-unit-prelude.test.mjs 2).
  • The script tests use a temp cloud/ and a fake run, so they never call pnpm or reach the network. One test pins the two commands to the text of unit-tests.yml, so a CI change shows up here.

End to end (MacBook)

  • With the relay node_modules and dist removed, relay-region-correction failed with "Cannot find package 'pg'".
  • install-relay-test-dependencies.mjs --if-missing (under pnpm exec, as the preflight runs it) installed and built the relay workspace. Both relay tests then passed: 15/15.
  • A second --if-missing run printed "present; nothing installed".

Host note (not code)

  • On this MacBook, pnpm 12's native binary was never put in place (~/Library/pnpm/.tools/pnpm/12.14.0/bin/pnpm is still the placeholder text file). Plain pnpm in the repo fails with "Failed to switch pnpm to v12.14.0 … ENOEXEC", and so does the husky pre-commit hook.
  • I ran the gates with the working pnpm 12.14 first on PATH. This is a host step for the owner, not part of this PR.

Gates (MacBook)

  • pnpm check:changed --base=origin/blowzer/fork-only --force: 43 of 44 checks pass. The 1 red is "skill bundle manifest" (resources/skills/released-digests.json stale), which fails the same way on base 9830b801; this PR touches no input of it.
  • The pre-commit hook (oxlint, ast-grep, oxfmt) ran clean on the commit.

… run

tests/e2e/relay-region-correction.unit.test.ts imports cloud/apps/relay,
a separate pnpm workspace. CI keeps the relay integration tests out of
the unit shards and installs + builds that workspace in its own job;
the local preflight's `vitest related` run selects them like any other
test, so on a clone without cloud/ installed it failed with
"Cannot find package 'pg'".

The preflight's unit prelude now runs
config/scripts/orca-fork/install-relay-test-dependencies.mjs
--if-missing: when a relay dependency is not installed or a workspace
one is not built, it runs the relay job's two commands (frozen
lockfile, no lifecycle scripts); otherwise nothing. A test pins the
commands to unit-tests.yml.

Refs #48 (slice 12)

Signed-off-by: Nachumi Eliyahu <[email protected]>
@nachumi-a2zoperations
nachumi-a2zoperations merged commit d18bbcf into blowzer/fork-only Nov 16, 2026
2 checks passed
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