@nordicsemiconductor/firmware-ci-runner-azure 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const fs = require('fs')
4
+ const { run } = require('../dist/run')
4
5
 
5
6
  const die = (err, origin) => {
6
7
  console.error(`An unhandled exception occured!`)
@@ -12,11 +13,11 @@ const die = (err, origin) => {
12
13
  process.on('uncaughtException', die)
13
14
  process.on('unhandledRejection', die)
14
15
 
15
- const { run } = require('../dist/run')
16
+ const input = JSON.parse(fs.readFileSync(0, 'utf-8'))
16
17
  run({
17
18
  target: process.env.RUN_TARGET ?? 'nrf9160dk_nrf9160_ns',
18
19
  port: process.env.RUN_PORT ?? '/dev/ttyACM0',
19
- })(JSON.parse(fs.readFileSync(0, 'utf-8')))
20
+ })(input)
20
21
  .then((res) => {
21
22
  if (res.timeout) {
22
23
  console.error(`Timed out.`)
package/dist/run.d.ts CHANGED
@@ -2,8 +2,8 @@ declare type Result = Promise<{
2
2
  connected: boolean;
3
3
  timeout: boolean;
4
4
  abort: boolean;
5
- deviceLog: string[];
6
- flashLog: string[];
5
+ deviceLog?: string[];
6
+ flashLog?: string[];
7
7
  }>;
8
8
  declare type Args = {
9
9
  deviceId: string;
package/dist/run.js CHANGED
@@ -16,6 +16,7 @@ const run = ({ port, target, }) => {
16
16
  debug('port', port);
17
17
  debug('target', target);
18
18
  return async ({ deviceId, appVersion, network, secTag, timeoutInMinutes, hexFile, fotaFile, abortOn, endOn, endOnWaitSeconds, testEnv, certDir, powerCycle, flashLogLocation, deviceLogLocation, }) => {
19
+ var _a, _b, _c, _d;
19
20
  debug('appVersion', appVersion);
20
21
  debug('network', network);
21
22
  debug('secTag', secTag);
@@ -219,8 +220,8 @@ const run = ({ port, target, }) => {
219
220
  await containerClient.deleteBlob(fotaFileName);
220
221
  }
221
222
  await Promise.all([
222
- fs_1.promises.writeFile(flashLogLocation, res.flashLog.join('\n'), 'utf-8'),
223
- fs_1.promises.writeFile(deviceLogLocation, res.deviceLog.join('\n'), 'utf-8'),
223
+ fs_1.promises.writeFile(flashLogLocation, (_b = (_a = res.flashLog) === null || _a === void 0 ? void 0 : _a.join('\n')) !== null && _b !== void 0 ? _b : '', 'utf-8'),
224
+ fs_1.promises.writeFile(deviceLogLocation, (_d = (_c = res.deviceLog) === null || _c === void 0 ? void 0 : _c.join('\n')) !== null && _d !== void 0 ? _d : '', 'utf-8'),
224
225
  ]);
225
226
  return res;
226
227
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nordicsemiconductor/firmware-ci-runner-azure",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Runs firmware on a real device connected to Azure IoT hub.",
5
5
  "main": "./dist/export.js",
6
6
  "bin": "./cli/index.js",
@@ -16,10 +16,11 @@
16
16
  "url": "git+https://github.com/NordicSemiconductor/cloud-azure-firmware-ci-runner-js.git"
17
17
  },
18
18
  "keywords": [
19
- "Cloud",
20
- "IoT",
21
- "AssetTracker",
22
- "Nordic Semiconductor"
19
+ "nrf-asset-tracker",
20
+ "iot",
21
+ "firmware",
22
+ "end-to-end-testing",
23
+ "azure"
23
24
  ],
24
25
  "author": "Nordic Semiconductor ASA | nordicsemi.no",
25
26
  "license": "BSD-3-Clause",