Repository navigation
Consolidate the integration suite under test/live - #9
Merged
Merged
Conversation
The repository had two live-test conventions: test/integration.test.mjs and test/live/. They cover different ground — source binding and destination selection in one, options, signatures and delivery in the other — but nothing made that split legible, and each carried its own API client, node contexts and cleanup. The integration suite moves to test/live/provisioning.test.mjs and drops its private plumbing for the shared harness. Its resources are renamed to carry the run id, which is what brings them under the delete guard: they were previously removed by an exact-name match that would have deleted a same-named production source, and the guard would have rejected them outright. One test is added while the behaviour is in view. Applying a secret to a source that already exists is a no-op without Update Existing Source, so the source stays unverified while activation reports success — found by the Stripe suite against a real endpoint, and pinned here where the adoption rules live. CI now runs the whole live directory. The delivery suite needs the Hookdeck CLI and the Stripe suite an authenticated Stripe CLI, neither of which the runner installs, so both skip with a stated reason instead of failing on a missing binary. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CI failed on two counts, neither of which said anything about the node. A cleanup read answered 429. The project allows 240 requests a minute and these suites run back to back, so a burst is expected rather than exceptional — the API helper now honours `retry-after` and retries. Connection lookups resolve the source by name and query by `source_id` instead of listing 250 connections and filtering client-side, which also removes a silent failure once a project holds more connections than the page returns. The request lookup after an event was read once, with no polling, so the delay between the edge accepting an event and the record becoming queryable read as a missing record. Separately, the retry test was flaky here too. `hookdeck listen` health-checks the local server, and that test answers 503 on purpose; the forwarder takes the origin to be down and stops delivering, so the retry never arrives. Running the CLI with --no-healthcheck leaves the deliberate 503 to mean only what the test intends. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The retry test fired its event at the edge without checking the answer, then waited two and a half minutes for a delivery. An ingest the edge refuses creates no event at all, so that wait could only ever time out — and it reported a retry that never arrived, which points at Hookdeck's retries rather than at the request that was rejected a step earlier. Every ingest these tests depend on is now asserted, so a refusal says so at the point it happens. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The API helper these tests call directly already retried a 429, but the helper the *node* calls did not, so a rate-limited run failed inside the node with whatever it made of the rejection. CI hit it on five tests at once. That path also parsed every response body as JSON. Hookdeck answers some errors in plain text, and n8n's own helper hands back a body it could not parse rather than throwing, so strict parsing here invented a failure the node never meets in production: a 429 surfaced as "Unexpected token 'T'". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
leggetter
added a commit
that referenced
this pull request
Aug 21, 2026
* Stop the trigger offering itself as an AI tool n8n inverted this rule. When these nodes were written, omitting `usableAsTool` was a `node-usable-as-tool` error, so the trigger set it and carried a comment explaining that the resulting `hookdeckEventGatewayTriggerTool` entry was noise we had no way to opt out of. As of @n8n/eslint-plugin-community-nodes 0.29.0 — shipped in @n8n/scan-community-package 0.32.0 — setting it on a trigger is the error, and the rule no longer asks a trigger for the property at all. The repo could not see this. `^0.31.0` on a 0.x version cannot reach 0.32.0, so `npm run scan` kept passing against the scanner that had the bug while the published package would fail n8n's actual review. Bumping the scanner reproduces it at 178:3; removing the property clears it. The action node keeps `usableAsTool: true`. It is the one an agent should be calling, and the scanner agrees. Running n8n 2.35.6's own createAiTools() over the built descriptions confirms the behaviour either way: with the property it generates hookdeckEventGatewayTool and hookdeckEventGatewayTriggerTool; without it, only the former. That is the whole runtime delta — diffing the loaded description objects across the two builds shows exactly one line removed and nothing else moved. @n8n/node-cli goes to ^0.44.5 in the same change. Its own dist is unchanged from 0.42.2; what matters is that it pulls the same plugin 0.29.0, so `npm run lint` and `npm run scan` now enforce one rule set rather than two. Also fixes CONTRIBUTING.md, which still documented `npm run test:integration` after #9 renamed it to `test:live`, and notes the trigger exception in .agents/nodes.md, whose upstream copy has not caught up with the rule. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtT85W8PPr2S8RW2WhCtpi * Keep hookdeck ci --local credentials out of git `test/live` drives `hookdeck listen`, which forwards from whichever project the CLI is logged into. Pinning it per-checkout with `hookdeck ci --local` is the right answer, but that writes a project API key to .hookdeck/config.toml in the working tree, and nothing was ignoring it. This repo already has a committed .env in its history. Adding the ignore before the file can exist is cheaper than the alternative. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtT85W8PPr2S8RW2WhCtpi * Correct three claims about the rule, and cut 0.2.0 Review caught the comment this PR added being imprecise in the same way as the one it replaced. `node-usable-as-tool` reports only the literal `true`; setting `usableAsTool: false`, or the `{ replacements }` object form, is not an error. Both the trigger comment and the test's assertion message said otherwise. The test's use of `in` rather than `=== undefined` now carries the reason that actually justifies it: n8n generates the tool variant for anything truthy, so the object form passes the scan and still adds the entry. Verified against n8n 2.35.6's createAiTools — `{ replacements }` produces `fakeTriggerTool`. .env.example still pointed at `npm run test:integration`. The earlier sweep grepped only *.md and *.yml, which is exactly the file a contributor opens first when setting the live suite up. .agents/nodes.md repeated upstream's "set to `false`" for binary-data nodes. n8n-workflow types the property `true | UsableAsToolDescription`, so `false` does not typecheck — and that loose wording is what both corrected comments tripped over. CHANGELOG promoted to 0.2.0, sections in Keep a Changelog order, and the versioning rationale cut to the sentence a user can act on. README's verified-on line moves to the n8n this was exercised against. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtT85W8PPr2S8RW2WhCtpi --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #8. That PR added
test/live/but lefttest/integration.test.mjsin place, so
maincurrently carries two live-test conventions.They cover different ground — source binding and destination selection in one;
options, signatures and delivery in the other — but nothing made that split
legible, and each carried its own API client, node contexts and cleanup.
What changes
test/integration.test.mjsbecomestest/live/provisioning.test.mjsand dropsits private plumbing for the shared harness.
guard. They were previously removed by an exact-name match — which would have
deleted a same-named production source — and the guard would have rejected
them outright.
it blind. CI installs neither the Hookdeck nor the Stripe CLI, so without
this it fails with
ENOENTand reads like a broken node.test/live/directory in place oftest:integration.warnings(thewarnandinfolevels the node usesfor operator-facing guidance), which is what the moved tests assert on.
One test added
Applying a secret to a source that already exists is a no-op without Update
Existing Source — the source stays unverified while activation reports success.
Found by the Stripe suite against a real endpoint in #8, and pinned here where
the adoption rules live.
Verification
npm run test:live— 45 pass, 1 skip (delivery groups, not enabled on the testorg), exit 0, no leaked resources, no orphaned processes.
npm test106 pass.Skip paths checked directly: no API key skips every suite; a missing CLI skips
delivery and Stripe.
Unrelated, and left alone: both nodes trip
icon-prefer-themed-variants— theicon is a single
file:hookdeck.svgwhere it was the{ light, dark }form, andonly
hookdeck.svgremains on disk. That is a verification-programme rule, soworth its own fix.