New strategy

This commit is contained in:
Chase King 2025-03-11 13:46:31 -04:00
parent 5f0da0eb86
commit f6de29e9fd

View file

@ -87,20 +87,11 @@ stages:
-e ADMIN_SERVICE_API_URL=$(ADMIN_SERVICE_API_URL) \
-e SHARD=$(shardNumber) \
-e CI=true \
-e NODE_ENV=$(NODE_ENV) \
$(dockerImageName):$(imageTag) \
bash -c "num_tests=$(npx playwright test playwright-tests --list --grep \"@$jira_card_number\")
echo $num_tests
num_tests=${num_tests#*Total: }
num_tests=${num_tests%% test*}
echo \"Extracted number of tests: $num_tests\"
if [[ $num_tests -lt $(shardNumber) ]]; then
echo 'There are fewer tests than shards. Skipping this shard.'
else
npx concurrently -k -n \"server,playwright\"
\"sed -i \\\"s|^process\.env\.VUE_APP_CONSUMER_CF_DISTRO = .*|process\.env\.VUE_APP_CONSUMER_CF_DISTRO='https://digitalapi.test.safelite.io'|\\\" \\\"./vue.config.js\\\" && echo \\\"Updated config file to use TEST APIs\\\" && npm run serve -- --port=8080\"
\"npx wait-on http://localhost:8080 && npm run test:playwright -- --shard=$(shardNumber)/$(totalShards) --reporter=list,blob --grep \\\"@$jira_card_number\\\"\"
fi
")
npx concurrently -k -n "server,playwright"\
"sed -i \"s|^process\.env\.VUE_APP_CONSUMER_CF_DISTRO = .*|process\.env\.VUE_APP_CONSUMER_CF_DISTRO='https://digitalapi.test.safelite.io'|\" \"./vue.config.js\" && echo \"Updated config file to use TEST APIs\" && npm run serve -- --port=8080"\
"npx wait-on http://localhost:8080 && npm run test:playwright -- --shard=$(shardNumber)/$(totalShards) --reporter=list,blob --grep \"@$jira_card_number\"")
# Start container and stream logs
echo "Starting tests for shard $(shardNumber)..."