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.
This commit is contained in:
parent
9e121c906c
commit
36fa8fb3f3
1 changed files with 17 additions and 14 deletions
|
|
@ -247,20 +247,23 @@ jobs:
|
||||||
export PLAYWRIGHT_PATH="${{ parameters.playwrightTestsPath }}"
|
export PLAYWRIGHT_PATH="${{ parameters.playwrightTestsPath }}"
|
||||||
|
|
||||||
|
|
||||||
container_id=$(docker create \
|
export JIRA_CARD_NUMBER="$JIRA_CARD_NUMBER"
|
||||||
--ipc=host \
|
container_id=$(docker create \
|
||||||
--env-file "${{ parameters.envFileName }}" \
|
--ipc=host \
|
||||||
-e JIRA_CARD_NUMBER="$JIRA_CARD_NUMBER" \
|
--env-file "${{ parameters.envFileName }}" \
|
||||||
${{ parameters.dockerImageName }}:${{ parameters.imageTag }} \
|
${{ parameters.dockerImageName }}:${{ parameters.imageTag }} \
|
||||||
echo 'Moving Playwright reports out of subfolders...'; \
|
bash -c "
|
||||||
find ./playwright-reports/ -mindepth 2 -type f -exec mv {} ./playwright-reports/ \; ; \
|
echo 'Moving Playwright reports out of subfolders...'
|
||||||
echo 'Merging reports...'; \
|
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' npx --prefix $PLAYWRIGHT_PATH playwright merge-reports ./playwright-reports; \
|
echo 'Merging reports...'
|
||||||
echo 'Contents of ortoni-report:' && ls ./ortoni-report; \
|
PLAYWRIGHT_JUNIT_OUTPUT_DIR='/app/test-results' PLAYWRIGHT_JUNIT_OUTPUT_NAME='junit_results.xml' npx --prefix $PLAYWRIGHT_PATH playwright merge-reports ./playwright-reports
|
||||||
echo 'Current dir: ' && pwd; \
|
echo 'Contents of ortoni-report:' && ls ./ortoni-report
|
||||||
echo 'Contents of current dir: ' && ls; \
|
echo 'Current dir: ' && pwd
|
||||||
echo 'Contents of /app/test-results' && ls /app/test-results; \
|
echo 'Contents of current dir: ' && ls
|
||||||
)
|
echo 'Contents of /app/test-results' && ls /app/test-results
|
||||||
|
"
|
||||||
|
)
|
||||||
|
|
||||||
# Start container and stream logs
|
# Start container and stream logs
|
||||||
echo "Starting merge"
|
echo "Starting merge"
|
||||||
docker start -a $container_id
|
docker start -a $container_id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue