0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

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, { const {result} = concurrently(commands, {
prefix: 'name', prefix: 'name',
killOthers: ['failure', 'success'] killOthers: ['failure', 'success'],
successCondition: 'first'
}); });
try { 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 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(chalk.red(`If not, something else went wrong. Please report this to the Ghost team.`));
console.error(); console.error();
process.exit(1);
} }
})(); })();

View file

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

View file

@ -120,8 +120,16 @@ export default class SigninVerifyController extends Controller {
*resendTokenTask() { *resendTokenTask() {
const resendTokenPath = `${this.ghostPaths.apiRoot}/session/verify`; const resendTokenPath = `${this.ghostPaths.apiRoot}/session/verify`;
try {
try { try {
yield this.ajax.post(resendTokenPath); 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(); this.startResendTokenCountdown();
return TASK_SUCCESS; return TASK_SUCCESS;
} catch (error) { } catch (error) {