From 36fa8fb3f3b8dd6c55f0f899afb5c4f816c3d60d Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Thu, 10 Jul 2025 14:03:53 -0400 Subject: [PATCH] Executes Playwright commands within a bash shell The previous implementation encountered issues with command execution within the docker container. This change wraps the Playwright commands in a bash shell, ensuring proper execution and resolving potential errors during the report merging and related processes. --- temp/playwright-test.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/temp/playwright-test.yml b/temp/playwright-test.yml index bcf8667ab..a27e38441 100644 --- a/temp/playwright-test.yml +++ b/temp/playwright-test.yml @@ -247,20 +247,23 @@ jobs: export PLAYWRIGHT_PATH="${{ parameters.playwrightTestsPath }}" - container_id=$(docker create \ - --ipc=host \ - --env-file "${{ parameters.envFileName }}" \ - -e JIRA_CARD_NUMBER="$JIRA_CARD_NUMBER" \ - ${{ parameters.dockerImageName }}:${{ parameters.imageTag }} \ - echo 'Moving Playwright reports out of subfolders...'; \ - find ./playwright-reports/ -mindepth 2 -type f -exec mv {} ./playwright-reports/ \; ; \ - echo 'Merging reports...'; \ - PLAYWRIGHT_JUNIT_OUTPUT_DIR='/app/test-results' PLAYWRIGHT_JUNIT_OUTPUT_NAME='junit_results.xml' npx --prefix $PLAYWRIGHT_PATH playwright merge-reports ./playwright-reports; \ - echo 'Contents of ortoni-report:' && ls ./ortoni-report; \ - echo 'Current dir: ' && pwd; \ - echo 'Contents of current dir: ' && ls; \ - echo 'Contents of /app/test-results' && ls /app/test-results; \ - ) + export JIRA_CARD_NUMBER="$JIRA_CARD_NUMBER" + container_id=$(docker create \ + --ipc=host \ + --env-file "${{ parameters.envFileName }}" \ + ${{ parameters.dockerImageName }}:${{ parameters.imageTag }} \ + 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_DIR='/app/test-results' PLAYWRIGHT_JUNIT_OUTPUT_NAME='junit_results.xml' npx --prefix $PLAYWRIGHT_PATH playwright merge-reports ./playwright-reports + echo 'Contents of ortoni-report:' && ls ./ortoni-report + echo 'Current dir: ' && pwd + echo 'Contents of current dir: ' && ls + echo 'Contents of /app/test-results' && ls /app/test-results + " + ) + # Start container and stream logs echo "Starting merge" docker start -a $container_id