n8n/packages/@n8n/task-runner-python/tests
Mutasem Aldmour 09632b6711
fix(core): Address review feedback on the Python import policy
- Only treat imports as unrestricted when BOTH allowlists are wildcards, which is
  the condition the runner's own analyzer short-circuits on. With one wildcard the
  runner still checks the other category, and classifying a module needs Python's
  stdlib list, so the linter now abstains explicitly instead of implying the
  import is fine.
- Render the two allowlists as separate categories in the prompt and the lint
  message. Merging them presented a module filed under the wrong one as
  importable, though the runner rejects it.
- Stop claiming "this deployment allowlists nothing" when no policy was supplied.
  The sandbox CLI cannot see the configuration, and now says so.
- Report a wildcard combined with named modules as a misconfiguration rather than
  as a permissive allowlist. The runner refuses to start on it, so the previous
  reading told the builder its imports were fine when no Python could run at all.
- Only trust the policy in the build-time check when it is authoritative. In
  external runner mode the runner may be stricter than n8n thinks, so a
  non-authoritative policy must not silence a warning.
- Skip a stale `pythonCode` body on a node whose language is JavaScript.
- Replace a `toContain('re')` assertion that also matched "runner" in the
  surrounding prompt text, and correct the fixture's path to its Python checker.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 11:56:28 +02:00
..
fixtures fix(core): Address review feedback on the Python import policy 2026-08-27 11:56:28 +02:00
integration feat(core): Add N8N_RUNNERS_ALLOW_TRANSITIVE_IMPORTS for the Python task runner (#33130) 2026-06-30 08:20:12 +00:00
unit test(core): Cover the Python import allowlist across the n8n/runner seam 2026-08-27 11:42:14 +02:00