Skip to content

Commit 8221f9d

Browse files
committed
Workaround the various failings of Azure Devops
1 parent 65b89e9 commit 8221f9d

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

azure-pipelines/test-omnisharp.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ steps:
1414
env:
1515
DISPLAY: :99.0
1616

17+
- task: PublishTestResults@2
18+
condition: succeededOrFailed()
19+
displayName: 'Publish Test Results'
20+
inputs:
21+
testResultsFormat: 'JUnit'
22+
testResultsFiles: '*junit.xml'
23+
searchFolder: '$(Build.SourcesDirectory)/out'
24+
publishRunAttachments: true
25+
mergeTestResults: true
26+
testRunTitle: OmniSharp $(Agent.JobName) (Attempt $(System.JobAttempt))
27+
1728
- task: PublishPipelineArtifact@1
1829
condition: failed()
1930
displayName: 'Upload integration test logs'

azure-pipelines/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ jobs:
4343
testResultsFormat: 'JUnit'
4444
testResultsFiles: '*junit.xml'
4545
searchFolder: '$(Build.SourcesDirectory)/out'
46-
mergeTestResults: true
4746
publishRunAttachments: true
47+
mergeTestResults: true
48+
testRunTitle: $(Agent.JobName) (Attempt $(System.JobAttempt))
4849

4950
- task: PublishPipelineArtifact@1
5051
condition: failed()

jest.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,20 @@ const config: Config = {
1717
// Reporters are a global jest configuration property and cannot be set in the project jest config.
1818
// This configuration will create a 'junit.xml' file in the output directory, no matter which test project is running.
1919
// In order to not overwrite test results in CI, we configure a unique output file name in the gulp testTasks.
20-
reporters: ['default', ['jest-junit', { outputDirectory: '<rootDir>/out/' }]],
20+
reporters: [
21+
'default',
22+
[
23+
'jest-junit',
24+
{
25+
outputDirectory: '<rootDir>/out/',
26+
reportTestSuiteErrors: 'true',
27+
// Azure DevOps does not display test suites (it ignores them entirely).
28+
// So we have to put all the info in the test case name so the UI shows anything relatively useful.
29+
// See https://github.com/microsoft/azure-pipelines-tasks/issues/7659
30+
titleTemplate: '{filename} / {suitename} / {title}',
31+
},
32+
],
33+
],
2134
};
2235

2336
export default config;

0 commit comments

Comments
 (0)