-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
Re-enable Windows in CI #500
Conversation
ec48728
to
d33cf55
Compare
|
||
process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH; | ||
setFixtureDir(); |
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.
How the PATH
/Path
environment variable in the GitHub actions Windows environment seems to have changed, making the CI tests fail. In particular, its name is now Path
instead of PATH
.
Using path-key
fixes this. I put this as a shared helper to avoid code duplication.
}); | ||
|
||
test('preferLocal: false', async t => { | ||
await t.throwsAsync(execa('ava', ['--version'], {preferLocal: false, env: {Path: '', PATH: ''}}), {message: ENOENT_REGEXP}); |
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.
I am not completely sure why, but this fixes those tests on Windows.
Filtering the .bin
directories from the PATH
variable seems more adequate than making it completely empty as well.
t.deepEqual(stdout.split('\n'), ['foo', 'bar']); | ||
}); | ||
|
||
test('do not extend environment with `extendEnv: false`', async t => { | ||
const {stdout} = await execa('environment.js', [], {env: {BAR: 'bar', PATH: process.env.PATH}, extendEnv: false}); | ||
const {stdout} = await execa('environment.js', [], {env: {BAR: 'bar', [PATH_KEY]: process.env[PATH_KEY]}, extendEnv: false}); |
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.
This fixes the tests on Windows.
Good investigation 👍 |
This fixes the tests on Windows CI, and re-enables it. 🎉