-
Notifications
You must be signed in to change notification settings - Fork 80
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
Propagate process exit code in integration test script #83
Conversation
Tests are still failing on node 4 because it is unable to find some modules. This happens because npm@2 does not flatten installed modules and node is not able to find some packages which would be nested deeply in the project root's We could do any of the following to fix the issue:
Edit: I went with the third option. |
What are the downsides of the first option? |
The installation step would need to |
Hmmm.. if I understands correctly, sound like it can be automated by adding the installing step to autodll-webpack-plugin/scripts/runIntegrationTests.js Lines 1 to 18 in 78ca765
Something like: readdirSync(cwd)
.filter(isDirectory)
.map(dirname => join(cwd, dirname))
.forEach(ctx => {
spawnSync('npm', ['install'], {
cwd: ctx,
shell: true,
stdio: 'inherit',
});
})
.forEach(ctx => {
spawnSync('npm', ['test'], {
cwd: ctx,
shell: true,
stdio: 'inherit',
});
}); Will it do the trick? |
Yea, that was option 2. I'll update the PR to that instead. |
Ohh sorry, I missed that |
No problem 😃 |
Refactor integration test script, helpers for node 4 compatibility.
- Refactor fixture folders resolution to `getFixtures.js`. - Setup package.json script `install:fixturedeps` to run `scripts/installFixtureDeps`. - Update travis and appveyor config to `npm run install:fixturedeps`. - Run travis build only for master branch and pull requests.
0cb64b7
to
b8d67a1
Compare
This is why the tests are still failing on node 4:
The package resolution for integration tests helpers will be up the directory tree which does not include
|
Needed for integration helpers to work correctly on node 4.
I went with the third option. I have added the installation step as a separate script. The rationale for this is that in our development environment, if we want to run integration tests, we shouldn't have to run |
I see. |
I noticed that even though the integration test failed, the pre-commit hook did not fail. The status code returned by the child process was not being propagated. So this PR does the following: