Skip to content

Commit 93028e4

Browse files
committed
Experiment with minikube QE run
1 parent 3140837 commit 93028e4

32 files changed

+235
-41
lines changed

.github/workflows/qe-minikube.yml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
name: QE Testing (Minikube)
3+
4+
on:
5+
pull_request:
6+
branches: [ main ]
7+
paths:
8+
- 'tests/**'
9+
- 'go.mod'
10+
- 'go.sum'
11+
- '.github/workflows/qe-ocp.yml'
12+
- '.github/workflows/qe-minikube.yml'
13+
workflow_dispatch:
14+
# Schedule a daily cron at midnight UTC
15+
schedule:
16+
- cron: '0 0 * * *'
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
20+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
21+
22+
env:
23+
TEST_REPO: redhat-best-practices-for-k8s/certsuite
24+
CERTSUITE_REF: main
25+
26+
jobs:
27+
# Build and store the certsuite binary
28+
build-and-store-binary:
29+
runs-on: ubuntu-24.04
30+
steps:
31+
- name: Check out code
32+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
33+
with:
34+
ref: ${{ github.sha }}
35+
36+
- name: Set up Go
37+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
38+
with:
39+
go-version-file: go.mod
40+
41+
- name: Clone the certsuite repository
42+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
43+
with:
44+
repository: ${{ env.TEST_REPO }}
45+
path: certsuite
46+
ref: ${{ env.CERTSUITE_REF }}
47+
48+
- name: Extract dependent Pull Requests
49+
uses: depends-on/depends-on-action@61cb3f4a0e2c8ae4b90c9448dc57c7ba9ca24c35 # main
50+
with:
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
extra-dirs: certsuite
53+
54+
- name: Build the certsuite binary
55+
run: make build-certsuite-tool
56+
working-directory: certsuite
57+
58+
- name: Upload certsuite binary as artifact
59+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
60+
with:
61+
name: certsuite-binary
62+
path: certsuite/certsuite
63+
retention-days: 1
64+
65+
qe-testing-minikube:
66+
needs: [build-and-store-binary]
67+
if: ${{ needs.build-and-store-binary.result == 'success' }}
68+
runs-on: ubuntu-24.04
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
suite: [accesscontrol, affiliatedcertification, manageability, networking, lifecycle, performance, platformalteration, observability, operator]
73+
env:
74+
SHELL: /bin/bash
75+
KUBECONFIG: '/home/runner/.kube/config'
76+
PFLT_DOCKERCONFIG: '/home/runner/.docker/config'
77+
TEST_CERTSUITE_IMAGE_NAME: quay.io/redhat-best-practices-for-k8s/certsuite
78+
TEST_CERTSUITE_IMAGE_TAG: localtest
79+
DOCKER_CONFIG_DIR: '/home/runner/.docker/'
80+
SKIP_PRELOAD_IMAGES: true # Not needed for github-hosted runs
81+
82+
steps:
83+
- name: Write temporary docker file
84+
run: |
85+
mkdir -p /home/runner/.docker
86+
touch ${PFLT_DOCKERCONFIG}
87+
echo '{ "auths": {} }' >> ${PFLT_DOCKERCONFIG}
88+
89+
- name: Check out code
90+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
91+
with:
92+
ref: ${{ github.sha }}
93+
94+
- name: Set up Go
95+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
96+
with:
97+
go-version-file: go.mod
98+
99+
- name: Disable default go problem matcher
100+
run: echo "::remove-matcher owner=go::"
101+
102+
- name: Check out `certsuite-sample-workload`
103+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
104+
with:
105+
repository: redhat-best-practices-for-k8s/certsuite-sample-workload
106+
path: certsuite-sample-workload
107+
108+
- name: Install dependencies
109+
run: |
110+
sudo apt-get update
111+
sudo apt-get install -y python3-pip
112+
113+
- name: Setup minikube k8s cluster
114+
uses: palmsoftware/[email protected]
115+
with:
116+
clusterProvider: minikube
117+
disableDefaultCni: true
118+
numControlPlaneNodes: 1
119+
numWorkerNodes: 2
120+
installOLM: true
121+
removeDefaultStorageClass: true
122+
removeControlPlaneTaint: true
123+
124+
- name: Install partner resources
125+
run: python3 -m venv .venv; source .venv/bin/activate; pip install --upgrade pip; pip install jinjanator; cp .venv/bin/jinjanate .venv/bin/j2; make install-for-qe
126+
working-directory: certsuite-sample-workload
127+
128+
- name: Show pods
129+
run: oc get pods -A
130+
131+
- name: Wait for all pods to be ready
132+
run: ./scripts/wait-for-all-pods-running.sh
133+
working-directory: certsuite-sample-workload
134+
timeout-minutes: 10
135+
136+
- name: Clone the certsuite repository
137+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
138+
with:
139+
repository: ${{ env.TEST_REPO }}
140+
path: certsuite
141+
ref: ${{ env.CERTSUITE_REF }}
142+
143+
- name: Extract dependent Pull Requests
144+
uses: depends-on/depends-on-action@61cb3f4a0e2c8ae4b90c9448dc57c7ba9ca24c35 # main
145+
with:
146+
token: ${{ secrets.GITHUB_TOKEN }}
147+
extra-dirs: certsuite-sample-workload certsuite
148+
149+
- name: Download pre-built certsuite binary
150+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
151+
with:
152+
name: certsuite-binary
153+
path: certsuite/
154+
155+
- name: Make binary executable
156+
run: chmod +x certsuite/certsuite
157+
158+
# Only run against the binary during a scheduled run
159+
- name: Run the tests (against binary)
160+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
161+
with:
162+
timeout_minutes: 150
163+
max_attempts: 3
164+
command: FEATURES=${{matrix.suite}} CERTSUITE_REPO_PATH=${GITHUB_WORKSPACE}/certsuite USE_BINARY=true DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true JOB_ID=${{github.run_id}} make test-features
165+
166+
check-all-dependencies-are-merged:
167+
runs-on: ubuntu-24.04
168+
steps:
169+
170+
- name: Extract dependent PR
171+
uses: depends-on/depends-on-action@61cb3f4a0e2c8ae4b90c9448dc57c7ba9ca24c35 # main
172+
with:
173+
token: ${{ secrets.GITHUB_TOKEN }}
174+
check-unmerged-pr: true
175+
176+
...
177+

