Skip to content

Commit 1236091

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

File tree

2 files changed

+51
-9
lines changed

2 files changed

+51
-9
lines changed

packages/google-cloud-videointelligence/samples/README.md

+31-4
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,34 @@ detection, and shot change detection.
1111
## Table of Contents
1212

1313
* [Setup](#setup)
14-
* [Running](#running)
14+
* [Samples](#samples)
15+
* [Analyze](#analyze)
16+
* [Running the tests](#running-the-tests)
1517

1618
## Setup
1719

18-
1. Read [Prerequisites][prereq] and [How to run a sample][run] first.
19-
1. Install dependencies:
20+
1. Read [Prerequisites][prereq] and [How to run a sample][run] first.
21+
1. Install dependencies:
22+
23+
With `npm`:
2024

2125
npm install
2226

27+
With `yarn`:
28+
29+
yarn install
30+
2331
[prereq]: ../README.md#prerequisities
2432
[run]: ../README.md#how-to-run-a-sample
2533

26-
## Running
34+
## Samples
35+
36+
### Analyze
2737

2838
View the [documentation][analyze_docs] or the [source code][analyze_code].
2939

40+
__Usage:__ `node analyze.js --help`
41+
3042
```
3143
Commands:
3244
faces <gcsUri> Analyzes faces in a video using the Cloud Video Intelligence API.
@@ -46,3 +58,18 @@ For more information, see https://cloud.google.com/video-intelligence/docs
4658

4759
[analyze_docs]: https://cloud.google.com/video-intelligence/docs
4860
[analyze_code]: analyze.js
61+
62+
## Running the tests
63+
64+
1. Set the `GCLOUD_PROJECT` and `GOOGLE_APPLICATION_CREDENTIALS` environment
65+
variables.
66+
67+
1. Run the tests:
68+
69+
With `npm`:
70+
71+
npm test
72+
73+
With `yarn`:
74+
75+
yarn test

packages/google-cloud-videointelligence/samples/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
}

0 commit comments

Comments
 (0)