@@ -34349,8 +34349,8 @@ async function run() {
34349
34349
set: (target, key, value) => {
34350
34350
target[key] = value;
34351
34351
if (Object.keys(target).length === TOTAL_TEST_RUNS) {
34352
- console.log ('📊 URLs for all the tests gathered');
34353
- console.log(' 📊 Test URLs:', target);
34352
+ core.debug ('📊 URLs for all the tests gathered');
34353
+ core.debug(` 📊 Test URLs: ${ target}` );
34354
34354
if (isCloud) {
34355
34355
// Generate PR comment with test run URLs
34356
34356
(0, githubHelper_1.generatePRComment)(target);
@@ -34515,12 +34515,24 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
34515
34515
exports.parseK6Output = void 0;
34516
34516
const REGEX_EXPRESSIONS = {
34517
34517
scriptPath: /^\s*script:\s*(.+)$/m,
34518
+ // output: https://k6cloud.grafana.net/a/k6-app/runs/123
34519
+ // output: cloud (https://k6cloud.grafana.net/a/k6-app/runs/2662254)
34518
34520
output: /^\s*output:\s*(.+)$/m,
34521
+ outputCloudUrl: /cloud\s*\((.+)\)/,
34519
34522
runningIteration: /running \(.*\), \d+\/\d+ VUs, \d+ complete and \d+ interrupted iterations/g,
34520
34523
// default [ 20% ] 10 VUs 1.0s/5s
34521
34524
// createBrowser [ 61% ] 035/500 VUs 0m36.5s/1m0s 5.00 iters/s
34522
- runProgress: /\[\s*(\d+)%\s*\]\s*\d+(\/\d+)? VUs/g
34523
- };
34525
+ executionProgress: /\[\s*(\d+)%\s*\]\s*\d+(\/\d+)? VUs/g,
34526
+ // Init [ 0% ] Loading test script...
34527
+ // Init [ 0% ] Validating script options
34528
+ // Run [ 17% ] 14.0s/35s
34529
+ // Run [ 0% ] Initializing
34530
+ cloudRunExecution: /Init|Run\s+\[\s+\d+%\s+\]/g
34531
+ }, TEST_RUN_PROGRESS_MSG_REGEXES = [
34532
+ REGEX_EXPRESSIONS.runningIteration,
34533
+ REGEX_EXPRESSIONS.executionProgress,
34534
+ REGEX_EXPRESSIONS.cloudRunExecution
34535
+ ];
34524
34536
function extractTestRunUrl(data, testResultUrlsMap) {
34525
34537
/**
34526
34538
* This function extracts the script path and output URL from the k6 output.
@@ -34539,8 +34551,10 @@ function extractTestRunUrl(data, testResultUrlsMap) {
34539
34551
// Extracting the output URL
34540
34552
const outputMatch = data.match(REGEX_EXPRESSIONS.output);
34541
34553
const output = outputMatch ? outputMatch[1] : null;
34554
+ const outputCloudUrlMatch = output ? output.match(REGEX_EXPRESSIONS.outputCloudUrl) : null;
34555
+ const outputCloudUrl = outputCloudUrlMatch ? outputCloudUrlMatch[1] : output;
34542
34556
if (scriptPath && output) {
34543
- testResultUrlsMap[scriptPath] = output ;
34557
+ testResultUrlsMap[scriptPath] = outputCloudUrl || '' ;
34544
34558
return true;
34545
34559
}
34546
34560
else {
@@ -34575,6 +34589,9 @@ function checkIfK6ASCIIArt(data) {
34575
34589
if (!data.includes(".io")) {
34576
34590
return false;
34577
34591
}
34592
+ // During cloud execution, the ASCII art is printed with %0A instead of \n
34593
+ data = data.replace(/%0A/g, "\n");
34594
+ data = data.slice(0, data.indexOf(".io") + 3);
34578
34595
let K6_ASCII_ART_CHARS = [
34579
34596
'|', ' ', '\n', '/',
34580
34597
'‾', '(', ')', '_',
@@ -34620,7 +34637,7 @@ function parseK6Output(data, testResultUrlsMap, totalTestRuns) {
34620
34637
}
34621
34638
}
34622
34639
const filteredLines = lines.filter((line) => {
34623
- const isRegexMatch = REGEX_EXPRESSIONS.runningIteration.test(line) || REGEX_EXPRESSIONS.runProgress. test(line);
34640
+ const isRegexMatch = TEST_RUN_PROGRESS_MSG_REGEXES.some((regex) => regex. test(line) );
34624
34641
return !isRegexMatch;
34625
34642
});
34626
34643
if (filteredLines.length < lines.length) {
0 commit comments