Added publish Junit test results

This commit is contained in:
Chase King 2025-03-06 15:59:43 -05:00
parent ac6afbefdf
commit 2ea0a61529

View file

@ -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'