Skip to content

Commit

Permalink
build node API before running e2e tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 committed Oct 28, 2024
1 parent 9f6a114 commit 9ced552
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/node-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ jobs:
- name: Build Python API
working-directory: ./api-node
run: yarn python-api:build
- name: Build Node API
working-directory: ./api-node
run: yarn build:ci
- name: Run E2E tests
working-directory: ./api-node
run: yarn test:e2e:ci
14 changes: 14 additions & 0 deletions api-node/scripts/run-e2e-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ nodeApi.stderr.on('data', (data) => {
console.error('[NestJS]', data.toString());
});

nodeApi.on('close', (code) => {
if (code !== 0) {
console.error(`NestJS finished with code ${code}`);
process.exit(code);
}
});

const pythonApi = childProcess.spawn('yarn', ['python-api:start']);

pythonApi.stdout.on('data', (data) => {
Expand All @@ -36,6 +43,13 @@ pythonApi.stderr.on('data', (data) => {
console.error('[Flask]', data.toString());
});

pythonApi.on('close', (code) => {
if (code !== 0) {
console.error(`Flask finished with code ${code}`);
process.exit(code);
}
});

function checkAndRunTests(): void {
console.log('checkAndRunTests', { nodeApiStarted, pythonApiStarted });
if (nodeApiStarted && pythonApiStarted) {
Expand Down

0 comments on commit 9ced552

Please sign in to comment.