Skip to content

ci: run the OpenCode plugin's node tests on all three platforms - #4529

Open
amnesiaof wants to merge 2 commits into
rtk-ai:developfrom
amnesiaof:ci/opencode-plugin-tests
Open

amnesiaof wants to merge 2 commits into
rtk-ai:developfrom
amnesiaof:ci/opencode-plugin-tests

Conversation

@amnesiaof

Copy link
Copy Markdown
Contributor

hooks/opencode/rtk.test.mjs landed in the tree with #4187, and nothing runs it.

The plugin is a TypeScript file that gets copied into the user's config directory. It is not a cargo artifact, so cargo test --all cannot reach it, and no other job in ci.yml claimed it. Ten tests were sitting in the repo executing nowhere: PATH discovery, the hook opencode --help probe, argv construction, the registered hooks, and the failure paths.

Seven lines, added to the existing test job so they run on all three matrix platforms. That placement is the whole point — the plugin's reported failures were cross-platform by nature (which missing on Windows, no Bun $ shell on Desktop), and a single-platform job would have hidden the class of bug that actually kept happening.

No build step and no node_modules: Node 22.18+ strips the types without a loader, and the test mocks rtk rather than needing one built.

Not done here, worth its own issue: the test only covers the TypeScript half. The Rust side is covered by cargo test --all, but nothing checks that the two stay in step — a change to the hook opencode contract that the plugin does not use yet would pass CI on both halves while breaking in the product.

Opened from a fork; amnesiaof/rtk still has read-only access to this repo. Branch is amnesiaof:ci/opencode-plugin-tests, one commit on develop.

`hooks/opencode/rtk.test.mjs` was merged with rtk-ai#4187 but nothing executed it.
The plugin is a TypeScript file shipped into the user's config directory, not a
cargo artifact, so `cargo test --all` cannot reach it and no other job claimed
it. Ten tests covering PATH discovery, the `hook opencode --help` probe, argv
construction and the registered hooks ran nowhere.

Added to the existing `test` job rather than a new one so it runs on all three
matrix platforms, which is the point: the plugin's failures were cross-platform
by nature — `which` missing on Windows, no Bun `$` shell on Desktop.

Node 22.18+ strips the types without a loader, so no `tsc` step and no
`node_modules` are needed, and the test mocks `rtk` rather than requiring a
build.
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🔧 Type chore
🟢 Risk low

Summary

Adds a step to the existing CI test job to run the OpenCode plugin's Node test file (hooks/opencode/rtk.test.mjs) on all three matrix platforms, since it was previously never executed by CI. No build step is needed since Node 22+ strips TypeScript types natively and the test mocks rtk.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Analyzed automatically by wshm · This is an automated analysis, not a human review.

@amnesiaof
amnesiaof force-pushed the ci/opencode-plugin-tests branch from 9fde4e6 to e10337a Compare October 12, 2026 08:20
hooks/opencode/rtk.test.mjs was merged with rtk-ai#4187 but nothing executed it.
The plugin is a TypeScript file shipped into the user's config directory, not a
cargo artifact, so 'cargo test --all' cannot reach it and no other job claimed
it. Ten tests covering PATH discovery, the 'hook opencode --help' probe, argv
construction and the registered hooks ran nowhere.

Added to the existing 'test' job rather than a new one so it runs on all three
matrix platforms, which is the point: the plugin's failures were cross-platform
by nature -- 'which' missing on Windows, no Bun shell on Desktop.

Node 24 strips the types without a loader, so no tsc step and no node_modules
are needed, and the test mocks rtk rather than requiring a build. setup-node is
pinned to v7, the major actions/checkout and setup-go already use here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant