Fail mock test runs if tests fail

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal 2025-09-24 11:36:04 -05:00 committed by GitHub
commit 5df80cb93d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 13 deletions

View file

@ -364,6 +364,7 @@ jobs:
mock-tests:
needs: lint
continue-on-error: true
strategy:
matrix:
workerIndex: [0, 1, 2, 3]
@ -450,5 +451,5 @@ jobs:
if: failure()
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
with:
name: logs
name: logs-${{ matrix.workerIndex }}
path: artifacts

View file

@ -22,6 +22,8 @@ const filteredFiles = files.filter((_file, index) => {
console.log(`Running on ${filteredFiles.length}/${files.length} of files`);
spawnSync(MOCHA, [...flags, ...filteredFiles], {
const { status } = spawnSync(MOCHA, [...flags, ...filteredFiles], {
stdio: 'inherit',
});
process.exit(status);

View file

@ -1,7 +1,6 @@
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai';
import createDebug from 'debug';
import Long from 'long';
@ -64,13 +63,12 @@ describe('readSync', function (this: Mocha.Suite) {
.waitFor();
debug('checking left pane for 3 unread');
const unreadCount = await leftPane
await leftPane
.locator(
'.module-conversation-list__item--contact-or-conversation__unread-indicator.module-conversation-list__item--contact-or-conversation__unread-indicator--unread-messages'
'.module-conversation-list__item--contact-or-conversation__unread-indicator.module-conversation-list__item--contact-or-conversation__unread-indicator--unread-messages >> "3"'
)
.first()
.innerText();
assert.equal(unreadCount, '3', 'unread count');
.waitFor({ state: 'visible' });
debug('incoming out of order messages');
const massTimestamps = Array.from(Array(100)).map(() =>
@ -134,15 +132,12 @@ describe('readSync', function (this: Mocha.Suite) {
await sendUnreadMessage();
debug('checking left pane for 1 unread');
const newUnreadCount = await leftPane
await leftPane
.locator(
'.module-conversation-list__item--contact-or-conversation__unread-indicator.module-conversation-list__item--contact-or-conversation__unread-indicator--unread-messages'
'.module-conversation-list__item--contact-or-conversation__unread-indicator.module-conversation-list__item--contact-or-conversation__unread-indicator--unread-messages >> "1"'
)
.first()
.innerText();
assert.equal(newUnreadCount, '1', 'updated unread count');
debug({ newUnreadCount });
.waitFor({ state: 'visible' });
debug('opening conversation');
await leftPane