Closed zeripath closed 6 years ago
Hmm... it looks like this one is crashing the continuous integration. Not sure quite why...
I would assume this is why: https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#default-behavior
Agh the mocha changes mean this is going to be slightly less simple. I guess I'll take another look tomorrow
Yeah, just need to make sure the servers shut down after all the tests are complete.
I really appreciate all of the contributions!
No thank you for the generator. I'm yak shaving before I actually use the generator properly.
Haha 'yak shaving', that's a new one
On Tue, Jul 24, 2018, 14:11 zeripath notifications@github.com wrote:
No thank you for the generator. I'm yak shaving before I actually use the generator properly.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular-fullstack/generator-angular-fullstack/pull/2756#issuecomment-407553574, or mute the thread https://github.com/notifications/unsubscribe-auth/AFSeAnZF27F4R-Dl7uomsETLyCPjoEAYks5uJ42EgaJpZM4VdPN5 .
@Awk34 So I'm still having difficulty figuring out what's causing this problem. Looking at templates/app/mocha.global.js
the tests should close down express after every set but it seems that somehow they're not.
I've tried sticking in delays etc. I can't even see which test is causing a restart of the express server...
This is quite frustrating...
@zeripath my assumption about what's breaking this could be wrong. Perhaps we should test with Mocha 3.5.3 to make sure it still passes, then with 4.0.0 to make sure it starts failing.
If it is breaking because of what I think, then the proper investigation path would be to attach some debugger to be able to see what's keeping the process alive after the tests are done
Ah I think I've found it.
In src/test/main.test.js:151: (amongst others)
before(function() {
return runGen(null, {
copyConfigFile: true,
options: {
skipInstall: true,
skipConfig: true
}
}).then(_dir => {
dir = _dir;
lintResult = runCmd('npm run lint');
clientTestResult = runCmd('npm run test:client');
serverTestResult = runCmd('npm run test:server');
});
});
This causes a race somewhere in creating the express server. If these are moved out into their respective it(...)
then the race stops happening and the crash goes away.
I haven't yet checked whether doing this changes the results of the serverTestResult... (i.e. is it still run in the correct directory.)
Hmm okay, I can see that causing issues. I did this to start the test commands so that they'd run in parallel and hopefully save time. Hopefully separating the server test command won't add too much time to the test runs.
Cool. It looks like I've done it!
(The package-lock.json change that creeped in by accident has been removed too. )
I think this patch might also fix issue #2746
Part of #2691
generator-angular-fullstack$ npm test
)