Skip to content

chore(ci): give the integration smoke tests a home and stop running them 20 times - #401

Merged
ekalinin merged 8 commits into
masterfrom
chore/ci-integration-smoke
Sep 18, 2026
Merged

ekalinin merged 8 commits into
masterfrom
chore/ci-integration-smoke

Conversation

@ekalinin

Copy link
Copy Markdown
Owner

Two problems

The smoke tests could not fail. test_smoke and
test_smoke_n_system_special_chars build a real environment, source
bin/activate, and ran node --version. That assertion passes even when
activation does nothing, because a system node answers it - and GitHub's
ubuntu runners ship Node preinstalled. Measured on a real environment:

inside the env:      node -> /tmp/ne/bin/node        v26.9.0
                     npm  -> /tmp/ne/bin/npm         11.19.1
                     npx  -> /tmp/ne/bin/npx         11.19.1
after deactivate:    node -> /opt/homebrew/bin/node  (system)

They were running everywhere. A pytest marker only labels; it does not
deselect. tox.ini ran pytest {posargs:tests} unfiltered, so every matrix
leg ran both integration tests and downloaded Node. tests.yml fires on both
push and pull_request, so a push to a PR branch cost roughly 37 Node
downloads
: 15 matrix legs plus the coverage job, twice over, plus
main.yml's five.

AGENTS.md asserted the opposite - that the marker kept them out of the
default run - which is how the situation went unnoticed.

What this changes

The tests now assert where each command resolves, not just that it runs:

for command in ENV_COMMANDS:
    resolved, version = _resolve_and_run(activate, command)
    assert _inside(resolved, nenv_path), \
        '%s resolved to %s, outside %s' % (command, resolved, nenv_path)
    assert version, '%s --version printed nothing' % command

Resolution proves activation took effect; execution proves the binary works.
For npm and npx the second assertion exercises PATH indirectly too:
both are symlinks to .js files whose shebang is #!/usr/bin/env node, so
they only run if node is found inside the environment.

test_smoke_n_system_special_chars checks node only. With -n system
nodeenv writes a node shim and nothing else, so npm and npx legitimately
resolve outside the environment. It deliberately does not assert they are
absent - whether -n system should provide them is an open question, and
pinning today's answer in a test would cement it.

tox.ini and the coverage job now pass -m 'not integration', and a
dedicated integration job runs them once. Node downloads per push: 37 to
2
. AGENTS.md and make coverage were corrected to match.

Trade-offs worth knowing

Platform coverage shrinks. Those tests used to run on ubuntu, macOS and
Windows via tox; now ubuntu only. get_node_bin_url() and
copy_node_from_prebuilt() branch per platform, so macOS was a real code path
rather than redundancy. This is deliberate, and a comment above the job says
so. A macos-latest matrix leg is the obvious follow-up if the loss bites.

The coverage number on master will drop 85% to 82%. The integration
job's coverage data cannot cross workflow boundaries into main.yml's
Coverage job. The gate is --fail-under=55, so nothing breaks.

Node is not pinned. The job installs --node=latest. Tracking Node's
release layout is what nodeenv is for, and a pin would hide exactly the
breakage this test should catch. The cost is that a Node release can redden
this job on an unrelated pull request; it is a separate job, so that reads as
external.

Conflicts with #397

Both branches insert a new job into the same gap in
.github/workflows/tests.yml, between the test job and coverage. Whoever
merges second will hit an overlapping-add conflict at three hunks. Resolution
is to keep both jobs. tests/nodeenv_test.py and tox.ini merge cleanly.

Verification

All 17 CI jobs green. The integration job reports 2 selected, 228 deselected; every other job reports 228 selected, 2 deselected.

@ekalinin
ekalinin merged commit 9ea8e00 into master Sep 18, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant