Repository navigation
chore(ci): give the integration smoke tests a home and stop running them 20 times - #401
Merged
Merged
Conversation
#397 added activate-shells and this branch added integration; git saw overlapping adds in the same gap of tests.yml and interleaved them into one job. Both are kept, each with its own steps and command.
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.
Two problems
The smoke tests could not fail.
test_smokeandtest_smoke_n_system_special_charsbuild a real environment, sourcebin/activate, and rannode --version. That assertion passes even whenactivation does nothing, because a system
nodeanswers it - and GitHub'subuntu runners ship Node preinstalled. Measured on a real environment:
They were running everywhere. A pytest marker only labels; it does not
deselect.
tox.iniranpytest {posargs:tests}unfiltered, so every matrixleg ran both integration tests and downloaded Node.
tests.ymlfires on bothpushandpull_request, so a push to a PR branch cost roughly 37 Nodedownloads: 15 matrix legs plus the coverage job, twice over, plus
main.yml's five.AGENTS.mdasserted the opposite - that the marker kept them out of thedefault run - which is how the situation went unnoticed.
What this changes
The tests now assert where each command resolves, not just that it runs:
Resolution proves activation took effect; execution proves the binary works.
For
npmandnpxthe second assertion exercisesPATHindirectly too:both are symlinks to
.jsfiles whose shebang is#!/usr/bin/env node, sothey only run if
nodeis found inside the environment.test_smoke_n_system_special_charschecksnodeonly. With-n systemnodeenv writes a
nodeshim and nothing else, sonpmandnpxlegitimatelyresolve outside the environment. It deliberately does not assert they are
absent - whether
-n systemshould provide them is an open question, andpinning today's answer in a test would cement it.
tox.iniand thecoveragejob now pass-m 'not integration', and adedicated
integrationjob runs them once. Node downloads per push: 37 to2.
AGENTS.mdandmake coveragewere 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()andcopy_node_from_prebuilt()branch per platform, so macOS was a real code pathrather than redundancy. This is deliberate, and a comment above the job says
so. A
macos-latestmatrix leg is the obvious follow-up if the loss bites.The coverage number on master will drop 85% to 82%. The
integrationjob's coverage data cannot cross workflow boundaries into
main.yml'sCoverage job. The gate is
--fail-under=55, so nothing breaks.Node is not pinned. The job installs
--node=latest. Tracking Node'srelease 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 thetestjob andcoverage. Whoevermerges second will hit an overlapping-add conflict at three hunks. Resolution
is to keep both jobs.
tests/nodeenv_test.pyandtox.inimerge cleanly.Verification
All 17 CI jobs green. The
integrationjob reports2 selected, 228 deselected; every other job reports228 selected, 2 deselected.