Skip to content

Commit

Permalink
Remove tests for non-migrated samples
Browse files Browse the repository at this point in the history
  • Loading branch information
ace-n committed Nov 14, 2022
1 parent 638f5bc commit f8c407b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
3 changes: 1 addition & 2 deletions scheduler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
},
"devDependencies": {
"chai": "^4.2.0",
"mocha": "^8.0.0",
"supertest": "^6.0.0"
"mocha": "^8.0.0"
}
}
29 changes: 1 addition & 28 deletions scheduler/test/test.samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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);
});
});

0 comments on commit f8c407b

Please sign in to comment.