@@ -28,24 +28,20 @@ const text = 'how old is the Brooklyn Bridge';
28
28
const adaptationClient = new speech . AdaptationClient ( ) ;
29
29
30
30
const projectId = process . env . GCLOUD_PROJECT ;
31
- const location = 'us-west1 '
32
- const customClassId = uuidv4 ( ) . replace ( / - / g, '' ) . substring ( 0 , 15 ) ;
33
- const phraseSetId = uuidv4 ( ) . replace ( / - / g, '' ) . substring ( 0 , 15 ) ;
31
+ const location = 'global '
32
+ const customClassId = `customClassId ${ uuidv4 ( ) . replace ( / - / g, '' ) . substring ( 0 , 8 ) } ` ;
33
+ const phraseSetId = `phraseSetId ${ uuidv4 ( ) . replace ( / - / g, '' ) . substring ( 0 , 8 ) } ` ;
34
34
const classParent = `projects/${ projectId } /locations/${ location } /customClasses/${ customClassId } ` ;
35
- const phraseParent = `projects/${ projectId } /locations/${ location } /phraseSets/${ customClassId } ` ;
35
+ const phraseParent = `projects/${ projectId } /locations/${ location } /phraseSets/${ phraseSetId } ` ;
36
36
37
37
describe ( 'modelAdaptation' , ( ) => {
38
- // TODO: investigate why this test fails when us-west1 used as location.
39
- // when set to global, it fails with 404.
40
- it . skip ( 'should run modelAdaptation' , async ( ) => {
38
+ it ( 'should run modelAdaptation' , async ( ) => {
41
39
const stdout = execSync ( `node modelAdaptation.js ${ projectId } ${ location } ${ storageUri } ${ customClassId } ${ phraseSetId } ` )
42
40
assert . match ( stdout , / T r a n s c r i p t i o n : / ) ;
43
41
} ) ;
44
42
after ( async ( ) => {
45
43
// Release used resources
46
- // TODO: investigate why this test fails when us-west1 used as location.
47
- // when set to global, it fails with 404.
48
- // await cleanUp(classParent, phraseParent);
44
+ await cleanUp ( classParent , phraseParent ) ;
49
45
} )
50
46
} ) ;
51
47
0 commit comments