Skip to content

Commit ef2bd86

Browse files
committed
tests: use the tfaga wrapper in the testing actions
1 parent bc215c8 commit ef2bd86

File tree

2 files changed

+20
-166
lines changed

2 files changed

+20
-166
lines changed

.github/workflows/container-tests.yml

Lines changed: 8 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -49,105 +49,24 @@ jobs:
4949
fi
5050
container-tests:
5151
needs: distgen-check
52-
# This job only runs for '[test]' pull request comments by owner, member
5352
runs-on: ubuntu-20.04
54-
name: "Container tests: ${{ matrix.version }} - ${{ matrix.context }}"
53+
name: "Container tests: ${{ matrix.version }} - ${{ matrix.os_test }}"
5554
strategy:
5655
fail-fast: false
5756
matrix:
5857
version: [ "10", "11", "12", "13", "14", "15" ]
5958
os_test: [ "fedora", "centos7", "rhel7", "rhel8", "rhel9", "c9s", "c8s"]
60-
include:
61-
- tmt_plan: "fedora"
62-
os_test: "fedora"
63-
context: "Fedora"
64-
compose: "Fedora-latest"
65-
api_key: "TF_PUBLIC_API_KEY"
66-
branch: "main"
67-
tmt_repo: "https://github.com/sclorg/sclorg-testing-farm"
68-
- tmt_plan: "centos7"
69-
os_test: "centos7"
70-
context: "CentOS7"
71-
compose: "CentOS-7"
72-
api_key: "TF_PUBLIC_API_KEY"
73-
branch: "main"
74-
tmt_repo: "https://github.com/sclorg/sclorg-testing-farm"
75-
- tmt_plan: "rhel7-docker"
76-
os_test: "rhel7"
77-
context: "RHEL7"
78-
compose: "RHEL-7-LatestUpdated"
79-
api_key: "TF_INTERNAL_API_KEY"
80-
branch: "master"
81-
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
82-
tf_scope: "private"
83-
- tmt_plan: "rhel8-docker"
84-
os_test: "rhel8"
85-
context: "RHEL8"
86-
compose: "RHEL-8.6.0-Nightly"
87-
api_key: "TF_INTERNAL_API_KEY"
88-
branch: "master"
89-
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
90-
tf_scope: "private"
91-
- tmt_plan: "rhel9-docker"
92-
os_test: "rhel9"
93-
context: "RHEL9"
94-
compose: "RHEL-9.1.0-Nightly"
95-
api_key: "TF_INTERNAL_API_KEY"
96-
branch: "master"
97-
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
98-
tf_scope: "private"
99-
- tmt_plan: "c9s"
100-
os_test: "c9s"
101-
context: "CentOS Stream 9"
102-
compose: "CentOS-Stream-9"
103-
api_key: "TF_PUBLIC_API_KEY"
104-
branch: "main"
105-
tmt_repo: "https://github.com/sclorg/sclorg-testing-farm"
106-
- tmt_plan: "c8s"
107-
os_test: "c8s"
108-
context: "CentOS Stream 8"
109-
compose: "CentOS-Stream-8"
110-
api_key: "TF_PUBLIC_API_KEY"
111-
branch: "main"
112-
tmt_repo: "https://github.com/sclorg/sclorg-testing-farm"
59+
test_case: [ "container" ]
11360

11461
if: |
11562
github.event.issue.pull_request
11663
&& (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]'))
11764
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)
11865
steps:
119-
- name: Checkout repo
120-
uses: actions/checkout@v2
121-
with:
122-
ref: "refs/pull/${{ github.event.issue.number }}/head"
123-
124-
- name: Prepare needed variables
125-
shell: bash
126-
id: vars
127-
run: |
128-
dockerfile="Dockerfile.${{ matrix.os_test }}"
129-
if [[ ${{ matrix.os_test }} == "centos7" ]]; then
130-
dockerfile="Dockerfile"
131-
fi
132-
echo "::set-output name=DOCKERFILE_NAME::${dockerfile}"
133-
134-
- name: Check that ${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }} is present
135-
id: check_dockerfile
136-
uses: andstor/file-existence-action@v1
137-
with:
138-
files: "${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }}"
139-
140-
# https://github.com/sclorg/testing-farm-as-github-action
141-
- name: Schedule tests for ${{ matrix.version }} - ${{ matrix.context }}
142-
id: github_action
143-
if: steps.check_dockerfile.outputs.files_exists == 'true'
144-
uses: sclorg/testing-farm-as-github-action@v1
66+
- uses: sclorg/tfaga-wrapper@main
14567
with:
146-
api_key: ${{ secrets[matrix.api_key] }}
147-
git_url: ${{ matrix.tmt_repo }}
148-
git_ref: ${{ matrix.branch }}
149-
tf_scope: ${{ matrix.tf_scope }}
150-
tmt_plan_regex: ${{ matrix.tmt_plan }}
151-
pull_request_status_name: "${{ matrix.context }} - ${{ matrix.version }}"
152-
variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};SINGLE_VERSION=${{ matrix.version }};OS=${{ matrix.os_test }};TEST_NAME=test"
153-
compose: ${{ matrix.compose }}
68+
os_test: ${{ matrix.os_test }}
69+
version: ${{ matrix.version }}
70+
test_case: ${{ matrix.test_case }}
71+
public_api_key: ${{ secrets.TF_PUBLIC_API_KEY }}
72+
private_api_key: ${{ secrets.TF_INTERNAL_API_KEY }}

