Skip to content

Iot fix tests #743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Oct 10, 2018
14 changes: 8 additions & 6 deletions iot/http_example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
"test": "repo-tools test run --cmd ava -- -T 3m --verbose system-test/*.test.js"
},
"dependencies": {
"jsonwebtoken": "7.4.1",
"retry-request": "3.3.1",
"yargs": "8.0.2"
},
"devDependencies": {
"manager": "../manager",
"googleapis": "^32.0.0",
"@google-cloud/pubsub": "0.13.2",
"@google-cloud/nodejs-repo-tools": "2.2.5",
"ava": "0.22.0",
"jsonwebtoken": "7.4.1",
"retry-request": "3.3.1",
"semistandard": "^12.0.1",
"uuid": "3.1.0",
"yargs": "8.0.2"
},
"devDependencies": {}
"uuid": "3.1.0"
}
}
6 changes: 2 additions & 4 deletions iot/http_example/system-test/cloudiot_http_example.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ const registryName = `nodejs-test-registry-iot-${uuid.v4()}`;
const helper = `node ../manager/manager.js`;
const cmd = `node cloudiot_http_example.js --registryId="${registryName}" --deviceId="${deviceId}" `;
const cwd = path.join(__dirname, `..`);
const installDeps = `pushd ../manager && npm install`;
const installDeps = `npm install`;

test.todo(tools.run(installDeps, `${cwd}/../manager`));
test.before(tools.checkCredentials);
test.before(async () => {
const pubsub = PubSub();
Expand All @@ -53,7 +54,6 @@ test(`should receive configuration message`, async (t) => {
const localDevice = `test-rsa-device`;
const localRegName = `${registryName}-rsa256`;

await tools.runAsync(installDeps, cwd);
await tools.runAsync(`${helper} setupIotTopic ${topicName}`, cwd);
await tools.runAsync(
`${helper} createRegistry ${localRegName} ${topicName}`, cwd);
Expand All @@ -75,7 +75,6 @@ test(`should send event message`, async (t) => {
const localDevice = `test-rsa-device`;
const localRegName = `${registryName}-rsa256`;

await tools.runAsync(installDeps, cwd);
await tools.runAsync(`${helper} setupIotTopic ${topicName}`, cwd);
await tools.runAsync(
`${helper} createRegistry ${localRegName} ${topicName}`, cwd);
Expand All @@ -96,7 +95,6 @@ test(`should send event message`, async (t) => {
test(`should send event message`, async (t) => {
const localDevice = `test-rsa-device`;
const localRegName = `${registryName}-rsa256`;
await tools.runAsync(installDeps, cwd);
await tools.runAsync(`${helper} setupIotTopic ${topicName}`, cwd);
await tools.runAsync(
`${helper} createRegistry ${localRegName} ${topicName}`, cwd);
Expand Down
14 changes: 8 additions & 6 deletions iot/mqtt_example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
"test": "repo-tools test run --cmd ava -- -T 3m --verbose system-test/*.test.js"
},
"dependencies": {
"jsonwebtoken": "8.2.0",
"mqtt": "2.16.0",
"yargs": "11.0.0"
},
"devDependencies": {
"manager": "../manager",
"googleapis": "^32.0.0",
"@google-cloud/pubsub": "0.16.4",
"@google-cloud/nodejs-repo-tools": "2.2.5",
"ava": "0.25.0",
"jsonwebtoken": "8.2.0",
"mqtt": "2.16.0",
"semistandard": "^12.0.1",
"uuid": "3.2.1",
"yargs": "11.0.0"
},
"devDependencies": {}
"uuid": "3.2.1"
}
}
6 changes: 2 additions & 4 deletions iot/mqtt_example/system-test/cloudiot_mqtt_example.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ const helper = `node ../manager/manager.js`;
const cmd = `node cloudiot_mqtt_example_nodejs.js `;
const cmdSuffix = ` --numMessages=1 --privateKeyFile=resources/rsa_private.pem --algorithm=RS256`;
const cwd = path.join(__dirname, `..`);
const installDeps = `pushd ../manager && npm install`;
const installDeps = `npm install`;

test.todo(tools.run(installDeps, `${cwd}/../manager`));
test.before(tools.checkCredentials);
test.before(async () => {
const pubsub = PubSub();
Expand All @@ -53,7 +54,6 @@ test(`should receive configuration message`, async (t) => {
const localDevice = `test-rsa-device`;
const localRegName = `${registryName}-rsa256`;

await tools.runAsync(installDeps, cwd);
let output = await tools.runAsync(`${helper} setupIotTopic ${topicName}`, cwd);
await tools.runAsync(
`${helper} createRegistry ${localRegName} ${topicName}`, cwd);
Expand All @@ -78,7 +78,6 @@ test(`should send event message`, async (t) => {
const localDevice = `test-rsa-device`;
const localRegName = `${registryName}-rsa256`;

await tools.runAsync(installDeps, cwd);
await tools.runAsync(`${helper} setupIotTopic ${topicName}`, cwd);
await tools.runAsync(
`${helper} createRegistry ${localRegName} ${topicName}`, cwd);
Expand All @@ -101,7 +100,6 @@ test(`should send event message`, async (t) => {
test(`should send state message`, async (t) => {
const localDevice = `test-rsa-device`;
const localRegName = `${registryName}-rsa256`;
await tools.runAsync(installDeps, cwd);
await tools.runAsync(`${helper} setupIotTopic ${topicName}`, cwd);
await tools.runAsync(
`${helper} createRegistry ${localRegName} ${topicName}`, cwd);
Expand Down