-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Support environment variable system PATH test on Windows machines #132
Conversation
@JayCanuck thats actually pretty interesting... I'm not sure how to move forward... |
Yea, definitely an optional PR. Travis isn't using Windows (and I suspect most people running the tests aren't either). Only figured worth making a PR for consideration given the git-hooks that run the tests pre-push. Could alternatively modify the tests to set some value to |
Codecov Report
@@ Coverage Diff @@
## master #132 +/- ##
=========================================
Coverage ? 98.03%
=========================================
Files ? 1
Lines ? 51
Branches ? 0
=========================================
Hits ? 50
Misses ? 1
Partials ? 0 Continue to review full report at Codecov.
|
If the tests worked out of the box on Windows it would make it a lot easier for Windows users to contribute. I had to make edits to the tests to get it working locally (not fun) and then had to revert those changes before committing (risks mistakes). The test in question should just use a different environment variable that will work cross platform. |
Sorry about this, but its resolved in the latest PR. Closing this one in favor of the other one. Definitely a good observation. |
@mrsteele which pull request fixes it out of curiosity? |
@mrsteele Tests still fail on my Windows 10 machine due to use of
Any reason to not use a different environment variable that doesn't vary like this? Seems like it would also make the test cleaner so it doesnt need the |
@tysonmatanich Is that the norm with Windows 10? My env is |
I just read this on the node docs:
https://nodejs.org/api/process.html Do you have a recommendation of any other environment variable? Or maybe we can set up a variable that we know should exist on the system? The latter might be the safest:
Thoughts? |
I never changed the path variable on my system, not sure why ours are different. Perhaps a newish fresh install is different than an older system updated to the same version (just a guess). I think the method of setting an environment variable would be the safest and most reliable. |
@tysonmatanich wanna take a stab at a PR? I can do it, but probably wont be for a little bit. |
I noticed on my Windows machine it used
Path
variable key inprocess.env
. While in normal cases that would resolveprocess.env.PATH
case-insensitive correctly, the act of copying system vars withindotenv
resulted in the case-sesitivePath
entry, which would fail the test. Added a workaround to ensure uppercasePATH
is set on Windows machines appropriately.Hardly a necesary PR to take, but wanted to offer it if interested.