Skip to content

Commit 569775c

Browse files
committed
Combine error message and stacktrace into a single field + fixed build pipeline
1 parent 37d2df6 commit 569775c

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,13 @@ on:
1212
workflow_dispatch:
1313

1414
env:
15-
# Path to the solution file relative to the root of the project
16-
SOLUTION_FILE_PATH: .
17-
1815
# Configuration type to build
1916
BUILD_CONFIGURATION: Debug
2017

21-
BUILD_OUTPUT: src/JunitTestLogger/bin/Debug
22-
2318
jobs:
2419

2520
build:
26-
runs-on: ubuntu-lastest
21+
runs-on: ubuntu-latest
2722

2823
steps:
2924
- name: Checkout

src/JunitTestLogger/JUnitTestLogger.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageIconUrl></PackageIconUrl>
1212
<PackageProjectUrl>https://github.com/CompuMasterGmbH/JUnitTestLogger</PackageProjectUrl>
1313
<BuildOutputTargetFolder>build</BuildOutputTargetFolder>
14-
<Version>1.1.0</Version>
14+
<Version>1.1.1</Version>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1616
<Copyright>Syncromatics Engineering, CompuMaster GmbH</Copyright>
1717
<RepositoryUrl>https://github.com/CompuMasterGmbH/JUnitTestLogger.git</RepositoryUrl>

src/JunitTestLogger/JUnitXmlTestLogger.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,18 @@ private static XElement CreateTestCaseElement(TestResultInfo result)
378378
if (result.Outcome == TestOutcome.Failed)
379379
{
380380
var failure = new XElement("error");
381-
failure.SetAttributeValue("message", RemoveInvalidXmlChar(result.ErrorMessage));
382-
failure.Value = RemoveInvalidXmlChar(result.ErrorStackTrace);
383-
381+
if ((!(string.IsNullOrEmpty(result.ErrorMessage))) && (!(string.IsNullOrEmpty(result.ErrorStackTrace))))
382+
{
383+
failure.Value = RemoveInvalidXmlChar(result.ErrorMessage) + System.Environment.NewLine + RemoveInvalidXmlChar(result.ErrorStackTrace);
384+
}
385+
else if (!(string.IsNullOrEmpty(result.ErrorMessage)))
386+
{
387+
failure.Value = RemoveInvalidXmlChar(result.ErrorMessage);
388+
}
389+
else
390+
{
391+
failure.Value = RemoveInvalidXmlChar(result.ErrorStackTrace);
392+
}
384393
element.Add(failure);
385394
}
386395

0 commit comments

Comments
 (0)