This commit is contained in:
Chase King 2025-02-27 15:30:16 -05:00
parent 131a47ebd6
commit 86009a7c07

View file

@ -161,10 +161,10 @@ stages:
bash -c "echo \"Moving Playwright reports out of subfolders...\" &&
find ./playwright-reports/ -mindepth 2 -type f -exec mv {} ./playwright-reports/ \; &&
echo \"Merging reports...\" &&
PLAYWRIGHT_JUNIT_OUTPUT_FILE=$PLAYWRIGHT_JUNIT_OUTPUT_FILE npx playwright merge-reports --reporter=ortoni-report,junit ./playwright-reports
num_failures=$(sed -n 's/.*failures="\([^"]*\)".*/\1/p' $PLAYWRIGHT_JUNIT_OUTPUT_FILE | head -n 1)
PLAYWRIGHT_JUNIT_OUTPUT_FILE=$(PLAYWRIGHT_JUNIT_OUTPUT_FILE) npx playwright merge-reports --reporter=ortoni-report,junit ./playwright-reports
num_failures=$(sed -n 's/.*failures="\([^"]*\)".*/\1/p' "/app/$PLAYWRIGHT_JUNIT_OUTPUT_FILE" | head -n 1)
echo \"Number of test failures: '$num_failures'\"
(($num_failures == 0)) && jira_message='Playwright tests passed!' || jira_message=\"$num_failures Playwright tests failed.\"
(($num_failures -eq 0)) && jira_message='Playwright tests passed!' || jira_message=\"$num_failures Playwright tests failed.\"
echo \"Contents of ortoni-report:\" && ls ./ortoni-report &&
echo \"Writing report to Jira card '$(Build.SourceBranchName)'...\" &&
./devops/scripts/jira_writeback.sh add_comment \"$(Build.SourceBranchName)\" /app/ortoni-report/ortoni-report.html \"AUTOMATED TEST RUN: $(date)\" \"$jira_message\" ")
@ -180,7 +180,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/junit-results.xml $(System.DefaultWorkingDirectory)
docker cp $container_id:/app/$(PLAYWRIGHT_JUNIT_OUTPUT_FILE) $(System.DefaultWorkingDirectory)
# TODO: Update to include junit results if necessary
# Remove container