Skip to content

A missing Python is not a skip, it is UNSUP, and it blocks - #3

Merged
StepenkoAnatoli merged 1 commit into
mainfrom
fix/python-prerequisite-is-not-a-skip
Sep 20, 2026
Merged

StepenkoAnatoli merged 1 commit into
mainfrom
fix/python-prerequisite-is-not-a-skip

Conversation

@StepenkoAnatoli

Copy link
Copy Markdown
Owner

Fixes the review finding on #2.

The defect

The test file added in 90a22a9 used if (!python) return in 5 tests. That prints ok having asserted nothing — a false green. It was worst in this file of all places, because the defect under test is a Node/Python divergence: a green run with no Python validates nothing while claiming the two languages agree.

harness.mjs already has the mechanism, and its docstring names the exact mistake:

It is NOT a skip. A test that returns early on a missing prerequisite prints ok having asserted nothing, which is the same false green ADR-0021 exists to prevent, one layer up.

Mine was the only silent skip in the repository. The three older Python tests assert python.status === 0, so a Python-less host fails them — blunt, but never a false green.

The fix

5 × if (!python) return → requireCapability(PYTHON, 'PYTHON-NOT-FOUND', ...).

Verification

node research-kit/bin/selftest.mjs    -> 565 passed, 0 failed
node research-kit/bin/preflight.mjs   -> PASS, 0 blocking, 0 warnings

Reproduced the missing-Python condition by pointing the probe at an interpreter that does not exist:

5 UNSUP  PYTHON-NOT-FOUND ... blocking=5, exit 1 (selftest.mjs:56)
1 ok     the structural scan, which needs no Python and correctly still runs

I tried stripping PATH first; on Windows the child process still resolved Python, so that reproduction proved nothing and I replaced it with one that works.

CI cannot hit this path anyway: .github/workflows/offline-suite.yml pins actions/setup-python@v5 at 3.12 and runs python --version before the suite — so the second half of the review question is already guaranteed.

Deliberately not changed

The three older conformance tests. They block correctly already; converting them to requireCapability is a reporting improvement, not a defect fix, and belongs in its own change rather than widening this one.

🤖 Generated with Claude Code

WHAT CHANGED
  test/canonical-float-policy.test.mjs   5 x `if (!python) return` -> requireCapability

WHY
  The file I added in 90a22a9 returned early when no python was found, which
  prints `ok` having asserted nothing. harness.mjs already has the mechanism for
  this, and its docstring says exactly what I did wrong:

    "It is NOT a skip. A test that returns early on a missing prerequisite
     prints `ok` having asserted nothing, which is the same false green
     ADR-0021 exists to prevent, one layer up."

  Worst in this file of all places: the defect under test IS a Node/Python
  divergence, so a green run with no python validates nothing at all while
  claiming the two languages agree.

  Mine was the only silent skip in the repository. The three older Python tests
  assert `python.status === 0`, so a python-less host fails them - blunt, but
  never a false green.

WHAT I VERIFIED
  node research-kit/bin/selftest.mjs   -> 565 passed, 0 failed
  node research-kit/bin/preflight.mjs  -> PASS, 0 blocking, 0 warnings

  Reproduced the missing-python condition by pointing the probe at an
  interpreter that does not exist:

    5 UNSUP  PYTHON-NOT-FOUND, blocking=5, exit 1 (selftest.mjs:56)
    1 ok     the structural scan, which needs no python and correctly still runs

  Attempted first by stripping PATH; on Windows the child still resolved python,
  so that reproduction was worthless and I replaced it with one that works.

  CI cannot hit this path: .github/workflows/offline-suite.yml pins
  actions/setup-python@v5 at 3.12 and runs `python --version` before the suite.

WHAT I DID NOT CHANGE
  The three older conformance tests. They block correctly already; converting
  them is a reporting improvement, not a defect fix, and belongs in its own
  change rather than widening this one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@StepenkoAnatoli
StepenkoAnatoli merged commit 798d256 into main Sep 20, 2026
1 check passed
@StepenkoAnatoli
StepenkoAnatoli deleted the fix/python-prerequisite-is-not-a-skip branch September 20, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant