Skip to content

Commit

Permalink
samples: disable automl create model tests becuase they have no teard…
Browse files Browse the repository at this point in the history
…own (#447)

* samples: disable automl create model tests becuase they have no teardown

* fixed lint

* removed teardowns

* removed teardown from translte
  • Loading branch information
munkhuushmgl authored and ahrarmonsur committed Nov 17, 2022
1 parent e6d5a55 commit f9fcce3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 89 deletions.
14 changes: 2 additions & 12 deletions automl/test/automlTranslation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,12 @@ describe('Translate AutoML sample tests', () => {
assert.match(output, /Dataset deleted/);
});

it('should create model and cancel the training operation', async () => {
it.skip('should create model and cancel the training operation', async () => {
// create a model with pre-existing dataset
let output = execSync(
const output = execSync(
`${cmdModel} ${projectId} us-central1 ${datasetId} translate_test_model`
);
assert.match(output, /Training started../);
const operationFullId = output
.split('Training operation name:')[1]
.split('\n')[0]
.trim();

assert.include(output, operationFullId);

// cancel the training LRO.
output = execSync(`node beta/cancel_operation.js ${operationFullId}`);
assert.match(output, /Cancelled/);
});

it('should run Prediction from translation model', async () => {
Expand Down
13 changes: 2 additions & 11 deletions automl/test/language_sentiment_analysis_create_model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

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

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

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

it('should create a model', async () => {
it.skip('should create a model', async () => {
const projectId = await client.getProjectId();
const create_output = execSync(
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} sentiment_test_create_model`
);

assert.match(create_output, /Training started/);

operationId = create_output
.split('Training operation name: ')[1]
.split('\n')[0];
});

after('cancel model training', async () => {
await client.operationsClient.cancelOperation({name: operationId});
});
});
13 changes: 2 additions & 11 deletions automl/test/language_text_classification_create_model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

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

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

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

it('should create a model', async () => {
it.skip('should create a model', async () => {
const projectId = await client.getProjectId();
const create_output = execSync(
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} classification_test_create_model`
);

assert.match(create_output, /Training started/);

operationId = create_output
.split('Training operation name: ')[1]
.split('\n')[0];
});

after('cancel model training', async () => {
await client.operationsClient.cancelOperation({name: operationId});
});
});
13 changes: 2 additions & 11 deletions automl/test/translate_create_model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

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

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

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

it('should create a model', async function () {
it.skip('should create a model', async function () {
this.retries(5);
await delay(this.test);

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

assert.match(create_output, /Training started/);

operationId = create_output
.split('Training operation name: ')[1]
.split('\n')[0];
});

afterEach('cancel model training', async () => {
await client.operationsClient.cancelOperation({name: operationId});
});
});
13 changes: 2 additions & 11 deletions automl/test/video-classification-create-model.beta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

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

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

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

it('should create a model', async () => {
it.skip('should create a model', async () => {
const projectId = await client.getProjectId();
const create_output = execSync(
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} video_test_create_model`
);

assert.match(create_output, /Training started/);

operationId = create_output
.split('Training operation name: ')[1]
.split('\n')[0];
});

after('cancel model training', async () => {
await client.operationsClient.cancelOperation({name: operationId});
});
});
13 changes: 2 additions & 11 deletions automl/test/video-object-tracking-create-model.beta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

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

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

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

it('should create a model', async () => {
it.skip('should create a model', async () => {
const projectId = await client.getProjectId();
const create_output = execSync(
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} video_test_create_model`
);

assert.match(create_output, /Training started/);

operationId = create_output
.split('Training operation name: ')[1]
.split('\n')[0];
});

after('cancel model training', async () => {
await client.operationsClient.cancelOperation({name: operationId});
});
});
13 changes: 2 additions & 11 deletions automl/test/vision_classification_create_model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

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

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

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

it('should create a model', async () => {
it.skip('should create a model', async () => {
const projectId = await client.getProjectId();
const create_output = execSync(
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} classification_test_create_model`
);

assert.match(create_output, /Training started/);

operationId = create_output
.split('Training operation name: ')[1]
.split('\n')[0];
});

after('cancel model training', async () => {
await client.operationsClient.cancelOperation({name: operationId});
});
});
13 changes: 2 additions & 11 deletions automl/test/vision_object_detection_create_model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

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

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

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

it('should create a model', async () => {
it.skip('should create a model', async () => {
const projectId = await client.getProjectId();
const create_output = execSync(
`node ${CREATE_MODEL_REGION_TAG}.js ${projectId} ${LOCATION} ${DATASET_ID} object_test_create_model`
);

assert.match(create_output, /Training started/);

operationId = create_output
.split('Training operation name: ')[1]
.split('\n')[0];
});

after('cancel model training', async () => {
await client.operationsClient.cancelOperation({name: operationId});
});
});

0 comments on commit f9fcce3

Please sign in to comment.