Skip to content

Commit

Permalink
[NALA][MWPW-168075] Purge cache before running NALA tests on PR (#3698)
Browse files Browse the repository at this point in the history
* add branch purgining before test run

* update the pr.sh

* add 10 sec wait to purge completion

* added wait time

---------

Co-authored-by: Santoshkumar Sharanappa Nateekar <[email protected]>
  • Loading branch information
skumar09 and Santoshkumar Sharanappa Nateekar authored Feb 20, 2025
1 parent fd32858 commit cf2560e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/run-nala-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
- stage
- main
types: [opened, synchronize, reopened]

workflow_dispatch:

jobs:
run-nala-tests:
Expand Down
17 changes: 17 additions & 0 deletions nala/utils/pr.run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,23 @@ export PR_NUMBER

echo "PR Branch live URL: $PR_BRANCH_LIVE_URL_GH"

# Purge the PR branch before running tests
echo "Purging branch: $FEATURE_BRANCH"
PURGE_URL="https://admin.hlx.page/code/$prOrg/$prRepo/$FEATURE_BRANCH/*"

echo "Executing: curl -si -X POST \"$PURGE_URL\""
PURGE_RESPONSE=$(curl -si -X POST "$PURGE_URL")

echo "Waiting 10 seconds for purge to complete..."
sleep 10

# Check if the purge was successful
if echo "$PURGE_RESPONSE" | grep -q "202"; then
echo "Branch $FEATURE_BRANCH successfully purged"
else
echo "Failed to purge branch $FEATURE_BRANCH"
echo "Response: $PURGE_RESPONSE"
fi

# Convert GitHub Tag(@) labels that can be grepped
for label in ${labels}; do
Expand Down

0 comments on commit cf2560e

Please sign in to comment.