diff --git a/scheduler/package.json b/scheduler/package.json index 5629d4d165..ac7817d365 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -20,7 +20,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "execa": "^1.0.0", "mocha": "^6.0.0", "supertest": "^4.0.0" } diff --git a/scheduler/system-test/test.samples.js b/scheduler/system-test/test.samples.js index 67da83470e..f08c9f1a62 100644 --- a/scheduler/system-test/test.samples.js +++ b/scheduler/system-test/test.samples.js @@ -14,9 +14,8 @@ 'use strict'; -const path = require('path'); const {assert} = require('chai'); -const execa = require('execa'); +const {execSync} = require('child_process'); const supertest = require('supertest'); const app = require('../app.js'); const request = supertest(app); @@ -25,22 +24,22 @@ const PROJECT_ID = process.env.GCLOUD_PROJECT; const LOCATION_ID = process.env.LOCATION_ID || 'us-central1'; const SERVICE_ID = 'my-service'; -const cwd = path.join(__dirname, '../'); -const exec = cmd => execa.shell(cmd, {cwd}); - describe('Cloud Scheduler Sample Tests', () => { let jobName; it('should create and delete a scheduler job', async () => { - const {stdout} = await exec( + const stdout = execSync( `node createJob.js ${PROJECT_ID} ${LOCATION_ID} ${SERVICE_ID}` ); assert.match(stdout, /Created job/); - jobName = stdout.split('/').pop(); + jobName = stdout + .toString() + .split('/') + .pop(); }); it('should delete a scheduler job', async () => { - const {stdout} = await exec( + const stdout = execSync( `node deleteJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` ); assert.match(stdout, /Job deleted/);