Factor out test mode determination code
This commit is contained in:
parent
0c3c093eba
commit
7c2be06006
9 changed files with 27 additions and 12 deletions
3
lib/upload-lib.js
generated
3
lib/upload-lib.js
generated
|
|
@ -93,8 +93,7 @@ function getAutomationID(category, analysis_key, environment) {
|
|||
async function uploadPayload(payload, repositoryNwo, apiDetails, logger) {
|
||||
logger.info("Uploading results");
|
||||
// If in test mode we don't want to upload the results
|
||||
const testMode = process.env["TEST_MODE"] === "true" || false;
|
||||
if (testMode) {
|
||||
if (util.isInTestMode()) {
|
||||
const payloadSaveFile = path.join(actionsUtil.getTemporaryDirectory(), "payload.json");
|
||||
logger.info(`In test mode. Results are not uploaded. Saving to ${payloadSaveFile}`);
|
||||
logger.info(`Payload: ${JSON.stringify(payload, null, 2)}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue