Skip to content

test(engine): fix connections test hermeticity + wire unit-test lane (#1233) - #1238

Merged
jeonghun-jj-lee merged 1 commit into
mainfrom
1233-engine-test-lane
Sep 16, 2026
Merged

jeonghun-jj-lee merged 1 commit into
mainfrom
1233-engine-test-lane

Conversation

@jeonghun-jj-lee

@jeonghun-jj-lee jeonghun-jj-lee commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Wire the engine unit-test lane + fix test hermeticity (#1233)

Stacked on #1235 (1228-engine-test-ci). Merge #1235 first (or rebase this onto
dev after it lands).

What ships

The engine gets its unit tests running in CI for the first time since the fork
absorption (#1114), alongside the #1228 typecheck gate — in the same engine-tests
job (materialize → bun install → typecheck → unit tests).

The real fix: test hermeticity (the hang)

The unit suite couldn't run at all because it hung. Root cause was a hermeticity
bug: the connections suites redirected only AMICO_CLOUD_FILE/AMICO_PASQAL_FILE,
but token connections (slack/github/linear/google/google-drive, #327)
resolve their credential files via AMICO_*_FILE too — so a host's real
~/.amico/slack.json leaked in, fired a second background revalidate, and hung
afterEach. Fixed by redirecting all five into the per-test tmp dir in both
amicode-connections.test.ts and amicode-connections-routes.test.ts (118 tests
pass; the suite now completes instead of hanging).

Why the lane is non-blocking (not my call to fix here)

Once running, a clean CI runner showed the suite has systemic instability — none
of it caused by this change, all pre-existing and never CI-gated:

  • cross-test pollution (files pass in isolation, fail together — leaked global state),
  • timing-flakiness (header-timeout chunkTimeout — passes locally, fails on slower CI),
  • positive cross-test dependencies (amicode-release-workflow — fails when isolated),
  • one genuine spec conflict quarantined in-source: session.test.ts "keeps legacy
    parents outside aggregation" contradicts session-diff-scoped.test.ts:1462's
    "Bug A fix" auto-create — likely tied to server-survives-rebuild (Session-lineage spec conflict: legacy-parent aggregation vs 'Bug A fix' (auto-create) — tied to server-survives-rebuild #1239,
    it.instance.skip, the other 22 session tests still run).

Making the lane a green required gate needs broad suite hardening (#1239),
deliberately out of scope. Flip continue-on-error off once #1239 lands.

Follow-ups

Refs #1233, #1239, #1229, #1228.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 312186b5-ea8c-4881-af59-d5d25cb78ff9

📥 Commits

Reviewing files that changed from the base of the PR and between 1bf106f and 41914bf.

📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • AGENTS.md
  • package.json
  • packages/app-bundle/manifest.json
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-connections-routes.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-connections.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/session.test.ts
  • packages/app-bundle/scripts/engine_test_gate.sh

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review September 16, 2026 18:07
@jeonghun-jj-lee
jeonghun-jj-lee force-pushed the 1228-engine-test-ci branch 2 times, most recently from 34b891a to 2cde230 Compare September 16, 2026 18:49
…t lane (#1233)

Restore the final #1233 state cleanly on main after #1235 merged:
- fix the connections-suite hang by redirecting every token credential path
  (AMICO_SLACK/GITHUB/LINEAR/GOOGLE/GOOGLE_DRIVE_FILE) into each test tmpdir;
  real ~/.amico credentials no longer leak a second background revalidation.
- quarantine the one legacy-lineage spec conflict (it.instance.skip, #1239),
  leaving the other 22 session tests active.
- add engine_test_gate.sh plus `pnpm test:engine:unit` / AGENTS.md docs.
- run the unit suite after the required typecheck gate as a non-blocking CI lane.
  The suite reports on every main PR; promote it to required after #1239 hardens
  pollution, timing flakiness, and positive cross-test dependencies.
- preserve #1235's contents:read and persist-credentials:false security hardening
  and main-only CI trigger.

The runtime base-drift recorded test remains excluded under #1229.

Refs #1233, #1239, #1229
@jeonghun-jj-lee
jeonghun-jj-lee changed the base branch from 1228-engine-test-ci to main September 16, 2026 19:08
@jeonghun-jj-lee
jeonghun-jj-lee merged commit c9ea35d into main Sep 16, 2026
23 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