Skip to content

Commit 5b014df

Browse files
munkhuushmglAce Nassri
authored and
Ace Nassri
committed
samples: disable automl create model tests becuase they have no teardown (#447)
* samples: disable automl create model tests becuase they have no teardown * fixed lint * removed teardowns * removed teardown from translte
1 parent 3c97384 commit 5b014df

8 files changed

+16
-89
lines changed

automl/test/automlTranslation.test.js

+2-12
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,12 @@ describe('Translate AutoML sample tests', () => {
5656
assert.match(output, /Dataset deleted/);
5757
});
5858

59-
it('should create model and cancel the training operation', async () => {
59+
it.skip('should create model and cancel the training operation', async () => {
6060
// create a model with pre-existing dataset
61-
let output = execSync(
61+
const output = execSync(
6262
`${cmdModel} ${projectId} us-central1 ${datasetId} translate_test_model`
6363
);
6464
assert.match(output, /Training started../);
65-
const operationFullId = output
66-
.split('Training operation name:')[1]
67-
.split('\n')[0]
68-
.trim();
69-
70-
assert.include(output, operationFullId);
71-
72-
// cancel the training LRO.
73-
output = execSync(`node beta/cancel_operation.js ${operationFullId}`);
74-
assert.match(output, /Cancelled/);
7565
});
7666

7767
it('should run Prediction from translation model', async () => {

automl/test/language_sentiment_analysis_create_model.test.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {describe, it, after} = require('mocha');
18+
const {describe, it} = require('mocha');
1919
const {AutoMlClient} = require('@google-cloud/automl').v1;
2020

2121
const cp = require('child_process');
@@ -28,22 +28,13 @@ const DATASET_ID = 'TST8765214337653538816';
2828

2929
describe('Automl Natural Language Sentiment Analysis Create Model Test', () => {
3030
const client = new AutoMlClient();
31-
let operationId;
3231

33-
it('should create a model', async () => {
32+
it.skip('should create a model', async () => {
3433
const projectId = await client.getProjectId();
3534
const create_output = execSync(
3635
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} sentiment_test_create_model`
3736
);
3837

3938
assert.match(create_output, /Training started/);
40-
41-
operationId = create_output
42-
.split('Training operation name: ')[1]
43-
.split('\n')[0];
44-
});
45-
46-
after('cancel model training', async () => {
47-
await client.operationsClient.cancelOperation({name: operationId});
4839
});
4940
});

automl/test/language_text_classification_create_model.test.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {after, describe, it} = require('mocha');
18+
const {describe, it} = require('mocha');
1919
const {AutoMlClient} = require('@google-cloud/automl').v1;
2020

2121
const cp = require('child_process');
@@ -28,22 +28,13 @@ const DATASET_ID = 'TCN4742936920458264576';
2828

2929
describe('Automl Natural Language Text Classification Create Model Test', () => {
3030
const client = new AutoMlClient();
31-
let operationId;
3231

33-
it('should create a model', async () => {
32+
it.skip('should create a model', async () => {
3433
const projectId = await client.getProjectId();
3534
const create_output = execSync(
3635
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} classification_test_create_model`
3736
);
3837

3938
assert.match(create_output, /Training started/);
40-
41-
operationId = create_output
42-
.split('Training operation name: ')[1]
43-
.split('\n')[0];
44-
});
45-
46-
after('cancel model training', async () => {
47-
await client.operationsClient.cancelOperation({name: operationId});
4839
});
4940
});

automl/test/translate_create_model.test.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {describe, it, afterEach} = require('mocha');
18+
const {describe, it} = require('mocha');
1919
const {AutoMlClient} = require('@google-cloud/automl').v1;
2020

2121
const cp = require('child_process');
@@ -30,9 +30,8 @@ const {delay} = require('./util');
3030

3131
describe('Automl Translate Create Model Tests', () => {
3232
const client = new AutoMlClient();
33-
let operationId;
3433

35-
it('should create a model', async function () {
34+
it.skip('should create a model', async function () {
3635
this.retries(5);
3736
await delay(this.test);
3837

@@ -42,13 +41,5 @@ describe('Automl Translate Create Model Tests', () => {
4241
);
4342

4443
assert.match(create_output, /Training started/);
45-
46-
operationId = create_output
47-
.split('Training operation name: ')[1]
48-
.split('\n')[0];
49-
});
50-
51-
afterEach('cancel model training', async () => {
52-
await client.operationsClient.cancelOperation({name: operationId});
5344
});
5445
});

automl/test/video-classification-create-model.beta.test.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {after, describe, it} = require('mocha');
18+
const {describe, it} = require('mocha');
1919
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;
2020

2121
const cp = require('child_process');
@@ -28,22 +28,13 @@ const DATASET_ID = 'VCN6097385712296919040';
2828

2929
describe('Automl Video Classification Create Model Test', () => {
3030
const client = new AutoMlClient();
31-
let operationId;
3231

33-
it('should create a model', async () => {
32+
it.skip('should create a model', async () => {
3433
const projectId = await client.getProjectId();
3534
const create_output = execSync(
3635
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} video_test_create_model`
3736
);
3837

3938
assert.match(create_output, /Training started/);
40-
41-
operationId = create_output
42-
.split('Training operation name: ')[1]
43-
.split('\n')[0];
44-
});
45-
46-
after('cancel model training', async () => {
47-
await client.operationsClient.cancelOperation({name: operationId});
4839
});
4940
});

automl/test/video-object-tracking-create-model.beta.test.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {after, describe, it} = require('mocha');
18+
const {describe, it} = require('mocha');
1919
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;
2020

2121
const cp = require('child_process');
@@ -28,22 +28,13 @@ const DATASET_ID = 'VOT9082518000266903552';
2828

2929
describe('Automl Video Object Tracking Create Model Test', () => {
3030
const client = new AutoMlClient();
31-
let operationId;
3231

33-
it('should create a model', async () => {
32+
it.skip('should create a model', async () => {
3433
const projectId = await client.getProjectId();
3534
const create_output = execSync(
3635
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} video_test_create_model`
3736
);
3837

3938
assert.match(create_output, /Training started/);
40-
41-
operationId = create_output
42-
.split('Training operation name: ')[1]
43-
.split('\n')[0];
44-
});
45-
46-
after('cancel model training', async () => {
47-
await client.operationsClient.cancelOperation({name: operationId});
4839
});
4940
});

automl/test/vision_classification_create_model.test.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {after, describe, it} = require('mocha');
18+
const {describe, it} = require('mocha');
1919
const {AutoMlClient} = require('@google-cloud/automl').v1;
2020

2121
const cp = require('child_process');
@@ -28,22 +28,13 @@ const DATASET_ID = 'ICN6257835245115015168';
2828

2929
describe('Automl Vision Classification Create Model Tests', () => {
3030
const client = new AutoMlClient();
31-
let operationId;
3231

33-
it('should create a model', async () => {
32+
it.skip('should create a model', async () => {
3433
const projectId = await client.getProjectId();
3534
const create_output = execSync(
3635
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} classification_test_create_model`
3736
);
3837

3938
assert.match(create_output, /Training started/);
40-
41-
operationId = create_output
42-
.split('Training operation name: ')[1]
43-
.split('\n')[0];
44-
});
45-
46-
after('cancel model training', async () => {
47-
await client.operationsClient.cancelOperation({name: operationId});
4839
});
4940
});

automl/test/vision_object_detection_create_model.test.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {after, describe, it} = require('mocha');
18+
const {describe, it} = require('mocha');
1919
const {AutoMlClient} = require('@google-cloud/automl').v1;
2020

2121
const cp = require('child_process');
@@ -28,22 +28,13 @@ const DATASET_ID = 'IOD4700715673951666176';
2828

2929
describe('Automl Vision Object Detection Create Model Test', () => {
3030
const client = new AutoMlClient();
31-
let operationId;
3231

33-
it('should create a model', async () => {
32+
it.skip('should create a model', async () => {
3433
const projectId = await client.getProjectId();
3534
const create_output = execSync(
3635
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} object_test_create_model`
3736
);
3837

3938
assert.match(create_output, /Training started/);
40-
41-
operationId = create_output
42-
.split('Training operation name: ')[1]
43-
.split('\n')[0];
44-
});
45-
46-
after('cancel model training', async () => {
47-
await client.operationsClient.cancelOperation({name: operationId});
4839
});
4940
});

0 commit comments

Comments
 (0)