test: cover GET→UPDATE workflow round-trips and n8n API quirks (#433)#925
Open
Pitchfork-and-Torch wants to merge 1 commit into
Open
Conversation
…kowski#433) Add unit and live-integration coverage for the common spread-from-GET update pattern that let description/read-only fields slip through (czlonkowski#431). - Unit: full GET-shaped payload cleaning, minimal payload, empty/unknown settings - Integration: GET→UPDATE, spread rename, nested settings, description strip, missing settings defaults, read-only field echo, minimal updates, settings filter - Document n8n read/write asymmetry in tests/integration/n8n-api/README.md
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.
Summary
Closes #433 — improves test coverage for the real-world GET → spread → UPDATE pattern that allowed Issue #431 (
description/ read-only fields on PUT) to ship without a red CI signal.Problem
Existing update tests cherry-pick writable fields:
Agents and scripts more often do:
n8n’s Public API is asymmetric (GET returns fields PUT rejects). Without round-trip coverage, cleaning regressions can pass unit cherry-picks and still break production updates.
Changes
Unit (
tests/unit/services/n8n-validation.test.ts) — always run in CI{ executionOrder: 'v1' }settings: {}→ same defaultIntegration (
tests/integration/n8n-api/workflows/update-workflow.test.ts) — live n8n when secrets presentUses
N8nApiClient.updateWorkflow()(runscleanWorkflowForUpdate) against a real instance — the path users hit.Docs
tests/integration/n8n-api/README.md— n8n read/write quirks table + how to run unit vs live suitesAcceptance criteria (#433)
Test plan
npx vitest run tests/unit/services/n8n-validation.test.ts --coverage.enabled=false→ 112 passedN8N_API_*secrets):npm run test:integration:n8n -- tests/integration/n8n-api/workflows/update-workflow.test.tsNotes
callerPolicyas “filtered”; that key is now whitelisted (n8n 1.119+). Tests use truly unknown settings keys instead.