From ffe6e2621bf7fd4659dbb13aa4d1647cc2c42cb7 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Fri, 4 Jun 2021 11:32:04 -0700 Subject: [PATCH] test: changes AutoML v1beta1 model for v1 model (#676) * test: changes AutoML v1beta1 model for v1 model * test: changed asserts --- ...ate_batch_translate_text_with_glossary_and_model.test.js | 6 +++--- .../v3/translate_batch_translate_text_with_model.test.js | 6 +++--- ...translate_translate_text_with_glossary_and_model.test.js | 4 ++-- .../test/v3/translate_translate_text_with_model.test.js | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/translate/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js b/translate/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js index 72b7e51f288..4a1196967e0 100644 --- a/translate/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js +++ b/translate/test/v3/translate_batch_translate_text_with_glossary_and_model.test.js @@ -43,7 +43,7 @@ async function clearBucket(projectId, storage, bucketUuid) { describe(REGION_TAG, () => { const translationClient = new TranslationServiceClient(); const location = 'us-central1'; - const modelId = 'TRL1218052175389786112'; + const modelId = 'TRL8567014172607381504'; const bucketUuid = uuid.v4(); const bucketName = `translation-${bucketUuid}/BATCH_TRANSLATE_GLOSS_MODEL_OUTPUT/`; const storage = new Storage(); @@ -76,8 +76,8 @@ describe(REGION_TAG, () => { const output = execSync( `node v3/${REGION_TAG}.js ${projectId} ${location} ${inputUri} ${outputUri} ${GLOSSARY_ID} ${modelId}` ); - assert.match(output, /Total Characters: 25/); - assert.match(output, /Translated Characters: 25/); + assert.match(output, /Total Characters/); + assert.match(output, /Translated Characters/); // batch translate fluctuates between 2 to 4 minutes. this.timeout(300000); diff --git a/translate/test/v3/translate_batch_translate_text_with_model.test.js b/translate/test/v3/translate_batch_translate_text_with_model.test.js index 165213c2378..817efe36d87 100644 --- a/translate/test/v3/translate_batch_translate_text_with_model.test.js +++ b/translate/test/v3/translate_batch_translate_text_with_model.test.js @@ -42,7 +42,7 @@ async function clearBucket(projectId, storage, bucketUuid) { describe(REGION_TAG, () => { const translationClient = new TranslationServiceClient(); const location = 'us-central1'; - const modelId = 'TRL1218052175389786112'; + const modelId = 'TRL8567014172607381504'; const bucketUuid = uuid.v4(); const bucketName = `translation-${bucketUuid}/BATCH_TRANSLATE_WITH_MODEL_OUTPUT/`; const storage = new Storage(); @@ -75,8 +75,8 @@ describe(REGION_TAG, () => { const output = execSync( `node v3/${REGION_TAG}.js ${projectId} ${location} ${inputUri} ${outputUri} ${modelId}` ); - assert.match(output, /Total Characters: 15/); - assert.match(output, /Translated Characters: 15/); + assert.match(output, /Total Characters/); + assert.match(output, /Translated Characters/); }); // Delete the folder from GCS for cleanup diff --git a/translate/test/v3/translate_translate_text_with_glossary_and_model.test.js b/translate/test/v3/translate_translate_text_with_glossary_and_model.test.js index 0325432da99..429348cdc3f 100644 --- a/translate/test/v3/translate_translate_text_with_glossary_and_model.test.js +++ b/translate/test/v3/translate_translate_text_with_glossary_and_model.test.js @@ -27,7 +27,7 @@ const REGION_TAG = 'translate_translate_text_with_glossary_and_model'; describe(REGION_TAG, () => { const translationClient = new TranslationServiceClient(); const location = 'us-central1'; - const modelId = 'TRL1218052175389786112'; + const modelId = 'TRL8567014172607381504'; it('should translate text with a glossary and Automl model in project', async () => { const projectId = await translationClient.getProjectId(); @@ -35,6 +35,6 @@ describe(REGION_TAG, () => { const output = execSync( `node v3/${REGION_TAG}.js ${projectId} ${location} ${GLOSSARY_ID} ${modelId} ${input}` ); - assert.match(output, /道順/); + assert.match(output, /Translation/); }); }); diff --git a/translate/test/v3/translate_translate_text_with_model.test.js b/translate/test/v3/translate_translate_text_with_model.test.js index bfc7385525b..213a329ae28 100644 --- a/translate/test/v3/translate_translate_text_with_model.test.js +++ b/translate/test/v3/translate_translate_text_with_model.test.js @@ -25,7 +25,7 @@ const REGION_TAG = 'translate_translate_text_with_model'; describe(REGION_TAG, () => { const translationClient = new TranslationServiceClient(); const location = 'us-central1'; - const modelId = 'TRL1218052175389786112'; + const modelId = 'TRL8567014172607381504'; const input = 'Tell me how this ends'; it('should translate text with an automl model in project', async () => { @@ -33,6 +33,6 @@ describe(REGION_TAG, () => { const output = await execSync( `node v3/${REGION_TAG}.js ${projectId} ${location} ${modelId} ${input}` ); - assert.match(output, /Translated Content: 教えて/); + assert.match(output, /Translated Content:/); }); });