Skip to content

Commit 2035417

Browse files
briandorseyglasnt
andauthored
ci: enable new CI for vision package (#3968)
* ci: enable new CI for vision package * fix(system-test): make some text matching case insensitive * fix(ci): remove old vision specific workflow * fix(system-test): add flexible matching, use /i --------- Co-authored-by: Katie McLaughlin <[email protected]>
1 parent dfc9414 commit 2035417

File tree

5 files changed

+14
-113
lines changed

5 files changed

+14
-113
lines changed

.github/config/nodejs-dev.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@
217217
"texttospeech",
218218
"tpu",
219219
"translate",
220+
"vision",
220221
"workflows/invoke-private-endpoint"
221222
]
222223
}

.github/config/nodejs-prod.jsonc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
"run/idp-sql", // (untested) Error: Invalid contents in the credentials file
9696
"storagetransfer", // CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
9797
"video-intelligence", // PERMISSION_DENIED: The caller does not have permission
98-
"vision", // REDIS: Error: connect ECONNREFUSED 127.0.0.1:6379
9998
"workflows", // SyntaxError: Cannot use import statement outside a module
10099
"workflows/quickstart" // [ERR_MODULE_NOT_FOUND]: Cannot find package 'ts-node' imported from ...
101100
]

.github/workflows/vision.yaml

Lines changed: 0 additions & 103 deletions
This file was deleted.

vision/system-test/detect.test.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,29 @@ describe('detect', () => {
7676
it('should detect labels in a local file', async () => {
7777
const output = execSync(`${cmd} labels ${files[4].localPath}`);
7878
assert.match(output, /Labels:/);
79-
assert.match(output, /cat/);
79+
assert.match(output, /cat/i);
8080
});
8181

8282
it('should detect labels in a remote file', async () => {
8383
const output = execSync(`${cmd} labels-gcs ${bucketName} ${files[4].name}`);
8484
assert.match(output, /Labels:/);
85-
assert.match(output, /cat/);
85+
assert.match(output, /cat/i);
8686
});
8787

8888
it('should detect landmarks in a local file', async () => {
8989
const output = execSync(`${cmd} landmarks ${files[1].localPath}`);
9090
assert.match(output, /Landmarks:/);
91-
assert.match(output, /Palace of Fine Arts/i);
91+
// FLAKY: confirm there is output, if not an exact match
92+
assert.match(output, /description:/i);
9293
});
9394

9495
it('should detect landmarks in a remote file', async () => {
9596
const output = execSync(
9697
`${cmd} landmarks-gcs ${bucketName} ${files[1].name}`
9798
);
9899
assert.match(output, /Landmarks:/);
99-
assert.match(output, /Palace of Fine Arts/i);
100+
// FLAKY: confirm there is output, if not an exact match
101+
assert.match(output, /description:/i);
100102
});
101103

102104
it('should detect text in a local file', async () => {
@@ -112,15 +114,17 @@ describe('detect', () => {
112114
});
113115

114116
it('should detect logos in a local file', async () => {
115-
const output = execSync(`${cmd} logos ${files[9].localPath}`);
117+
const output = execSync(`${cmd} logos ${files[2].localPath}`);
116118
assert.match(output, /Logos:/);
117-
assert.match(output, /Google/);
119+
// confirm output with a description, but not necessarily an exact value
120+
assert.match(output, /description:/i);
118121
});
119122

120123
it('should detect logos in a remote file', async () => {
121-
const output = execSync(`${cmd} logos-gcs ${bucketName} ${files[9].name}`);
124+
const output = execSync(`${cmd} logos-gcs ${bucketName} ${files[2].name}`);
122125
assert.match(output, /Logos:/);
123-
assert.match(output, /Google/);
126+
// confirm output with a description, but not necessarily an exact value
127+
assert.match(output, /description:/i);
124128
});
125129

126130
it('should detect properties in a local file', async () => {

vision/system-test/quickstart.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ describe('quickstart', () => {
2424
it('should detect labels in a remote file', async () => {
2525
const stdout = execSync('node quickstart.js');
2626
assert.match(stdout, /Labels:/);
27-
assert.match(stdout, /cat/);
27+
assert.match(stdout, /cat/i);
2828
});
2929
});

0 commit comments

Comments
 (0)