Fixed browser tests yielding a false passing result in CI (#21401)

no issue

- Browser tests in CI were yielding a passing result even if one or more
tests failed (including retries).
- The `yarn dev` command that triggers the browser tests in CI was
catching any errors and exiting with code 0, resulting in a  in CI.
- This commit changes `yarn dev` to exit with code 1 if the browser
tests fail, so that CI will correctly fail if any of the browser tests
fail.
This commit is contained in:
Chris Raible 2024-10-24 17:22:37 -07:00 committed by GitHub
parent af0f26c75f
commit b44ad06015
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 2 deletions

View File

@ -239,7 +239,8 @@ async function handleStripe() {
const {result} = concurrently(commands, {
prefix: 'name',
killOthers: ['failure', 'success']
killOthers: ['failure', 'success'],
successCondition: 'first'
});
try {
@ -250,5 +251,6 @@ async function handleStripe() {
console.error(chalk.red(`If you've recently done a \`yarn main\`, dependencies might be out of sync. Try running \`${chalk.green('yarn fix')}\` to fix this.`));
console.error(chalk.red(`If not, something else went wrong. Please report this to the Ghost team.`));
console.error();
process.exit(1);
}
})();

View File

@ -59,6 +59,10 @@ const features = [{
title: 'Comment Improvements',
description: 'Enables new comment features',
flag: 'commentImprovements'
}, {
title: 'Staff 2FA',
description: 'Enables email verification for staff logins',
flag: 'staff2fa'
}, {
title: 'Custom Fonts',
description: 'Enables new custom font settings',

View File

@ -121,7 +121,15 @@ export default class SigninVerifyController extends Controller {
const resendTokenPath = `${this.ghostPaths.apiRoot}/session/verify`;
try {
yield this.ajax.post(resendTokenPath);
try {
yield this.ajax.post(resendTokenPath);
} catch (error) {
// HACK: For some reason, the server returns 200: OK and sends the email but the client still throws an error
// So we need to catch the error and throw it if it's not 'OK'
if (error !== 'OK') {
throw error;
}
}
this.startResendTokenCountdown();
return TASK_SUCCESS;
} catch (error) {