Consolidate the integration suite under test/live - #9
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>
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.