Skip to content

Commit bd5acb9

Browse files
jmdobryAce Nassri
authored and
Ace Nassri
committed
Cleanup App Engine samples and re-work tests. (#354)
1 parent 459044f commit bd5acb9

File tree

4 files changed

+3025
-97
lines changed

4 files changed

+3025
-97
lines changed

video-intelligence/analyze.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function analyzeShots (gcsUri) {
132132
// [END analyze_shots]
133133
}
134134

135-
const cli = require(`yargs`)
135+
require(`yargs`) // eslint-disable-line
136136
.demand(1)
137137
.command(
138138
`faces <gcsUri>`,

video-intelligence/package.json

+20-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,31 @@
22
"name": "nodejs-docs-samples-videointelligence",
33
"version": "0.0.1",
44
"private": true,
5-
"license": "Apache Version 2.0",
5+
"license": "Apache-2.0",
66
"author": "Google Inc.",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
10+
},
11+
"cloud": {
12+
"requiresKeyFile": true,
13+
"requiresProjectId": true
14+
},
15+
"engines": {
16+
"node": ">=4.3.2"
17+
},
718
"scripts": {
8-
"test": "cd ..; npm run st -- --verbose video/system-test/*.test.js"
19+
"lint": "samples lint",
20+
"pretest": "npm run lint",
21+
"system-test": "ava -T 10m --verbose system-test/*.test.js",
22+
"test": "npm run system-test"
923
},
1024
"dependencies": {
1125
"@google-cloud/videointelligence": "https://storage.googleapis.com/videointelligence-alpha/videointelligence-nodejs.tar.gz",
12-
"yargs": "7.0.2"
26+
"yargs": "7.1.0"
1327
},
14-
"engines": {
15-
"node": ">=4.3.2"
28+
"devDependencies": {
29+
"@google-cloud/nodejs-repo-tools": "1.3.1",
30+
"ava": "0.19.1"
1631
}
1732
}

video-intelligence/system-test/analyze.test.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,27 @@
1717

1818
'use strict';
1919

20-
require(`../../system-test/_setup`);
2120
const path = require(`path`);
21+
const test = require(`ava`);
22+
const tools = require(`@google-cloud/nodejs-repo-tools`);
2223

2324
const cmd = `node analyze.js`;
2425
const cwd = path.join(__dirname, `..`);
2526

2627
// analyze_faces
2728
test(`should analyze faces`, async (t) => {
28-
const output = await runAsync(`${cmd} faces gs://nodejs-docs-samples/video/google_gmail.mp4`, cwd);
29+
const output = await tools.runAsync(`${cmd} faces gs://nodejs-docs-samples/video/google_gmail.mp4`, cwd);
2930
t.regex(output, /Thumbnail size: \d+/);
3031
});
3132

3233
// analyze_labels
3334
test(`should analyze labels`, async (t) => {
34-
const output = await runAsync(`${cmd} labels gs://nodejs-docs-samples/video/cat.mp4`, cwd);
35+
const output = await tools.runAsync(`${cmd} labels gs://nodejs-docs-samples/video/cat.mp4`, cwd);
3536
t.regex(output, /Label description: Whiskers/);
3637
});
3738

3839
// analyze_shots
3940
test(`should analyze shots`, async (t) => {
40-
const output = await runAsync(`${cmd} shots gs://nodejs-docs-samples/video/gbike_dinosaur.mp4`, cwd);
41+
const output = await tools.runAsync(`${cmd} shots gs://nodejs-docs-samples/video/gbike_dinosaur.mp4`, cwd);
4142
t.regex(output, /Scene 0:/);
4243
});

0 commit comments

Comments
 (0)