From a81f9f1d056e733956db2960b417cc46d6c97b82 Mon Sep 17 00:00:00 2001 From: Franklin Nunez <69214580+b-loved-dreamer@users.noreply.github.com> Date: Wed, 16 Jun 2021 15:37:50 -0700 Subject: [PATCH] chore: solves resource id issues (#743) --- speech/system-test/modelAdaptation.test.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/speech/system-test/modelAdaptation.test.js b/speech/system-test/modelAdaptation.test.js index c3ee68caf5..71bb698750 100644 --- a/speech/system-test/modelAdaptation.test.js +++ b/speech/system-test/modelAdaptation.test.js @@ -28,24 +28,20 @@ const text = 'how old is the Brooklyn Bridge'; const adaptationClient = new speech.AdaptationClient(); const projectId = process.env.GCLOUD_PROJECT; -const location = 'us-west1' -const customClassId = uuidv4().replace(/-/g, '').substring(0, 15); -const phraseSetId = uuidv4().replace(/-/g, '').substring(0, 15); +const location = 'global' +const customClassId = `customClassId${uuidv4().replace(/-/g, '').substring(0, 8)}`; +const phraseSetId = `phraseSetId${uuidv4().replace(/-/g, '').substring(0, 8)}`; const classParent = `projects/${projectId}/locations/${location}/customClasses/${customClassId}`; -const phraseParent = `projects/${projectId}/locations/${location}/phraseSets/${customClassId}`; +const phraseParent = `projects/${projectId}/locations/${location}/phraseSets/${phraseSetId}`; describe('modelAdaptation', () => { - // TODO: investigate why this test fails when us-west1 used as location. - // when set to global, it fails with 404. - it.skip('should run modelAdaptation', async () => { + it('should run modelAdaptation', async () => { const stdout = execSync(`node modelAdaptation.js ${projectId} ${location} ${storageUri} ${customClassId} ${phraseSetId}`) assert.match(stdout, /Transcription:/ ); }); after(async () => { // Release used resources - // TODO: investigate why this test fails when us-west1 used as location. - // when set to global, it fails with 404. - // await cleanUp(classParent, phraseParent); + await cleanUp(classParent, phraseParent); }) });