Skip to content

Commit 7256cc7

Browse files
committed
update tested tests, try execSync
1 parent f58eb32 commit 7256cc7

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

run/system-package/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"private": true,
77
"scripts": {
88
"start": "node index.js",
9-
"test": "c8 mocha -p -j 2 test/app.test.js --check-leaks",
10-
"system-test": "echo 'SKIPPING E2E TEST: SEE b/358734748'",
11-
"FIXME-system-test": "c8 mocha -p -j 2 test/system.test.js --timeout=360000 --exit"
9+
"test": "npm -- run all-test",
10+
"all-test": "npm run unit-test && npm run system-test",
11+
"unit-test": "c8 mocha -p -j 2 test/app.test.js --check-leaks",
12+
"system-test": "c8 mocha -p -j 2 test/system.test.js --timeout=360000 --exit"
1213
},
1314
"engines": {
1415
"node": ">=18.0.0"

run/system-package/test/app.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
'use strict';
1616

17-
const {exec} = require('child_process');
17+
const {execSync} = require('child_process');
1818
const path = require('path');
1919
const supertest = require('supertest');
2020

2121
// Manually install system package in testing environment
22-
exec("apt update && apt install graphviz -y")
22+
execSync('apt update && apt install graphviz -y')
2323

2424
describe('Unit Tests', () => {
2525
const app = require(path.join(__dirname, '..', 'app'));

run/system-package/test/system.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ const request = (method, route, base_url, id_token) => {
2828
});
2929
};
3030

31+
// Manually install system package in testing environment
32+
execSync('apt update && apt install graphviz -y && which dot')
33+
3134
describe('End-to-End Tests', () => {
3235
const {GOOGLE_CLOUD_PROJECT} = process.env;
3336
if (!GOOGLE_CLOUD_PROJECT) {

0 commit comments

Comments
 (0)