Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run integration tests on konflux built images #1691

Merged
merged 2 commits into from
Jun 4, 2024
Merged
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
25 changes: 22 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ on:
Optional repository to use for the collector image
type: string
default: "quay.io/rhacs-eng/collector"
is-konflux:
Stringy marked this conversation as resolved.
Show resolved Hide resolved
description: |
Marker for workflows triggered for a konflux build.
These builds don't support multiarch, so it should only run x86
tests
type: boolean
default: false

jobs:
amd64-required-integration-tests:
Expand Down Expand Up @@ -70,7 +77,11 @@ jobs:

arm64-integration-tests:
uses: ./.github/workflows/integration-tests-vm-type.yml
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds')
if: |
!inputs.is-konflux && (
github.event_name == 'push' ||
contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds')
)
strategy:
# ensure that if one part of the matrix fails, the
# rest will continue
Expand All @@ -92,7 +103,11 @@ jobs:

s390x-integration-tests:
uses: ./.github/workflows/integration-tests-vm-type.yml
if: contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') || github.event_name == 'push'
if: |
!inputs.is-konflux && (
github.event_name == 'push' ||
contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds')
)
with:
vm_type: rhel-s390x
collector-tag: ${{ inputs.collector-tag }}
Expand All @@ -103,7 +118,11 @@ jobs:

ppc64le-integration-tests:
uses: ./.github/workflows/integration-tests-vm-type.yml
if: contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') || github.event_name == 'push'
if: |
!inputs.is-konflux && (
github.event_name == 'push' ||
contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds')
)
with:
vm_type: rhel-ppc64le
collector-tag: ${{ inputs.collector-tag }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/k8s-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
env:
ANSIBLE_CONFIG: ${{ github.workspace }}/ansible/ansible.cfg
COLLECTOR_TESTS_IMAGE: quay.io/rhacs-eng/qa-multi-arch:collector-tests-${{ inputs.collector-tag }}
COLLECTOR_IMAGE: quay.io/stackrox-io/collector:${{ inputs.collector-tag }}
COLLECTOR_IMAGE: quay.io/rhacs-eng/collector:${{ inputs.collector-tag }}

jobs:
k8s-integration-tests:
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/konflux-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Run konflux tests

on:
workflow_call:

jobs:
init:
runs-on: ubuntu-latest
outputs:
collector-tag: ${{ steps.generate-tag.outputs.collector-tag }}
collector-qa-tag: ${{ steps.generate-tag.outputs.collector-qa-tag }}
rebuild-qa-containers: ${{ steps.filter.outputs.container }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
submodules: true
fetch-depth: 0

- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell

# Only trigger a rebuild when the QA tag has changed
filters: |
container:
- integration-tests/container/QA_TAG

- id: generate-tag
run: |
echo "collector-tag=$(make tag)-fast" >> "$GITHUB_OUTPUT"

COLLECTOR_QA_TAG="$(cat ${{ github.workspace }}/integration-tests/container/QA_TAG)"
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" && "${{ steps.filter.outputs.container }}" == "true" ]]; then
COLLECTOR_QA_TAG="${COLLECTOR_QA_TAG}-${COLLECTOR_TAG}"
fi

echo "collector-qa-tag=${COLLECTOR_QA_TAG}" >> "$GITHUB_OUTPUT"

wait-for-images:
runs-on: ubuntu-latest
needs:
- init
steps:
- uses: stackrox/actions/release/wait-for-image@v1
with:
token: ${{ secrets.QUAY_RHACS_ENG_BEARER_TOKEN }}
image: rhacs-eng/collector:${{ needs.init.outputs.collector-tag }}

integration-tests-containers:
uses: ./.github/workflows/integration-test-containers.yml
needs:
- init
with:
collector-tag: ${{ needs.init.outputs.collector-tag }}
collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }}
rebuild-qa-containers: ${{ needs.init.outputs.rebuild-qa-containers == 'true' }}
secrets: inherit

run-konflux-tests:
uses: ./.github/workflows/integration-tests.yml
needs:
- init
- wait-for-images
- integration-tests-containers
with:
collector-tag: ${{ needs.init.outputs.collector-tag }}
collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }}
is-konflux: true
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') }}
secrets: inherit

k8s-integration-tests:
uses: ./.github/workflows/k8s-integration-tests.yml
with:
collector-tag: ${{ needs.init.outputs.collector-tag }}
collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }}
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') }}
needs:
- init
- wait-for-images
- integration-tests-containers
secrets: inherit

29 changes: 29 additions & 0 deletions .github/workflows/konflux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Run konflux workflows

on:
push:
branches:
- master
- release-*
tags:
- 3.*.*
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- reopened

concurrency:
group: ${{ github.head_ref || github.run_id }}-konflux
cancel-in-progress: true

jobs:
run-tests:
uses: ./.github/workflows/konflux-tests.yml
if: github.event_name == 'push' ||
contains(github.head_ref, 'konflux') ||
contains(github.head_ref, 'rhtap')
secrets: inherit

Loading