@@ -34359,14 +34359,16 @@ async function run() {
34359
34359
const failFast = core.getInput('fail-fast', { required: false }) === 'true';
34360
34360
const flags = core.getInput('flags', { required: false });
34361
34361
const cloudRunLocally = core.getInput('cloud-run-locally', { required: false }) === 'true';
34362
+ const shouldCommentCloudTestRunUrlOnPR = core.getInput('comment-cloud-test-run-url-on-pr', { required: false }) === 'true';
34363
+ const allPromises = [];
34362
34364
const isCloud = await isCloudIntegrationEnabled();
34363
34365
const commands = testPaths.map(testPath => generateCommand(testPath)), TOTAL_TEST_RUNS = commands.length, TEST_RESULT_URLS_MAP = new Proxy({}, {
34364
34366
set: (target, key, value) => {
34365
34367
target[key] = value;
34366
34368
if (Object.keys(target).length === TOTAL_TEST_RUNS) {
34367
- if (isCloud) {
34369
+ if (isCloud && shouldCommentCloudTestRunUrlOnPR ) {
34368
34370
// Generate PR comment with test run URLs
34369
- ( 0, githubHelper_1.generatePRComment)(target);
34371
+ allPromises.push(( 0, githubHelper_1.generatePRComment)(target) );
34370
34372
}
34371
34373
}
34372
34374
return true;
@@ -34379,12 +34381,11 @@ async function run() {
34379
34381
let allTestsPassed = true;
34380
34382
if (parallel) {
34381
34383
const childProcesses = [];
34382
- const exitPromises = [];
34383
34384
commands.forEach(command => {
34384
34385
const child = runCommand(command);
34385
34386
childProcesses.push(child);
34386
34387
TEST_PIDS.push(child.pid);
34387
- exitPromises .push(new Promise(resolve => {
34388
+ allPromises .push(new Promise(resolve => {
34388
34389
child.on('exit', (code, signal) => {
34389
34390
const index = TEST_PIDS.indexOf(child.pid);
34390
34391
if (index > -1) {
@@ -34412,13 +34413,12 @@ async function run() {
34412
34413
});
34413
34414
}));
34414
34415
});
34415
- await Promise.all(exitPromises);
34416
34416
}
34417
34417
else {
34418
34418
for (const command of commands) {
34419
34419
const child = runCommand(command);
34420
34420
TEST_PIDS.push(child.pid);
34421
- await new Promise(resolve => {
34421
+ allPromises.push( new Promise(resolve => {
34422
34422
child.on('exit', (code, signal) => {
34423
34423
const index = TEST_PIDS.indexOf(child.pid);
34424
34424
if (index > -1) {
@@ -34439,9 +34439,10 @@ async function run() {
34439
34439
}
34440
34440
resolve();
34441
34441
});
34442
- });
34442
+ })) ;
34443
34443
}
34444
34444
}
34445
+ await Promise.all(allPromises);
34445
34446
if (!allTestsPassed) {
34446
34447
console.log('🚨 Some tests failed');
34447
34448
process.exit(1);
0 commit comments