-
Notifications
You must be signed in to change notification settings - Fork 295
Conversation
There's some tests I don't know how to re-write: Lines 570 to 610 in 707cd2a
I'm not very fluent with the Node ecosystem, and I'm struggling to write the test in a way that checks if As far as I can tell, the old error behavior of I do think the functionality works, I'm just unsure how to prove it within a test. |
As for the additional failures on Python 3, I'm seeing a lot of this:
|
Hmm. Maybe copy a real, valid Python interpreter to a test path, and try to check that... ? But I don't know how you'd verify that the correct binary was actually executed. Honestly, it might be okay to just delete the test. As long as we're passing the environment variables along correctly, we're really testing node-gyp instead of apm at that point. 🤔 |
You may be interested to know that the commit I just pushed earlier resolves the failures unique to Python 3. (Edit to explain: Node v0.10.3 + modern i.e. the only things left to do here are the two tests I was complaining about/which your comment just now is referring to. |
This comment has been minimized.
This comment has been minimized.
This is the latest in the 10.x LTS series, at the moment.
Also, add headers for Node v10.20.1
cf5a343
to
77227d8
Compare
Whoops, I forgot to commit an updated Tests should be passing now on Python 2 & 3, other than the "respects configurable python" tests as discussed above. (There were many other things I tried on another branch that aren't needed, i.e. updating most dependencies and making code tweaks to match breaking changes in dependencies, so I left them out to keep this PR focused on one thing.) |
I tried enabling the This gives a lot of output to the console, particularly this interesting stuff about finding/picking a Python executable: $ export PYTHON="../spec/fixtures/fake-python-1.sh"
$ ../bin/apm install --verbose
[...snipped...]
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python checking Python explicitly set from environment variable PYTHON
gyp verb find Python - process.env.PYTHON is "../spec/fixtures/fake-python-1.sh"
gyp verb find Python - executing "../spec/fixtures/fake-python-1.sh" to get executable path
gyp verb find Python - "../spec/fixtures/fake-python-1.sh" is not in PATH or produced an error
gyp verb find Python checking if "python" can be used
gyp verb find Python - executing "python" to get executable path
gyp verb find Python - executable path is "/usr/bin/python"
gyp verb find Python - executing "/usr/bin/python" to get version
gyp verb find Python - version is "2.7.18"
gyp info find Python using Python version 2.7.18 found at "/usr/bin/python"
[...snipped...] I am only blocked at this point by not knowing how to redirect that text from stdout/console.log output into some variable. Or any way to compare the text to an expected value. I think this (or similar) should work as the check/comparison logic: |
In other words, this looks easily fixable, I just don't know how to capture stdout. 🙊 Seems like an easy thing to do? (I'm not versed in the JavaScript/Node APIs though, so guessing it is taking me a lot of time/effort for an arguably small pay-off.) |
No longer working with new `node-gyp`; Deleting rather than re-writing.
The 'with a space' dir is a copy of the 'node-gyp' module, just with spaces in the path (i.e. 'with a space/bin/node-gyp'). If this is still present on subsequent test runs, the latter runs will fail. Deleting it allows subsequent runs to pass.
Hi again,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent ✨
|
||
# Read + execute permission | ||
fs.chmodSync(process.env.npm_config_node_gyp, fs.constants.S_IRUSR | fs.constants.S_IXUSR) | ||
|
||
afterEach -> | ||
delete process.env.npm_config_node_gyp | ||
fs.removeSync(path.join(nodeModules, 'with a space')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thanks again for taking the time to take care of this after I ran out of time to! I'll publish and ⬆️ the version in atom/atom tomorrow when I'm back on the laptop. |
Description of the Change
This branch contains the commits from #875, along with some fixes to make more of the tests pass, as described at length here: #875 (comment)
A couple of remaining tests need to be re-written, at which point all tests will pass with Python 2.
Note: About 12 tests are still not passing when using Python 3!!![Edit: Fixed!]Alternate Designs
This is just an attempt to iterate on #875, so I don't have an alternate design to describe here.
(Other than... "This, but with passing tests! Including with Python 3!")
Benefits
Passes several more tests than #875
Possible Drawbacks
Still needs a couple tests re-written for Python 2.
and more debugging to pass all tests with Python 3[Edit: Python 3 issues are resolved. Discussion of broken/invalidated Python 2 tests is ongoing.]
Travis CI config should probably be updated to test using Python 3, in addition to the current default
python
, Python 2.Verification Process
Lots of testing with
./bin/npm test
.All but the still-broken tests should pass in Travis CI. (Expected to be: 4 failures in 2 tests.)
Applicable Issues
See also #875 for a bit of prior discussion.