Repository navigation
chore(tests): port the Makefile test targets to pytest - #445
Merged
Merged
Conversation
`make tests` built real environments, but CI never ran it, and only test1 had a pytest counterpart (test_smoke). The other cases become integration tests, run by the ubuntu integration job: - test2, test3: `nodeenv -p` in a real virtualenv (one test, -j 4 has no effect with --prebuilt) - test4: `-p --node=system`, on the job's Python instead of 3.9 - test7: `freeze` after `npm install -g sitemap`, checked in Python instead of comparing with the padded output of BSD wc, which failed on Linux - test8, test9: --prebuilt into `öäü` and `test dir` - test10: the second run now uses --force; without it the installed node is skipped and the #189 branch of copytree is never reached A unit test covers that branch of copytree in the whole tox matrix. test5 (python2.7) is dropped: without the interpreter it is test2. The targets, `tests`, SETUP and the `rm -rf nodeenv/` that only cleaned up after test1 are removed from the Makefile. Closes #444
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.
Closes #444
What happens
make testsbuilds real environments, but CI never runs it, and onlytest1has a pytest counterpart (test_smoke). Two targets no longer check what they describe:test7compareswc -lwith" 1", the padded output of BSDwc. GNUwcprints1, so the target fails on Linux.test10the second run finds the same node installed and skipsinstall_node, so it never reaches the Symlink to env/bbin/npm fails if npm already exists #189 branch ofcopytree.What changes
The cases become
integrationtests intests/nodeenv_test.py, which the ubuntuintegrationjob already runs:test2,test3test_smoke_python_virtualenv:nodeenv -pin a real virtualenv. One test, since-j 4has no effect with--prebuilttest4test_smoke_python_virtualenv_n_system:-p --node=system, on the job's Python instead of 3.9test7test_smoke_python_virtualenv_freeze:npm install -g sitemap, thenfreezeprints exactly onesitemap@line, checked in Python instead of withwctest8,test9test_smoke_special_dir_names[unicode,space]:--prebuiltintoöäü/envandtest dir/envtest10test_smoke_python_virtualenv_twice: the second run uses--force, so it copies node over the links the first one left-ptests create a stdlib venv and runnodeenv -pwithVIRTUAL_ENVandPATHset as activation sets them, so-pfinds the virtualenv the way it did in the Makefile.VIRTUAL_ENVis always replaced: run from an activated dev venv, nodeenv would install node there otherwise.bin/activateand checks wherenode,npmandnpxresolve, astest_smokedoes.test_copytree_keeps_existing_symlinkcovers the Symlink to env/bbin/npm fails if npm already exists #189 branch ofcopytreein the whole tox matrix, not only in the integration job.test5(python2.7) is dropped: without the interpreter it is the same run astest2. Python 2.7 itself is setup.py still declares Python 2.7 support #436.test1..test10,tests,SETUPand therm -rf nodeenv/that only cleaned up aftertest1are removed from the Makefile.Tests
Each new check was seen failing with the code it guards removed from
nodeenv.py:copytree,test_smoke_python_virtualenv_twiceand the unit test fail withFileExistsErroronbin/npxandbin/npm;npm|corepackfilter infreeze, the freeze test gets[email protected]as a second line.The freeze test doesn't catch a missing
--depth=0: npm 11 lists only top-level packages without--allanyway.All 21 jobs of the branch push are green. The integration job runs the 6 new test ids in about 25 seconds.