Skip to content

Commit b667bc4

Browse files
committed
fix(test): use unique runner-scoped channel names and file targets to prevent cross-OS test collision
1 parent 1ab79a4 commit b667bc4

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

scripts/hosting-tests/run.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ CWD="$(pwd)"
44

55
source scripts/set-default-credentials.sh
66

7-
TARGET_FILE="${COMMIT_SHA}-${CI_JOB_ID}.txt"
7+
RUN_SUFFIX="${GITHUB_RUN_NUMBER:-$RANDOM}-${RUNNER_OS:-linux}-${RANDOM}"
8+
TARGET_FILE="${COMMIT_SHA}-${RUN_SUFFIX}.txt"
89

910
echo "Running in ${CWD}"
1011
echo "Running with node: $(which node)"
@@ -105,7 +106,7 @@ kill_port "5000"
105106
echo "Tested local hosting emulator."
106107

107108
echo "Testing hosting deployment..."
108-
firebase hosting:channel:deploy --non-interactive --expires 1h --project "${FBTOOLS_TARGET_PROJECT}" --json "${GITHUB_RUN_NUMBER}" | tee channeldeploy.json
109+
firebase hosting:channel:deploy --non-interactive --expires 1h --project "${FBTOOLS_TARGET_PROJECT}" --json "channel-${RUN_SUFFIX}" | tee channeldeploy.json
109110
URL=$(cat channeldeploy.json | jq -r ".result.\"${FBTOOLS_TARGET_PROJECT}\".url")
110111
sleep 12
111112
VALUE="$(curl $URL/${TARGET_FILE})"
@@ -161,7 +162,7 @@ echo "Initialized second temp directory."
161162
# echo "Tested hosting deployment by target."
162163

163164
echo "Testing hosting channel deployment by target..."
164-
firebase hosting:channel:deploy "targetchannel-${GITHUB_RUN_NUMBER}" --only customtarget --project "${FBTOOLS_TARGET_PROJECT}" --non-interactive --json | tee output.json
165+
firebase hosting:channel:deploy "targetchannel-${RUN_SUFFIX}" --only customtarget --project "${FBTOOLS_TARGET_PROJECT}" --non-interactive --json | tee output.json
165166
CHANNEL_URL=$(cat output.json | jq -r ".result.customtarget.url")
166167
sleep 12
167168
VALUE="$(curl ${CHANNEL_URL}/${TARGET_FILE})"

scripts/storage-deploy-tests/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ CWD="$(pwd)"
44

55
source scripts/set-default-credentials.sh
66

7-
TARGET_FILE="${COMMIT_SHA}-${CI_JOB_ID}.txt"
7+
RUN_SUFFIX="${GITHUB_RUN_NUMBER:-$RANDOM}-${RUNNER_OS:-linux}-${RANDOM}"
8+
TARGET_FILE="${COMMIT_SHA}-${RUN_SUFFIX}.txt"
89

910
echo "Running in ${CWD}"
1011
echo "Running with node: $(which node)"

0 commit comments

Comments
 (0)