Skip to content

Commit

Permalink
Add an option to disable flashing of firmware binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeuz committed Jan 13, 2025
1 parent a9fcf3c commit 9a2585d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
12 changes: 11 additions & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ const config = convict({
doc: 'Run mode',
format: Object.values(RunMode),
default: RunMode.NORMAL
},
noFlash: {
doc: 'Do not flash firmware binaries',
format: Boolean,
default: false
}
});

Expand Down Expand Up @@ -322,7 +327,10 @@ function loadCliProfile() {
function parseCmdLine() {
return parseArgs(process.argv.slice(2), {
string: ['_', 'grep', 'config-file', 'test-dir', 'binary-dir', 'device-os-dir', 'target-dir', 'report-file'],
boolean: ['build', 'dry', 'fixtures', 'tags', 'combine', 'version', 'help', 'json', 'verbose'],
boolean: ['build', 'dry', 'fixtures', 'tags', 'combine', 'version', 'help', 'json', 'verbose', 'flash'],
default: {
'flash': true
},
alias: {
'grep': 'g',
'config-file': 'c',
Expand Down Expand Up @@ -454,6 +462,8 @@ function updateConfig(args) {
config.set('logLevel', LogLevel.VERBOSE);
config.set('verbose', true);
}
// Whether to build and flash firmware binaries
config.set('noFlash', !args['flash']);
}

function loadConfigFiles(args) {
Expand Down
1 change: 1 addition & 0 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class Runner {
binaryDir: this._binaryDir,
tempDir: this._tempDir.name,
dryRun: this._runMode === RunMode.DRY_RUN,
noFlash: config.get('noFlash'),
log: this._log,
// Convenience functions
receiveEvent: (...args) => this._apiClient.receiveEvent(...args),
Expand Down
6 changes: 4 additions & 2 deletions lib/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ class PlatformSuite {
// Initialize devices under test
await this._initDevices();
if (!this._ctx.dryRun) {
// Build and flash application binaries
await this._flashApps();
if (!this._ctx.noFlash) {
// Build and flash application binaries
await this._flashApps();
}
// Add device tests to the suite
await this._updateTests();
} else {
Expand Down

0 comments on commit 9a2585d

Please sign in to comment.