diff --git a/lib/workers/testbot.ts b/lib/workers/testbot.ts index a1be2fb9..3b09f2f2 100644 --- a/lib/workers/testbot.ts +++ b/lib/workers/testbot.ts @@ -25,6 +25,8 @@ import * as Stream from 'stream'; import { manageHandlers } from '../helpers'; import ScreenCapture from '../helpers/graphics'; import NetworkManager, { Supported } from '../helpers/nm'; +import once from 'lodash/once'; + // TODO: Consider moving network and screen capture logic to testbot SDK. @@ -128,8 +130,12 @@ class TestBotWorker extends EventEmitter implements Leviathan.Worker { public async powerOn() { const dutLog = await this.hatBoard.openDutSerial(); if (dutLog) { - this.dutLogStream = createWriteStream(dutSerialPath); + this.dutLogStream = createWriteStream(dutSerialPath, { flags: `a+` }); dutLog.pipe(this.dutLogStream); + } else { + once(() => { + console.error(`Can't record serial logs: Getting ${dutLog} output`) + }) } console.log('Trying to power on DUT...'); await this.deviceInteractor.powerOn(); diff --git a/package.json b/package.json index c63eeaae..5abc98cb 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "scripts": { "lint:fix": "balena-lint -e js -e ts --fix bin/ lib/ test/", "lint": "balena-lint -u -e js -e ts --tests lib/ bin/ test/ && tsc --noEmit", - "preinstall": "for component in 'worker'; do npm --prefix $component install; done", "clean": "rm -rf build", "test": "npm run lint:fix && npm run lint && npm run test:cov", "build": "npm run clean && tsc",