Skip to content

Commit

Permalink
test: run system and sample tests with cloud build (#383)
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
  • Loading branch information
JustinBeckwith and bcoe authored Jul 1, 2021
1 parent 3578333 commit 611dcdc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scheduler/test/test.samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,26 @@

'use strict';

const {CloudSchedulerClient} = require('@google-cloud/scheduler');
const {assert} = require('chai');
const {describe, it} = require('mocha');
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 PROJECT_ID = process.env.GCLOUD_PROJECT;
const LOCATION_ID = process.env.LOCATION_ID || 'us-central1';
const SERVICE_ID = 'my-service';

describe('Cloud Scheduler Sample Tests', () => {
let jobName;
let PROJECT_ID;

before(async () => {
const client = new CloudSchedulerClient();
PROJECT_ID = await client.getProjectId();
});

it('should create and delete a scheduler job', async () => {
const stdout = execSync(
Expand Down

0 comments on commit 611dcdc

Please sign in to comment.