Skip to content

Commit ed365d4

Browse files
committed
fix(system-test): unskip, add flexible matching, use /i
1 parent 58571e5 commit ed365d4

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

vision/system-test/detect.test.js

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,33 +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.toLowerCase(), /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.toLowerCase(), /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-
// something changed in the output and this text is no longer in the output
92-
// however, the API call itself still works, commenting this out so
93-
// it's not breaking the tests.
94-
// 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);
9593
});
9694

9795
it('should detect landmarks in a remote file', async () => {
9896
const output = execSync(
9997
`${cmd} landmarks-gcs ${bucketName} ${files[1].name}`
10098
);
10199
assert.match(output, /Landmarks:/);
102-
// something changed in the output and this text is no longer in the output
103-
// however, the API call itself still works, commenting this out so
104-
// it's not breaking the tests.
105-
// 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);
106102
});
107103

108104
it('should detect text in a local file', async () => {
@@ -118,21 +114,17 @@ describe('detect', () => {
118114
});
119115

120116
it('should detect logos in a local file', async () => {
121-
const output = execSync(`${cmd} logos ${files[9].localPath}`);
117+
const output = execSync(`${cmd} logos ${files[2].localPath}`);
122118
assert.match(output, /Logos:/);
123-
// something changed in the output and this text is no longer in the output
124-
// however, the API call itself still works, commenting this out so
125-
// it's not breaking the tests.
126-
// assert.match(output, /Google/);
119+
// confirm output with a description, but not necessarily an exact value
120+
assert.match(output, /description:/i);
127121
});
128122

129123
it('should detect logos in a remote file', async () => {
130-
const output = execSync(`${cmd} logos-gcs ${bucketName} ${files[9].name}`);
124+
const output = execSync(`${cmd} logos-gcs ${bucketName} ${files[2].name}`);
131125
assert.match(output, /Logos:/);
132-
// something changed in the output and this text is no longer in the output
133-
// however, the API call itself still works, commenting this out so
134-
// it's not breaking the tests.
135-
// assert.match(output, /Google/);
126+
// confirm output with a description, but not necessarily an exact value
127+
assert.match(output, /description:/i);
136128
});
137129

138130
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.toLowerCase(), /cat/);
27+
assert.match(stdout.toLowerCase(), /cat/i);
2828
});
2929
});

0 commit comments

Comments
 (0)