Skip to content

Commit

Permalink
refactor(cloud): send all end test information in single event (#2333)
Browse files Browse the repository at this point in the history
* feat(cli): pass final report to onShutdown methods

* refactor(cloud): send all end test information in single event

* refactor(cli): use testEndInfo to pass report to cloud instead
  • Loading branch information
bernardobridge committed Dec 1, 2023
1 parent ffdd0a1 commit 4d794e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 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 @@ -154,10 +155,9 @@ class ArtilleryCloudPlugin {

await this._event('testrun:end', {
ts: testEndInfo.endTime,
exitCode: global.artillery.suggestedExitCode || opts.exitCode
});
await this._event('testrun:changestatus', {
status: opts.earlyStop ? 'EARLY_STOP' : 'COMPLETED'
exitCode: global.artillery.suggestedExitCode || opts.exitCode,
isEarlyStop: !!opts.earlyStop,
report: testEndInfo.report
});

console.log('\n');
Expand Down

0 comments on commit 4d794e3

Please sign in to comment.