From 9e121c906c46519d5ef2819ea8998abc89c87929 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Thu, 10 Jul 2025 13:55:01 -0400 Subject: [PATCH] Ensures environment variables are correctly passed Specifies that environment variables are exported to ensure they are accessible within the Docker container context. Also wraps the execution command in `bash -c` to ensure proper command execution within the container. --- temp/playwright-test.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/temp/playwright-test.yml b/temp/playwright-test.yml index 9fc767367..bcf8667ab 100644 --- a/temp/playwright-test.yml +++ b/temp/playwright-test.yml @@ -169,19 +169,19 @@ jobs: "npx --prefix $PLAYWRIGHT_PATH wait-on $TARGET_URL && npx --prefix $PLAYWRIGHT_PATH playwright test $PLAYWRIGHT_PATH --shard=$SHARD_NUMBER/$TOTAL_SHARDS --reporter=list,blob $FILTER" \ ) else - TARGET_URL="$TARGET_URL" - JIRA_CARD_NUMBER="$JIRA_CARD_NUMBER" - FILTER="$FILTER" - PLAYWRIGHT_PATH="${{ parameters.playwrightTestsPath }}" - SERVE_PATH="${{ parameters.npmServePath }}" - SHARD_NUMBER=$(shardNumber) - TOTAL_SHARDS=$(totalShards) + export TARGET_URL="$TARGET_URL" + export JIRA_CARD_NUMBER="$JIRA_CARD_NUMBER" + export FILTER="$FILTER" + export PLAYWRIGHT_PATH="${{ parameters.playwrightTestsPath }}" + export SERVE_PATH="${{ parameters.npmServePath }}" + export SHARD_NUMBER=$(shardNumber) + export TOTAL_SHARDS=$(totalShards) container_id=$(docker create \ --ipc=host \ --env-file "${{ parameters.envFileName }}" \ ${{ parameters.dockerImageName }}:${{ parameters.imageTag }} \ - "npx --prefix $PLAYWRIGHT_PATH playwright test $PLAYWRIGHT_PATH --shard=$SHARD_NUMBER/$TOTAL_SHARDS --reporter=list,blob $FILTER" \ - ) + bash -c "npx --prefix $PLAYWRIGHT_PATH playwright test $PLAYWRIGHT_PATH --shard=$SHARD_NUMBER/$TOTAL_SHARDS --reporter=list,blob $FILTER" \ + ) fi # Start container and stream logs echo "Starting tests for shard $(shardNumber)..."