Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions .github/workflows/e2e-repo-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,45 @@ on:
paths:
- "cypress/**"
- ".github/workflows/e2e*.yaml"
- ".github/actions/**"

concurrency:
group: e2e-repo-main-${{ github.ref }}
cancel-in-progress: true

jobs:
extract-test-tags:
runs-on: ubuntu-latest
outputs:
test_tags: ${{ steps.extract.outputs.test_tags }}
steps:
- name: Extract test tags from PR body
id: extract
env:
PR_BODY: ${{ github.event.pull_request.body }}
DEFAULT_TAGS: "@ci,@tier0"
run: |
if [[ -n "$PR_BODY" ]]; then
# Look for pattern "ci test tags: @tag1,@tag2,..." in PR body
EXTRACTED=$(echo "$PR_BODY" | grep -oP '^ci test tags: \K@.+(,@.+)*$' || true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion :

This regex Match "ci test tags:" anywhere in the body (case-insensitive) and Remove spaces → allow "@ci, @tier0"

EXTRACTED=$(echo "$PR_BODY" | grep -ioP 'ci test tags:\s*\K@.*' || true)

EXTRACTED=$(echo "$EXTRACTED" | tr -d ' ')

if [[ -n "$EXTRACTED" ]]; then
echo "Found test tags in PR body: $EXTRACTED"
echo "test_tags=$EXTRACTED" >> "$GITHUB_OUTPUT"
else
echo "No test tags pattern found in PR body, using default: $DEFAULT_TAGS"
echo "test_tags=$DEFAULT_TAGS" >> "$GITHUB_OUTPUT"
fi
else
echo "No PR body available (not a pull request or body is empty), using default: $DEFAULT_TAGS"
echo "test_tags=$DEFAULT_TAGS" >> "$GITHUB_OUTPUT"
fi

e2e-tests:
needs: extract-test-tags
uses: ./.github/workflows/e2e-run-ui-tests.yaml
with:
test_tags: "@ci,@tier0"
feature_auth_required: false
test_tags: ${{ needs.extract-test-tags.outputs.test_tags }}
feature_auth_required: true
bundle_image: quay.io/konveyor/tackle2-operator-bundle:latest
install_konveyor_version: ${{ github.base_ref || github.ref_name }}
install_konveyor_version: main
test_ref: ${{ github.event.pull_request.head.sha || github.sha }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like GitHub Actions expression language does not support || . This line will silently resolve incorrectly.

This might help :

test_ref: ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, the test_ref did get resolved correctly for this PR. For a PR, it should resolve to the sha of the HEAD commit.

I haven't run the workflow directly against a branch yet. Not sure I can do that while it is still only in a PR.

8 changes: 4 additions & 4 deletions .github/workflows/e2e-run-ui-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ jobs:
-n konveyor-tackle \
ingress/tackle \
--timeout=600s \
--for=jsonpath='{.status.loadBalancer.ingress[0]}'
--for=jsonpath='{.status.loadBalancer.ingress[0].ip}'

minikube_ip=$(minikube ip)
echo "ingress is ready at: ${minikube_ip}"
echo "UI_URL=https://${minikube_ip}" >>$GITHUB_ENV
ingress_ip=$(kubectl get ingress/tackle -n konveyor-tackle -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "ingress is ready at: ${ingress_ip}"
echo "UI_URL=https://${ingress_ip}" >>$GITHUB_ENV

- name: "Checkout the repo (ref: ${{ inputs.test_ref }})"
uses: actions/checkout@v4
Expand Down
Loading