From f8c407b346ec32e6fae1ecc7a37c770bfe7193da Mon Sep 17 00:00:00 2001 From: ace-n Date: Mon, 14 Nov 2022 14:20:27 -0800 Subject: [PATCH] Remove tests for non-migrated samples --- scheduler/package.json | 3 +-- scheduler/test/test.samples.js | 29 +---------------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/scheduler/package.json b/scheduler/package.json index f953e0e2644..b089b4cf849 100644 --- a/scheduler/package.json +++ b/scheduler/package.json @@ -20,7 +20,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^8.0.0", - "supertest": "^6.0.0" + "mocha": "^8.0.0" } } diff --git a/scheduler/test/test.samples.js b/scheduler/test/test.samples.js index 521dfd84992..30cd65c5979 100644 --- a/scheduler/test/test.samples.js +++ b/scheduler/test/test.samples.js @@ -18,9 +18,6 @@ const {CloudSchedulerClient} = require('@google-cloud/scheduler'); const {assert} = require('chai'); const {describe, it, before} = require('mocha'); const cp = require('child_process'); -const supertest = require('supertest'); -const app = require('../app.js'); -const request = supertest(app); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const LOCATION_ID = process.env.LOCATION_ID || 'us-central1'; @@ -35,36 +32,12 @@ describe('Cloud Scheduler Sample Tests', () => { PROJECT_ID = await client.getProjectId(); }); - it('should create and delete a scheduler job', async () => { + it('should create a scheduler job', async () => { const stdout = execSync( `node createJob.js ${PROJECT_ID} ${LOCATION_ID} ${SERVICE_ID}` ); assert.match(stdout, /Created job/); jobName = stdout.split('/').pop(); }); - - it('should update a scheduler job', async () => { - const stdout = execSync( - `node updateJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` - ); - assert.match(stdout, /Updated job/); - }); - - it('should delete a scheduler job', async () => { - const stdout = execSync( - `node deleteJob.js ${PROJECT_ID} ${LOCATION_ID} ${jobName}` - ); - assert.match(stdout, /Job deleted/); - }); }); -describe('Server should respond to /log_payload', () => { - it('should log the payload', done => { - const body = Buffer.from('test'); - request - .post('/log_payload') - .type('raw') - .send(body) - .expect(200, /Printed job/, done); - }); -});