From 4d794e3aee761916c8cec19b513372af76c01c5e Mon Sep 17 00:00:00 2001 From: Bernardo Guerreiro <39738771+bernardobridge@users.noreply.github.com> Date: Fri, 1 Dec 2023 18:56:22 +0000 Subject: [PATCH] refactor(cloud): send all end test information in single event (#2333) * 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 --- packages/artillery/lib/platform/cloud/cloud.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/artillery/lib/platform/cloud/cloud.js b/packages/artillery/lib/platform/cloud/cloud.js index e5d1fb280a..3ab5a3296d 100644 --- a/packages/artillery/lib/platform/cloud/cloud.js +++ b/packages/artillery/lib/platform/cloud/cloud.js @@ -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 }; } }); @@ -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');