mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-27 05:38:09 -05:00
Fix flaky streams e2e tests caused by cron routines running in test servers
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
everyTwoMinutes,
|
||||
} from "./routines/list.server";
|
||||
import { loadAllDateFnsLocales } from "./utils/dates";
|
||||
import { IS_E2E_TEST_RUN } from "./utils/e2e";
|
||||
import { logger } from "./utils/logger";
|
||||
|
||||
// Reject/cancel all pending promises after 5 seconds
|
||||
@@ -89,7 +90,7 @@ declare global {
|
||||
var appStartSignal: undefined | true;
|
||||
}
|
||||
|
||||
if (!global.appStartSignal && ServerConfig.isProduction) {
|
||||
if (!global.appStartSignal && ServerConfig.isProduction && !IS_E2E_TEST_RUN) {
|
||||
global.appStartSignal = true;
|
||||
|
||||
cron.schedule("0 */1 * * *", async () => {
|
||||
|
||||
@@ -243,6 +243,10 @@ async function globalSetup(config: FullConfig) {
|
||||
// no system messages to a shared skalop instance (see build env above)
|
||||
SKALOP_SYSTEM_MESSAGE_URL: "",
|
||||
SKALOP_TOKEN: "",
|
||||
// creds from .env must not reach test servers (SyncLiveStreams would
|
||||
// hit the real Twitch API and overwrite factory-seeded streams)
|
||||
TWITCH_CLIENT_ID: "",
|
||||
TWITCH_CLIENT_SECRET: "",
|
||||
// tests assert webhook payloads by listening on the worker's webhook port
|
||||
SQ_CANCEL_DISCORD_WEBHOOK_URL: `http://localhost:${e2eWebhookPort(i)}/sq-cancel`,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user