Skip to content

Commit b1472d0

Browse files
committed
Run E2E tests if proxy deployed
1 parent 406aeea commit b1472d0

2 files changed

Lines changed: 32 additions & 3 deletions

File tree

.github/actions/acceptance-tests/action.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,36 @@ runs:
4444
run: |
4545
echo "PR_NUMBER=${{ inputs.targetEnvironment }}" >> $GITHUB_ENV
4646
47-
- name: Run test - ${{ inputs.testType }}
47+
- name: Run component tests
4848
shell: bash
4949
run: |
50-
make test-${{ inputs.testType }}
50+
make test-component
51+
52+
- name: Check if e2e tests should run
53+
id: check_e2e
54+
shell: bash
55+
env:
56+
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
57+
run: |
58+
# Extract PR number from environment name (e.g., pr123 -> 123)
59+
if [[ "${{ inputs.targetEnvironment }}" =~ ^pr([0-9]+)$ ]]; then
60+
pr_number="${BASH_REMATCH[1]}"
61+
labels=$(gh pr view "$pr_number" --json labels --jq '.labels[].name' 2>/dev/null || echo "")
62+
63+
if echo "$labels" | grep -Fxq 'deploy-proxy'; then
64+
echo "deploy-proxy label found; e2e tests will run."
65+
echo "run_e2e=true" >> $GITHUB_OUTPUT
66+
else
67+
echo "deploy-proxy label not found; e2e tests will be skipped."
68+
echo "run_e2e=false" >> $GITHUB_OUTPUT
69+
fi
70+
else
71+
echo "Not a PR environment; e2e tests will run."
72+
echo "run_e2e=true" >> $GITHUB_OUTPUT
73+
fi
74+
75+
- name: Run e2e tests
76+
if: steps.check_e2e.outputs.run_e2e == 'true'
77+
shell: bash
78+
run: |
79+
make .internal-dev-test

.github/actions/test-types.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[
2-
"component"
2+
"acceptance"
33
]

0 commit comments

Comments
 (0)