Repository navigation
test: add an opt-in emulate.dev end-to-end tier for the Slack adapter - #149
Conversation
Add `mise run emulate` (emulate@0.12.3) with a seed in testdata/emulate/seed.yaml, and TestEmulate* tests in adapters/slack that skip unless CHAT_EMULATE_SLACK_URL is set. They cover a signed Events API message event through the adapter's HTTP handler to a thread reply that conversations.replies shows, and a simulated button click through the adapter's HTTP handler to the interaction handler. A separate Emulate workflow runs the tier, so it cannot turn CI red. CONTRIBUTING.md explains how to run it and lists emulate's known gaps, including the Linear schema differences that block Linear tests (#148). Closes #147 _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
@codex review |
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Readiness record for head
Generated with |
Closes #147
What this adds
An opt-in end-to-end test tier that runs the Slack adapter against emulate.dev (
vercel-labs/emulate, Apache-2.0), pinned toemulate@0.12.3.mise run emulatestarts Slack on:4710and Linear on:4711withtestdata/emulate/seed.yaml(a workspace, a user, a bot from a seeded OAuth app, a channel, and a Linear team).mise run test:emulateruns the tests against it.adapters/slack/emulate_test.gohas two tests. They skip unlessCHAT_EMULATE_SLACK_URLis set, likeTestLive.TestEmulateSlackEventReply: a user message is posted to emulate, then a signed Events APImessageevent goes to the adapter's HTTP handler. The mention handler replies in the thread, andconversations.replieson emulate must show the bot reply.TestEmulateSlackBlockAction: the bot posts a button. emulate's block-action simulator clicks it and sends the signed interaction to the seeded interactivity URL (127.0.0.1:4799). The interaction handler must get the action ID, the button value, and the clicking user..github/workflows/emulate.yamlruns the tier in its ownEmulateworkflow, so a failure there does not turnCIred. Every action is pinned by full SHA.ci.yamlis unchanged, so Node stays out of thetestjobs.CONTRIBUTING.mdexplains how to run it and lists the known gaps. The Slack and Linear package READMEs point to it.No new Go module dependencies. No ADR: this is test tooling, and the owner decision (D3, Option A) is recorded in #147.
Scope changes from the request
User.organization, noCommentCreateInput.parentId, a differentAgentActivityCreateInput, and different webhook shapes). emulate 0.13.0 has the same code. The owner chose to ship without Linear tests. test: add Linear to the emulate.dev tier once emulate's Linear schema matches Linear #148 tracks adding them when emulate matches.event_callbackitself. emulate 0.12.3 dispatches Events API callbacks only to subscriptions registered through its internal JavaScript dispatcher. Neither the CLI nor the seed can register one. So the test posts the user message to emulate, then signs and sends the event for that message. The reply andconversations.repliesstill go through emulate. This gap is in the docs.Local evidence
Unset variable: the new tests skip.
Every module, variable unset:
mise run vetandmise run testpass (exit 0), the same as onmain.With
mise run emulaterunning in another terminal:Red checks
I dropped the reply: the mention handler returned
nilwithoutev.Thread.Post.TestEmulateSlackEventReplyfailed:I gave the adapter a wrong signing secret. emulate's signed click got a 401, and
TestEmulateSlackBlockActionfailed:I restored the file after each check (byte-identical copy), and both tests passed again.
Known gaps (also in CONTRIBUTING.md)
The fakes (
slackapitest,linearAPIServer) and the live tests (TestLive*) stay the source of truth for Slack's exact rules.apps.connections.openreturns 404 (checked).conversations.historyandconversations.replies(checked:ok:true). Real Slack returnsinvalid_arguments, so this tier would have missed bug(adapters/slack): HistoryReader fails on live Slack — conversations.history/replies sent as JSON #98.strict_scopes: true. The seed leaves them relaxed.npx emulate@0.12.3pins emulate itself, but npm resolves its three runtime dependencies (commander,picocolors,yaml) by semver range at install time.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high