tests/accesscontrol/tests/access_control_container_non-root_user_id.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var _ = Describe("Access-control non-root user,", func() {
3939

4040
// 56427
4141
It("one deployment, one pod, does not have securityContext RunAsUser 0", func() {
42-
if globalhelper.IsKindCluster() {
42+
if globalhelper.IsVanillaK8sCluster() {
4343
// This test case deploys a pod without any securityContext fields in both pod and container level. In OCP,
4444
// the most restrictive SecurityContextConstraint resource will be selected, making those fields to be automatically
4545
// set with the appropriate values. In kind clusters, there's no SCC so both fields will be kept as nil, which makes
@@ -106,7 +106,7 @@ var _ = Describe("Access-control non-root user,", func() {
106106

107107
// 56429
108108
It("two deployments, one pod each, does not have securityContext RunAsUser 0", func() {
109-
if globalhelper.IsKindCluster() {
109+
if globalhelper.IsVanillaK8sCluster() {
110110
// This test case deploys a pod without any securityContext fields in both pod and container level. In OCP,
111111
// the most restrictive SecurityContextConstraint resource will be selected, making those fields to be automatically
112112
// set with the appropriate values. In kind clusters, there's no SCC so both fields will be kept as nil, which makes

tests/accesscontrol/tests/access_control_crd_roles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var _ = Describe("access-control-crd-roles", Serial, func() {
1919
var randomCertsuiteConfigDir string
2020

2121
BeforeEach(func() {
22-
if globalhelper.IsKindCluster() {
22+
if globalhelper.IsVanillaK8sCluster() {
2323
By("Make masters schedulable")
2424
err := nodes.EnableMasterScheduling(globalhelper.GetAPIClient().K8sClient.CoreV1().Nodes(), true)
2525
Expect(err).ToNot(HaveOccurred())

tests/accesscontrol/tests/access_control_security_context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var _ = Describe("Access-control security-context,", func() {
4040

4141
// 63736
4242
It("one deployment, one pod, one container, has allowed security context", func() {
43-
if globalhelper.IsKindCluster() {
43+
if globalhelper.IsVanillaK8sCluster() {
4444
Skip("Skip on kind cluster")
4545
}
4646

@@ -102,7 +102,7 @@ var _ = Describe("Access-control security-context,", func() {
102102

103103
// 63738
104104
It("two deployments, one pod each, one container each, both have allowed security context", func() {
105-
if globalhelper.IsKindCluster() {
105+
if globalhelper.IsVanillaK8sCluster() {
106106
Skip("Skip on kind cluster")
107107
}
108108

tests/accesscontrol/tests/access_control_sys_nice_capability_check.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var _ = Describe("Access-control sys-nice_capability", Ordered, Serial, Label("r
4747
}
4848

4949
// Skip all if running in a kind cluster
50-
if globalhelper.IsKindCluster() {
50+
if globalhelper.IsVanillaK8sCluster() {
5151
skipTestSuite = true
5252
Skip("Kind cluster detected")
5353
}
@@ -449,7 +449,7 @@ var _ = Describe("Access-control sys-nice_capability check, non-realtime kernel"
449449

450450
pod := &podList.Items[0]
451451
By("Ensure pod " + pod.Name + " has not added SYS_NICE cap")
452-
if globalhelper.IsKindCluster() {
452+
if globalhelper.IsVanillaK8sCluster() {
453453
Expect(pod.Spec.Containers[0].SecurityContext).To(BeNil())
454454
Expect(pod.Spec.Containers[1].SecurityContext).To(BeNil())
455455
} else {
@@ -459,7 +459,7 @@ var _ = Describe("Access-control sys-nice_capability check, non-realtime kernel"
459459

460460
pod = &podList.Items[1]
461461
By("Ensure pod " + pod.Name + " has not added SYS_NICE cap")
462-
if globalhelper.IsKindCluster() {
462+
if globalhelper.IsVanillaK8sCluster() {
463463
Expect(pod.Spec.Containers[0].SecurityContext).To(BeNil())
464464
Expect(pod.Spec.Containers[1].SecurityContext).To(BeNil())
465465
} else {

tests/affiliatedcertification/affiliated_certification_suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var isCloudCasaAlreadyLabeled bool
3737

3838
var _ = SynchronizedBeforeSuite(func() {
3939

40-
if !globalhelper.IsKindCluster() {
40+
if !globalhelper.IsVanillaK8sCluster() {
4141
// Always install Helm v3 right before running the suite
4242
By("Install helm v3")
4343
cmd := exec.Command("/bin/bash", "-c",
@@ -88,7 +88,7 @@ var _ = SynchronizedBeforeSuite(func() {
8888
Expect(err).ToNot(HaveOccurred())
8989
}
9090

91-
if !globalhelper.IsKindCluster() {
91+
if !globalhelper.IsVanillaK8sCluster() {
9292
By("Ensure openshift-marketplace namespace exists")
9393
err = globalhelper.CreateNamespace("openshift-marketplace")
9494
Expect(err).ToNot(HaveOccurred())

tests/affiliatedcertification/tests/affiliated_certification_container_is_certified_digest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var _ = Describe("Affiliated-certification container-is-certified-digest,", Seri
1919
var randomCertsuiteConfigDir string
2020

2121
BeforeEach(func() {
22-
if globalhelper.IsKindCluster() {
22+
if globalhelper.IsVanillaK8sCluster() {
2323
Skip("Skip test due to image pull missing credentials in Kind")
2424
}
2525

tests/affiliatedcertification/tests/affiliated_certification_helm_version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var _ = Describe("Affiliated-certification helm-version,", Serial, func() {
1616
var randomCertsuiteConfigDir string
1717

1818
BeforeEach(func() {
19-
if globalhelper.IsKindCluster() {
19+
if globalhelper.IsVanillaK8sCluster() {
2020
Skip("Skipping helm version test on Kind cluster")
2121
}
2222

tests/affiliatedcertification/tests/affiliated_certification_operator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var _ = Describe("Affiliated-certification operator certification,", Serial, fun
3232
tsparams.TestCertificationNameSpace)
3333

3434
// If Kind cluster, skip.
35-
if globalhelper.IsKindCluster() {
35+
if globalhelper.IsVanillaK8sCluster() {
3636
Skip("This test is not supported on Kind cluster")
3737
}
3838

tests/affiliatedcertification/tests/affillated_certification_helm_chart.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var _ = Describe("Affiliated-certification helm chart certification,", Serial, f
1717
var randomCertsuiteConfigDir string
1818

1919
BeforeEach(func() {
20-
if globalhelper.IsKindCluster() {
20+
if globalhelper.IsVanillaK8sCluster() {
2121
Skip("Skipping helm chart test on Kind cluster")
2222
}
2323

0 commit comments

Comments
 (0)