Skip to content

Commit

Permalink
refactor(cli): use testEndInfo to pass report to cloud instead
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardobridge committed Nov 29, 2023
1 parent 864bb35 commit c218de8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/artillery/lib/cmds/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ RunCommand.runCommandImplementation = async function (flags, argv, args) {
const ps2 = [];
for (const e of global.artillery.extensionEvents) {
if (e.ext === 'onShutdown') {
ps2.push(e.method({ ...opts, report: finalReport }));
ps2.push(e.method(opts));
}
}
await Promise.allSettled(ps2);
Expand Down
7 changes: 4 additions & 3 deletions packages/artillery/lib/platform/cloud/cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@ class ArtilleryCloudPlugin {

global.artillery.ext({
ext: 'beforeExit',
method: async ({ testInfo }) => {
method: async ({ testInfo, report }) => {
debug('beforeExit');
testEndInfo = {
...testEndInfo,
...testInfo
...testInfo,
report
};
}
});
Expand All @@ -156,7 +157,7 @@ class ArtilleryCloudPlugin {
ts: testEndInfo.endTime,
exitCode: global.artillery.suggestedExitCode || opts.exitCode,
isEarlyStop: !!opts.earlyStop,
report: opts.report
report: testEndInfo.report
});

console.log(`\nRun URL: ${testEndInfo.testRunUrl}`);
Expand Down

0 comments on commit c218de8

Please sign in to comment.