Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration/scripts/httpServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const serveFromTempDir = async (config: HttpServerConfig): Promise<{ pid: number
stderr: fs.openSync(stderrFilePath, 'a'),
});

await waitForServer(serverUrl, { log: console.log, maxAttempts: Infinity });
await waitForServer(serverUrl, { log: console.log, maxAttempts: 60 });
console.log(`${config.name} is being served from`, serverUrl);

return { pid: proc.pid, serverUrl };
Expand Down
9 changes: 6 additions & 3 deletions integration/tests/global.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ import { appConfigs } from '../presets';
import { fs, parseEnvOptions, startClerkJsHttpServer, startClerkUiHttpServer } from '../scripts';

setup('start long running apps', async () => {
setup.setTimeout(90_000);
setup.setTimeout(240_000);

await fs.ensureDir(constants.TMP_DIR);

await startClerkJsHttpServer();
await startClerkUiHttpServer();
const httpServerStart = Date.now();
await Promise.all([startClerkJsHttpServer(), startClerkUiHttpServer()]);
console.log(`HTTP servers started in ${Date.now() - httpServerStart}ms`);

const { appIds } = parseEnvOptions();
if (appIds.length) {
const apps = appConfigs.longRunningApps.getByPattern(appIds);
// state cannot be shared using playwright,
// so we save the state in a file using a strategy similar to `storageState`
const appStart = Date.now();
await Promise.all(apps.map(app => app.init()));
console.log(`Apps initialized in ${Date.now() - appStart}ms`);
Comment on lines +8 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add/adjust tests for the new setup behavior.

Lines 8-23 change the global setup timeout and parallel startup flow, but no tests were added or updated in this PR. Please add coverage for these changes before merge. As per coding guidelines, “If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.”

🤖 Prompt for AI Agents
In `@integration/tests/global.setup.ts` around lines 8 - 23, The PR changes global
setup timeout and starts HTTP servers and app inits in parallel (see
setup.setTimeout, startClerkJsHttpServer, startClerkUiHttpServer,
parseEnvOptions, appConfigs.longRunningApps.getByPattern and app.init) but no
tests were added; add/adjust tests to cover the new behavior by creating
integration tests that assert the increased timeout is applied, both HTTP
servers start successfully when run in parallel (mock or test endpoints for
startClerkJsHttpServer and startClerkUiHttpServer), and that apps returned by
appConfigs.longRunningApps.getByPattern are initialized via app.init with the
new parallel flow and saved state behavior; ensure tests fail if servers or
app.init do not complete within the configured timeout and add them to the
appropriate test suite so CI enforces the coverage.

} else {
// start a single app using the available env variables
}
Expand Down
Loading