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.
This commit is contained in:
parent
998ccfb287
commit
9e121c906c
1 changed files with 9 additions and 9 deletions
|
|
@ -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)..."
|
||||
|
|
|
|||
Loading…
Reference in a new issue