From 2ea0a61529a50d26149c0289e84f93352c37767e Mon Sep 17 00:00:00 2001 From: Chase King Date: Thu, 6 Mar 2025 15:59:43 -0500 Subject: [PATCH] Added publish Junit test results --- azure-pipelines-automated-testing.yml | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/azure-pipelines-automated-testing.yml b/azure-pipelines-automated-testing.yml index 20f6e479..7a96e1bc 100644 --- a/azure-pipelines-automated-testing.yml +++ b/azure-pipelines-automated-testing.yml @@ -160,8 +160,10 @@ stages: $(dockerImageName):$(imageTag) \ bash -c "echo \"Moving Playwright reports out of subfolders...\" && find ./playwright-reports/ -mindepth 2 -type f -exec mv {} ./playwright-reports/ \; && + PLAYWRIGHT_JUNIT_OUTPUT_DIR='/app/test_results' + PLAYWRIGHT_JUNIT_OUTPUT_NAME='junit_results.xml' echo \"Merging reports...\" && - npx playwright merge-reports --reporter=ortoni-report ./playwright-reports + npx playwright merge-reports --reporter=ortoni-report,junit ./playwright-reports echo \"Contents of ortoni-report:\" && ls ./ortoni-report && echo 'Current dir: ' && pwd echo 'Contents of current dir: ' && ls @@ -180,8 +182,7 @@ stages: # Copy test results from container echo "Copying test results..." docker cp $container_id:/app/ortoni-report/. $(System.DefaultWorkingDirectory)/ortoni-report - # docker cp $container_id:/app/test-results/junit_results.xml $(System.DefaultWorkingDirectory) - # TODO: Update to include junit results if necessary + docker cp $container_id:/app/test-results/junit_results.xml $(System.DefaultWorkingDirectory)/test-results # Remove container echo "Cleaning up container..." @@ -190,17 +191,16 @@ stages: JIRA_API_KEY: $(JIRA_API_KEY) displayName: merge_and_publish_results_to_jira - # TODO: Enable later when working on PR gate - # - task: PublishTestResults@2 - # displayName: 'Publish test results' - # inputs: - # searchFolder: 'test-results' - # testResultsFormat: 'JUnit' - # testResultsFiles: 'junit_results.xml' - # mergeTestResults: true - # failTaskOnFailedTests: false - # testRunTitle: 'Playwright Tests' - # condition: succeededOrFailed() + - task: PublishTestResults@2 + displayName: 'Publish test results' + inputs: + searchFolder: 'test-results' + testResultsFormat: 'JUnit' + testResultsFiles: 'junit_results.xml' + mergeTestResults: true + failTaskOnFailedTests: false + testRunTitle: 'Playwright Tests' + condition: succeededOrFailed() - task: PublishPipelineArtifact@1 displayName: 'Publish Merged Report'