Skip to content

Commit

Permalink
Add prevalidation delay for test runner stages
Browse files Browse the repository at this point in the history
  • Loading branch information
Brainicism committed Apr 13, 2024
1 parent 88828e7 commit e75e3ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/end-to-end-tests/test-runner-bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ async function evaluateStage(messageResponse?: {

log(`STAGE ${CURRENT_STAGE.stage} | Validating stage`);
const stageOutputValidator = testStage.responseValidator;
if (testStage.prevalidationDelay) {
await delay(testStage.prevalidationDelay);
}

if (
stageOutputValidator(
messageResponse?.title!,
Expand Down
1 change: 1 addition & 0 deletions src/test/end-to-end-tests/test_suites/gameplay_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ const PLAY_TEST_SUITE: TestSuite = {
console.log(`voiceMembers: ${voiceMembers.join(", ")}`);
return !voiceMembers.includes(process.env.BOT_CLIENT_ID!);
},
prevalidationDelay: 3000,
expectedResponseType: KmqResponseType.NONE,
},
],
Expand Down
1 change: 1 addition & 0 deletions src/test/end-to-end-tests/test_suites/test_suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default interface TestSuite {
client?: Eris.Client,
) => boolean;
expectedResponseType: KmqResponseType;
prevalidationDelay?: number;
preCommandDelay?: number;
}[];
cascadingFailures: boolean;
Expand Down

0 comments on commit e75e3ca

Please sign in to comment.