Skip to content

Commit 8614d6b

Browse files
lucaswadedavispattishin
authored andcommitted
Remove cleaning script from tests (#58)
* Remove cleaning script from tests * Remove unnecessary imports
1 parent 8d365cc commit 8614d6b

13 files changed

+12
-310
lines changed

ai-platform/snippets/test/clean.js

Lines changed: 0 additions & 218 deletions
This file was deleted.

ai-platform/snippets/test/create-batch-prediction-job-video-classification.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818

1919
const path = require('path');
2020
const {assert} = require('chai');
21-
const {after, before, describe, it} = require('mocha');
21+
const {after, describe, it} = require('mocha');
2222
const uuid = require('uuid').v4;
2323
const cp = require('child_process');
2424
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2525
const cwd = path.join(__dirname, '..');
26-
const clean = require('./clean');
2726

2827
const aiplatform = require('@google-cloud/aiplatform');
2928
const clientOptions = {
@@ -43,10 +42,6 @@ const project = process.env.CAIP_PROJECT_ID;
4342
let batchPredictionJobId;
4443

4544
describe('AI platform create batch prediction job video classification', () => {
46-
before('should clean up any orphaned resources', async () => {
47-
await clean.cleanBatchPredictionJobs(project);
48-
});
49-
5045
it('should create a video classification batch prediction job', async () => {
5146
const stdout = execSync(
5247
`node ./create-batch-prediction-job-video-classification.js \

ai-platform/snippets/test/create-batch-prediction-job-video-object-tracking.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818

1919
const path = require('path');
2020
const {assert} = require('chai');
21-
const {after, before, describe, it} = require('mocha');
21+
const {after, describe, it} = require('mocha');
2222
const uuid = require('uuid').v4;
2323
const cp = require('child_process');
2424
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2525
const cwd = path.join(__dirname, '..');
26-
const clean = require('./clean');
2726

2827
const aiplatform = require('@google-cloud/aiplatform');
2928
const clientOptions = {
@@ -43,10 +42,6 @@ const project = process.env.CAIP_PROJECT_ID;
4342
let batchPredictionJobId;
4443

4544
describe('AI platform create batch prediction job video object tracking', () => {
46-
before('should clean up any orphaned resources', async () => {
47-
await clean.cleanBatchPredictionJobs(project);
48-
});
49-
5045
it('should create a video object tracking batch prediction job', async () => {
5146
const stdout = execSync(
5247
`node ./create-batch-prediction-job-video-object-tracking.js \

ai-platform/snippets/test/create-training-pipeline-image-classification.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
'use strict';
1818

1919
const {assert} = require('chai');
20-
const {after, before, describe, it} = require('mocha');
21-
const clean = require('./clean');
20+
const {after, describe, it} = require('mocha');
2221

2322
const uuid = require('uuid').v4;
2423
const cp = require('child_process');
@@ -42,10 +41,6 @@ const project = process.env.CAIP_PROJECT_ID;
4241
let trainingPipelineId;
4342

4443
describe('AI platform create training pipeline image classification', () => {
45-
before('should delete any old and/or orphaned resources', async () => {
46-
await clean.cleanTrainingPipelines(project);
47-
});
48-
4944
it('should create a new image classification training pipeline', async () => {
5045
const stdout = execSync(
5146
`node ./create-training-pipeline-image-classification.js ${datasetId} ${modelDisplayName} ${trainingPipelineDisplayName} ${project} ${location}`

ai-platform/snippets/test/create-training-pipeline-image-object-detection.test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
const path = require('path');
2020
const {assert} = require('chai');
21-
const clean = require('./clean');
22-
const {after, before, describe, it} = require('mocha');
21+
const {after, describe, it} = require('mocha');
2322

2423
const uuid = require('uuid').v4;
2524
const cp = require('child_process');
@@ -44,13 +43,6 @@ const project = process.env.CAIP_PROJECT_ID;
4443
let trainingPipelineId;
4544

4645
describe('AI platform create training pipeline image object detection', () => {
47-
before(
48-
'should get the current project ID and clean up orphaned resources',
49-
async () => {
50-
await clean.cleanTrainingPipelines(project);
51-
}
52-
);
53-
5446
it('should create a new image object detection training pipeline', async () => {
5547
const stdout = execSync(
5648
`node ./create-training-pipeline-image-object-detection.js \

ai-platform/snippets/test/create-training-pipeline-tabular-classification.test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
const path = require('path');
2020
const {assert} = require('chai');
21-
const {after, before, describe, it} = require('mocha');
22-
const clean = require('./clean');
21+
const {after, describe, it} = require('mocha');
2322

2423
const uuid = require('uuid').v4;
2524
const cp = require('child_process');
@@ -45,13 +44,6 @@ const project = process.env.CAIP_PROJECT_ID;
4544
let trainingPipelineId;
4645

4746
describe('AI platform create training pipeline tables classification', () => {
48-
before(
49-
'should get the project ID and clean up orphaned resources',
50-
async () => {
51-
await clean.cleanTrainingPipelines(project);
52-
}
53-
);
54-
5547
it('should create a new tables classification training pipeline', async () => {
5648
const stdout = execSync(
5749
`node ./create-training-pipeline-tabular-classification.js \

ai-platform/snippets/test/create-training-pipeline-tabular-regression.test.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
const path = require('path');
2020
const {assert} = require('chai');
21-
const {after, before, describe, it} = require('mocha');
22-
const clean = require('./clean');
21+
const {after, describe, it} = require('mocha');
2322

2423
const uuid = require('uuid').v4;
2524
const cp = require('child_process');
@@ -45,12 +44,6 @@ const project = process.env.CAIP_PROJECT_ID;
4544
let trainingPipelineId;
4645

4746
describe('AI platform create training pipeline tabular regression', () => {
48-
before(
49-
'should get the project ID and clean up orphaned resources',
50-
async () => {
51-
await clean.cleanTrainingPipelines(project);
52-
}
53-
);
5447
it('should create a new tabular regression training pipeline', async () => {
5548
const stdout = execSync(
5649
`node ./create-training-pipeline-tabular-regression.js \

ai-platform/snippets/test/create-training-pipeline-text-classification.test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
const path = require('path');
2020
const {assert} = require('chai');
21-
const {after, before, describe, it} = require('mocha');
22-
const clean = require('./clean');
21+
const {after, describe, it} = require('mocha');
2322

2423
const uuid = require('uuid').v4;
2524
const cp = require('child_process');
@@ -44,9 +43,6 @@ const project = process.env.CAIP_PROJECT_ID;
4443
let trainingPipelineId;
4544

4645
describe('AI platform create training pipeline text classification', () => {
47-
before('should get the project ID and clean orphaned resources', async () => {
48-
await clean.cleanTrainingPipelines(project);
49-
});
5046
it('should create a new text classification training pipeline', async () => {
5147
const stdout = execSync(
5248
`node ./create-training-pipeline-text-classification.js \

0 commit comments

Comments
 (0)