From b2e9f324a9009d5028acc37ffd04b636b721822d Mon Sep 17 00:00:00 2001 From: Jakub Mucha Date: Fri, 7 Oct 2022 20:27:53 +0200 Subject: [PATCH] feat: add logging to launcher.js Signed-off-by: Jakub Mucha --- launcher.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/launcher.js b/launcher.js index 5f83a5d01..cb314c70c 100644 --- a/launcher.js +++ b/launcher.js @@ -1,6 +1,8 @@ +const log = require('debug')('synpress:launcher'); const cypress = require('cypress'); const helpers = require('./helpers'); const synpressConfigPath = `${helpers.getSynpressPath()}/synpress.config.js`; +log(`Detected synpress config path is: ${synpressConfigPath}`); process.env.CYPRESS_REMOTE_DEBUGGING_PORT = 9222; @@ -23,35 +25,47 @@ const launcher = { }, async run(arguments_) { if (arguments_.configFile) { + log(`Custom config file arg detected: ${arguments_.configFile}`); defaultArguments.push(`--config-file=${arguments_.configFile}`); } else { + log('Using default config file'); defaultArguments.push(`--config-file=${synpressConfigPath}`); } + log(`Tests will run on ${arguments_.browser} browser`); defaultArguments.push(`--browser=${arguments_.browser}`); if (arguments_.config) { + log(`Custom config arg detected: ${defaultConfig},${arguments_.config}`); defaultArguments.push(`--config=${defaultConfig},${arguments_.config}`); } else { + log(`Using default config: ${defaultConfig}`); defaultArguments.push(`--config=${defaultConfig}`); } if (arguments_.env) { + log(`Custom env arg detected: ${arguments_.env}`); defaultArguments.push(`--env=${arguments_.env}`); } if (arguments_.spec) { + log(`Custom spec arg detected: ${arguments_.spec}`); defaultArguments.push(`--spec=${arguments_.spec}`); } if (arguments_.noExit) { + log(`noExit arg enabled`); defaultArguments.push('--no-exit'); } if (arguments_.project) { + log(`Custom project arg detected: ${arguments_.project}`); defaultArguments.push(`--project=${arguments_.project}`); } if (arguments_.quiet) { + log(`quiet arg enabled`); defaultArguments.push('--quiet'); } if (arguments_.reporter) { + log(`Custom reporter arg detected: ${arguments_.reporter}`); defaultArguments.push(`--reporter=${arguments_.reporter}`); } if (arguments_.reporterOptions) { + log(`Custom reporterOptions arg detected: ${arguments_.reporterOptions}`); defaultArguments.push(`--reporter-options=${arguments_.reporterOptions}`); } if (arguments_.ciBuildId) { @@ -59,22 +73,30 @@ const launcher = { defaultArguments.push(`--ci-build-id=${arguments_.ciBuildId}`); } if (arguments_.record) { + log(`record arg enabled`); defaultArguments.push('--record'); } if (arguments_.key) { + log(`Custom key arg detected: ${arguments_.key}`); defaultArguments.push(`--key=${arguments_.key}`); } if (arguments_.parallel) { + log(`parallel arg enabled`); defaultArguments.push('--parallel'); } if (arguments_.group) { + log(`Custom group arg detected: ${arguments_.group}`); defaultArguments.push(`--group=${arguments_.group}`); } if (arguments_.tag) { + log(`Custom tag arg detected: ${arguments_.tag}`); defaultArguments.push(`--tag=${arguments_.tag}`); } const runOptions = await cypress.cli.parseRunArguments(defaultArguments); + log( + `Running synpress with following options: ${JSON.stringify(runOptions)}`, + ); const results = await cypress.run(runOptions); if (results.failures) { console.error('Failed to run Cypress');