-
Notifications
You must be signed in to change notification settings - Fork 77
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
upAll doesn't fail when docker-compose failed to up #74
Comments
@deser I created a rough fix for it in #75 but currently it breaks our tests due to an odd behaviour in @Steveb-p What are your thoughts on this? |
@AlexZeitler looks good to me. It's exactly the kind of behavior that exit code reliance should fix. EDIT: I'm looking confused at the CI errors :) EDIT2: It seems that |
@Steveb-p Sorry haven't got an update notification for your edit updates 😞 Looking at the failing test |
@AlexZeitler Actually, I've checked this again after your comment. Apparently, there is nothing wrong with how EventEmitter for child processes behaves in relation to promises. It's just that now tests actually do reject, which causes Previously they would just always resolve. I'm in the process of reworking tests to take it into account. Also, I'm changing the |
@AlexZeitler I'm working on it and migrating it to Jest, but kinda got stuck on some Docker issues for building. And apparently some building tests check wrong services - which I've noticed only after I've started migrating. If you're gonna look on it further tomorrow (since it's 1:00 here and I have to go to work early in the morning and not be a worthless zombie), you'd probably want to change in your PR at the very least: childProc.on('exit', exitCode => {
result.exitCode = exitCode;
if (exitCode === 0) {
resolve(result);
} else {
reject(result);
}
}); So it rejects with stderr and output still available and without wrapping it with childProc.on('exit', exitCode => {
result.exitCode = exitCode;
if (exitCode !== 0) {
return reject(new Error(result.err));
}
return resolve(result);
}); In test/index.js, where you have: assert.equal(1, (await compose.logs('non_existent_service', { cwd: path.join(__dirname) })).exitCode); it should be replaced with something similar to: try {
await compose.logs('non_existent_service', { cwd: path.join(__dirname) });
assert.true(false, 'Execution should not reach this point');
} catch (result) {
assert.equal(result.exitCode, 1);
}
await compose.down({ cwd: path.join(__dirname), log: true });
assert.end(); (also, notice missing |
@Steveb-p That's what I noticed as well and tried and also tried to fix it. |
My I'll publish the PR in the evening when I have access to the laptop with relevant branch on. EDIT: I'm pretty sure I based that branch on yours. |
#77 should properly solve this case. 0.19 version of this package should now reject in this case. |
@AlexZeitler I believe it should be closed, unless it still doesn't work in 0.19/0.20. @deser try if it works for you, if possible. |
Thanks, seems it is |
Great, I'll close this then... |
Circumstances:
docker for windows hasn't been started
Usage:
What I see in console:
Expected behavior:
The text was updated successfully, but these errors were encountered: