Skip to content

Commit

Permalink
set close after publishing (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsharapkou authored Sep 26, 2024
1 parent 2c5b204 commit d0a2e43
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,14 @@ module.exports = (config) => {
}

await _publishResultsToTestrail();
await _closeTestRun();
});

event.dispatcher.on(event.all.result, async () => {
if (!process.env.RUNS_WITH_WORKERS) await _publishResultsToTestrail();
if (!process.env.RUNS_WITH_WORKERS) {
await _publishResultsToTestrail();
await _closeTestRun();
}
});

async function _publishResultsToTestrail() {
Expand Down Expand Up @@ -357,12 +361,6 @@ module.exports = (config) => {
}
});
});

if (config.closeTestRun === true) {
testrail.closeTestRun(runId).then(res => {
output.log(`The run ${runId} is updated with ${JSON.stringify(res)}`);
});
}
});
}
});
Expand All @@ -371,6 +369,14 @@ module.exports = (config) => {
}
}

async function _closeTestRun() {
if (config.closeTestRun === true) {
testrail.closeTestRun(runId).then(res => {
output.log(`The run ${runId} is updated with ${JSON.stringify(res)}`);
});
}
}

return this;
};

Expand Down

0 comments on commit d0a2e43

Please sign in to comment.