Skip to content

Commit a27b3ba

Browse files
fix(cloud-tests): display integration scan errors in UI (#1698)
Fixes #1695 Co-authored-by: Alex Alaniz <88956822+Alex-Alaniz@users.noreply.github.com>
1 parent d4f0cbe commit a27b3ba

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

apps/app/src/jobs/tasks/integration/integration-results.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@ export const sendIntegrationResults = schemaTask({
135135
logger.error(`Failed to create error record: ${createError}`);
136136
}
137137

138-
return {
139-
success: false,
140-
error: error instanceof Error ? error.message : String(error),
141-
};
138+
throw error;
142139
}
143140
},
144141
});

apps/app/src/jobs/tasks/integration/run-integration-tests.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,24 @@ export const runIntegrationTests = task({
5757

5858
try {
5959
const batchHandle = await sendIntegrationResults.batchTriggerAndWait(batchItems);
60-
60+
61+
// Check if any child runs failed
62+
const failedRuns = batchHandle.runs.filter((run) => !run.ok);
63+
64+
if (failedRuns.length > 0) {
65+
const errorMessages = failedRuns
66+
.map((run) => {
67+
const errorMsg = run.error instanceof Error ? run.error.message : String(run.error);
68+
return errorMsg;
69+
})
70+
.join('; ');
71+
72+
logger.error(`Integration tests failed for organization ${organizationId}: ${errorMessages}`);
73+
throw new Error(errorMessages);
74+
}
75+
6176
logger.info(`Successfully completed batch integration tests for organization: ${organizationId}`);
62-
77+
6378
return {
6479
success: true,
6580
organizationId,
@@ -68,13 +83,7 @@ export const runIntegrationTests = task({
6883
};
6984
} catch (error) {
7085
logger.error(`Failed to run integration tests for organization ${organizationId}: ${error}`);
71-
72-
return {
73-
success: false,
74-
error: error instanceof Error ? error.message : String(error),
75-
organizationId,
76-
integrationsCount: integrations.length,
77-
};
86+
throw error;
7887
}
7988
},
8089
});

0 commit comments

Comments
 (0)