.github/workflows/openshift-tests.yml

Lines changed: 12 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -29,96 +29,31 @@ jobs:
2929
openshift-tests:
3030
needs: distgen-check
3131
# This job only runs for '[test-all]' or '[test-openshift] pull request comments by owner, member
32-
name: "OpenShift tests: ${{ matrix.version }} - ${{ matrix.context }}"
32+
name: "${{ matrix.test_case }} tests: ${{ matrix.version }} - ${{ matrix.os_test }}"
3333
runs-on: ubuntu-20.04
3434
strategy:
3535
fail-fast: false
3636
matrix:
3737
version: [ "10", "11", "12", "13", "15" ]
3838
os_test: [ "centos7", "rhel7", "rhel8", "rhel9"]
39-
include:
40-
- tmt_plan: "centos7"
39+
test_case: [ "openshift-3", "openshift-4" ]
40+
exclude:
41+
- test_case: "openshift-4"
4142
os_test: "centos7"
42-
context: "CentOS7 - OpenShift 3"
43-
api_key: "TF_PUBLIC_API_KEY"
44-
branch: "main"
45-
tmt_repo: "https://github.com/sclorg/sclorg-testing-farm"
46-
compose: "CentOS-7"
47-
test_name: "test-openshift"
48-
- tmt_plan: "rhel7-openshift-3"
49-
os_test: "rhel7"
50-
context: "RHEL7 - OpenShift 3"
51-
compose: "RHEL-7-LatestUpdated"
52-
api_key: "TF_INTERNAL_API_KEY"
53-
branch: "master"
54-
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
55-
test_name: "test-openshift"
56-
tf_scope: "private"
57-
- tmt_plan: "rhel7-openshift-4"
58-
os_test: "rhel7"
59-
context: "RHEL7 - OpenShift 4"
60-
compose: "RHEL-7-LatestUpdated"
61-
test_name: "test-openshift-4"
62-
api_key: "TF_INTERNAL_API_KEY"
63-
branch: "master"
64-
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
65-
tf_scope: "private"
66-
- tmt_plan: "rhel8-openshift-4"
43+
- test_case: "openshift-3"
6744
os_test: "rhel8"
68-
context: "RHEL8 - OpenShift 4"
69-
compose: "RHEL-8.6.0-Nightly"
70-
test_name: "test-openshift-4"
71-
api_key: "TF_INTERNAL_API_KEY"
72-
branch: "master"
73-
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
74-
tf_scope: "private"
75-
- tmt_plan: "rhel9-openshift-4"
45+
- test_case: "openshift-3"
7646
os_test: "rhel9"
77-
context: "RHEL9 - OpenShift 4"
78-
compose: "RHEL-9.1.0-Nightly"
79-
test_name: "test-openshift-4"
80-
api_key: "TF_INTERNAL_API_KEY"
81-
branch: "master"
82-
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
83-
tf_scope: "private"
8447

8548
if: |
8649
github.event.issue.pull_request
8750
&& (contains(github.event.comment.body, '[test-openshift]') || contains(github.event.comment.body, '[test-all]'))
8851
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)
8952
steps:
90-
- name: Checkout repo
91-
uses: actions/checkout@v2
92-
with:
93-
ref: "refs/pull/${{ github.event.issue.number }}/head"
94-
95-
- name: Prepare needed variables
96-
shell: bash
97-
id: vars
98-
run: |
99-
dockerfile="Dockerfile.${{ matrix.os_test }}"
100-
if [[ ${{ matrix.os_test }} == "centos7" ]]; then
101-
dockerfile="Dockerfile"
102-
fi
103-
echo "::set-output name=DOCKERFILE_NAME::${dockerfile}"
104-
105-
- name: Check that ${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }} is present
106-
id: check_dockerfile
107-
uses: andstor/file-existence-action@v1
108-
with:
109-
files: "${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }}"
110-
111-
# https://github.com/sclorg/testing-farm-as-github-action
112-
- name: Schedule tests for ${{ matrix.version }} - ${{ matrix.context }}
113-
id: github_action
114-
if: steps.check_dockerfile.outputs.files_exists == 'true'
115-
uses: sclorg/testing-farm-as-github-action@v1
53+
- uses: sclorg/tfaga-wrapper@main
11654
with:
117-
api_key: ${{ secrets[matrix.api_key] }}
118-
git_url: ${{ matrix.tmt_repo }}
119-
git_ref: ${{ matrix.branch }}
120-
tf_scope: ${{ matrix.tf_scope }}
121-
tmt_plan_regex: ${{ matrix.tmt_plan }}
122-
pull_request_status_name: "${{ matrix.context }} - ${{ matrix.version }}"
123-
variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};SINGLE_VERSION=${{ matrix.version }};OS=${{ matrix.os_test }};TEST_NAME=${{ matrix.test_name }}"
124-
compose: ${{ matrix.compose }}
55+
os_test: ${{ matrix.os_test }}
56+
version: ${{ matrix.version }}
57+
test_case: ${{ matrix.test_case }}
58+
public_api_key: ${{ secrets.TF_PUBLIC_API_KEY }}
59+
private_api_key: ${{ secrets.TF_INTERNAL_API_KEY }}

0 commit comments

Comments
 (0)