Skip to content
This repository was archived by the owner on Aug 14, 2020. It is now read-only.

Commit 1db5c06

Browse files
author
Ignacio Bonafonte
committed
When in SPM mode catch error when a test fail, and continue uploading symbols and code path data
1 parent 44b357e commit 1db5c06

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

dist/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,8 +1195,17 @@ async function swiftPackageRun(extraParameters, codePathEnabled, agentVersion) {
11951195
" -Xswiftc -framework -Xswiftc ScopeAgent -Xlinker -rpath -Xlinker " +
11961196
scopeMacFrameworkPath +
11971197
extraParameters;
1198-
const resultTest = await exec.exec(buildTestCommand, null, null);
11991198

1199+
let testError;
1200+
try {
1201+
await exec.exec(buildTestCommand, null, null);
1202+
} catch (error) {
1203+
testError = error.message;
1204+
}
1205+
1206+
if (testError) {
1207+
core.setFailed(testError.message);
1208+
}
12001209
// Upload symbols
12011210
let runScriptCommand =
12021211
"sh -c " + scopeDir + scopeMacFrameworkToolsPath + "upload_symbols";

index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,17 @@ async function swiftPackageRun(extraParameters, codePathEnabled, agentVersion) {
254254
" -Xswiftc -framework -Xswiftc ScopeAgent -Xlinker -rpath -Xlinker " +
255255
scopeMacFrameworkPath +
256256
extraParameters;
257-
const resultTest = await exec.exec(buildTestCommand, null, null);
258257

258+
let testError;
259+
try {
260+
await exec.exec(buildTestCommand, null, null);
261+
} catch (error) {
262+
testError = error.message;
263+
}
264+
265+
if (testError) {
266+
core.setFailed(testError.message);
267+
}
259268
// Upload symbols
260269
let runScriptCommand =
261270
"sh -c " + scopeDir + scopeMacFrameworkToolsPath + "upload_symbols";

0 commit comments

Comments
 (0)