Skip to content

Commit dcb91cb

Browse files
committed
fix 5
1 parent 0a1b85e commit dcb91cb

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ jobs:
374374
env:
375375
E2E_APP_CLERK_JS_DIR: ${{runner.temp}}
376376
E2E_APP_CLERK_UI_DIR: ${{runner.temp}}
377-
E2E_CLERK_JS_VERSION: "integration"
378-
E2E_CLERK_UI_VERSION: "integration"
377+
E2E_CLERK_JS_VERSION: "latest"
378+
E2E_CLERK_UI_VERSION: "latest"
379379
E2E_NEXTJS_VERSION: ${{ matrix.next-version }}
380380
E2E_PROJECT: ${{ matrix.test-project }}
381381
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }}
@@ -476,8 +476,8 @@ jobs:
476476
env:
477477
E2E_APP_CLERK_JS_DIR: ${{runner.temp}}
478478
E2E_APP_CLERK_UI_DIR: ${{runner.temp}}
479-
E2E_CLERK_JS_VERSION: "integration"
480-
E2E_CLERK_UI_VERSION: "integration"
479+
E2E_CLERK_JS_VERSION: "latest"
480+
E2E_CLERK_UI_VERSION: "latest"
481481
E2E_NEXTJS_VERSION: ${{ matrix.next-version }}
482482
E2E_PROJECT: ${{ matrix.test-project }}
483483
E2E_CLERK_ENCRYPTION_KEY: ${{ matrix.clerk-encryption-key }}

integration/models/application.ts

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ export const application = (
1616
const logger = createLogger({ prefix: `${appDirName}` });
1717
const state = { completedSetup: false, serverUrl: '', env: {} as EnvironmentConfig };
1818
const cleanupFns: { (): unknown }[] = [];
19-
const now = Date.now();
20-
const stdoutFilePath = path.resolve(appDirPath, `e2e.${now}.log`);
21-
const stderrFilePath = path.resolve(appDirPath, `e2e.${now}.err.log`);
2219
let buildOutput = '';
2320
let serveOutput = '';
2421

@@ -68,16 +65,32 @@ export const application = (
6865
return { port, serverUrl: runtimeServerUrl };
6966
}
7067

68+
// Always log to console so we can see what's happening
69+
const logOutput = (prefix: string) => (chunk: Buffer) => {
70+
const lines = chunk.toString().trim().split('\n');
71+
lines.forEach(line => console.log(`[${appDirName}] ${prefix}: ${line}`));
72+
};
73+
7174
const proc = run(scripts.dev, {
7275
cwd: appDirPath,
7376
env: { PORT: port.toString() },
7477
detached: opts.detached,
75-
stdout: opts.detached ? fs.openSync(stdoutFilePath, 'a') : undefined,
76-
stderr: opts.detached ? fs.openSync(stderrFilePath, 'a') : undefined,
77-
log: opts.detached ? undefined : log,
7878
});
7979

80-
const shouldExit = () => !!proc.exitCode && proc.exitCode !== 0;
80+
// Stream stdout/stderr to console
81+
proc.stdout?.on('data', logOutput('stdout'));
82+
proc.stderr?.on('data', logOutput('stderr'));
83+
84+
console.log(`[${appDirName}] Process spawned with pid: ${proc.pid}, detached: ${opts.detached}`);
85+
86+
const shouldExit = () => {
87+
if (proc.exitCode !== null && proc.exitCode !== 0) {
88+
console.log(`[${appDirName}] Process exited with code: ${proc.exitCode}`);
89+
return true;
90+
}
91+
return false;
92+
};
93+
8194
await waitForServer(runtimeServerUrl, { log, maxAttempts: Infinity, shouldExit });
8295
log(`Server started at ${runtimeServerUrl}, pid: ${proc.pid}`);
8396
cleanupFns.push(() => awaitableTreekill(proc.pid, 'SIGKILL'));

integration/presets/express.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { constants } from '../constants';
21
import { applicationConfig } from '../models/applicationConfig';
32
import { templates } from '../templates';
43
import { linkPackage } from './utils';
@@ -11,9 +10,9 @@ const vite = applicationConfig()
1110
.addScript('dev', 'pnpm dev')
1211
.addScript('build', 'pnpm build')
1312
.addScript('serve', 'pnpm start')
14-
.addDependency('@clerk/express', constants.E2E_CLERK_JS_VERSION || linkPackage('express'))
15-
.addDependency('@clerk/clerk-js', constants.E2E_CLERK_JS_VERSION || linkPackage('clerk-js'))
16-
.addDependency('@clerk/ui', constants.E2E_CLERK_UI_VERSION || linkPackage('ui'));
13+
.addDependency('@clerk/express', linkPackage('express', 'integration'))
14+
.addDependency('@clerk/clerk-js', linkPackage('clerk-js', 'integration'))
15+
.addDependency('@clerk/ui', linkPackage('ui', 'integration'));
1716

1817
export const express = {
1918
vite,

0 commit comments

Comments
 (0)