Skip to content

Commit

Permalink
Merge branch 'main' into qe-op-installation
Browse files Browse the repository at this point in the history
  • Loading branch information
bnshr committed Feb 18, 2025
2 parents 9952f06 + b3c3f67 commit e833abf
Show file tree
Hide file tree
Showing 16 changed files with 1,013 additions and 1,019 deletions.
14 changes: 12 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
groups:
dev-dependencies:
dependency-type: "development"
prod-dependencies:
dependency-type: "production"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
groups:
dev-dependencies:
dependency-type: "development"
prod-dependencies:
dependency-type: "production"
31 changes: 17 additions & 14 deletions .github/workflows/pre-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Go 1.23
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
- name: Set up Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: 1.23.6
go-version-file: go.mod

- uses: nosborn/github-action-markdown-cli@9b5e871c11cc0649c5ac2526af22e23525fa344d # v3.3.0
- uses: nosborn/github-action-markdown-cli@58bcfd1af530d87a13d51b76e6713b52602e3613 # v3.4.0
with:
files: README.md

- uses: ludeeus/action-shellcheck@00b27aa7cb85167568cb48a3838b75f4265f2bca # master
with:
ignore_paths: vendor
- uses: mfinelli/setup-shfmt@031e887e39d899d773a7e9b6dd6472c2c23ff50d # v3.0.1
- uses: mfinelli/setup-shfmt@1a143389339b48c4b48ae3cdc058f3dbe336a701 # v3.0.2
- run: shfmt -d scripts/*.sh
- uses: crate-ci/typos@9d890159570d5018df91fedfa40b4730cd4a81b1 # master
- uses: crate-ci/typos@51f257b946f503b768e522781f56e9b7b5570d48 # master
- uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1
with:
file_or_dir: .github/workflows/*.yml config/*.yaml
Expand All @@ -45,19 +45,22 @@ jobs:
empty-lines:
level: warning
- name: Run lint
run: make lint
- name: Golangci-lint
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.4.1
with:
version: v1.64
args: --timeout 10m0s

build:
runs-on: ubuntu-22.04
env:
SHELL: /bin/bash
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Go 1.23
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
- name: Set up Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: 1.23.6
go-version-file: go.mod

- name: Install ginkgo
run: make install-ginkgo
Expand All @@ -73,10 +76,10 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Go 1.23
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
- name: Set up Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: 1.23.6
go-version-file: go.mod

- name: Checkout the certsuite repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
61 changes: 21 additions & 40 deletions .github/workflows/qe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ jobs:
touch ${PFLT_DOCKERCONFIG}
echo '{ "auths": {} }' >> ${PFLT_DOCKERCONFIG}
- name: Set up Go 1.23
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: 1.23.6

- name: Disable default go problem matcher
run: echo "::remove-matcher owner=go::"

- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.sha }}

- name: Set up Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod

- name: Disable default go problem matcher
run: echo "::remove-matcher owner=go::"

- name: Check out `certsuite-sample-workload`
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -59,34 +59,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y python3-pip
- name: Create docker/daemon.json if it does not exist
run: |
if [ ! -f /etc/docker/daemon.json ]; then
echo '{}' | sudo tee /etc/docker/daemon.json
fi
# Create a Kind cluster for testing.
- name: Bootstrap the Kind and OC/Kubectl binaries for the `local-test-infra`
run: make bootstrap-cluster
working-directory: certsuite-sample-workload

# Restart docker using /mnt/docker-storage (sdb) instead of /var/lib/docker (sda).
# This step needs to be done right after the partner repo's bootstrap scripts, as they
# overwrite the docker's daemon.json.
- name: Make docker to use /mnt (sdb) for storage
run: |
df -h
lsblk
sudo mkdir /mnt/docker-storage
sudo jq '. +={"data-root" : "/mnt/docker-storage"}' < /etc/docker/daemon.json > /tmp/docker-daemon.json
sudo cp /tmp/docker-daemon.json /etc/docker/daemon.json
cat /etc/docker/daemon.json
sudo systemctl restart docker
sudo ls -la /mnt/docker-storage
- name: Create `local-test-infra` OpenShift resources
run: make rebuild-cluster
working-directory: certsuite-sample-workload
- name: Setup up k8s cluster
uses: palmsoftware/[email protected]
with:
disableDefaultCni: true
numControlPlaneNodes: 1
numWorkerNodes: 2
installOLM: true
removeDefaultStorageClass: true
removeControlPlaneTaint: true

- name: Install partner resources
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
Expand All @@ -108,13 +89,13 @@ jobs:
ref: main

- name: Extract dependent Pull Requests
uses: depends-on/depends-on-action@77e67971a155b35424508ada365790c47286fd0f # main
uses: depends-on/depends-on-action@61cb3f4a0e2c8ae4b90c9448dc57c7ba9ca24c35 # main
with:
token: ${{ secrets.GITHUB_TOKEN }}
extra-dirs: certsuite-sample-workload certsuite

- name: Run the tests (against image)
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
uses: nick-fields/retry@c97818ca39074beaea45180dba704f92496a0082 # v3.0.1
with:
timeout_minutes: 60
max_attempts: 3
Expand All @@ -126,7 +107,7 @@ jobs:
working-directory: certsuite

- name: Run the tests (against binary)
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
uses: nick-fields/retry@c97818ca39074beaea45180dba704f92496a0082 # v3.0.1
with:
timeout_minutes: 60
max_attempts: 3
Expand All @@ -137,7 +118,7 @@ jobs:
steps:

- name: Extract dependent PR
uses: depends-on/depends-on-action@77e67971a155b35424508ada365790c47286fd0f # main
uses: depends-on/depends-on-action@61cb3f4a0e2c8ae4b90c9448dc57c7ba9ca24c35 # main
with:
token: ${{ secrets.GITHUB_TOKEN }}
check-unmerged-pr: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: SARIF file
path: results.sarif
Expand All @@ -68,6 +68,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
with:
sarif_file: results.sarif
14 changes: 4 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
run:
go: "1.23"
timeout: 15m0s
skip-dirs-use-default: true
fast: false
go: "1.24"
timeout: 15m

linters-settings:
whitespace:
allow-assign-and-range: true
revive:
rules:
- name: indent-error-flow
Expand All @@ -21,9 +21,6 @@ linters-settings:
funlen:
lines: 175
statements: 85
unused:
check-exported: true
go: "1.23"
stylecheck:
dot-import-whitelist:
- github.com/onsi/gomega
Expand Down Expand Up @@ -84,9 +81,6 @@ linters:
- wastedassign
- wsl
- nlreturn

output:
formats: colored-line-number
issues:
max-issues-per-linter: 0
max-same-issues: 0
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ The tests are run on the OCP cluster with certain requirements that are listed b

| | Conditions | Mandatory |
| ------ | ------ | ------ |
| OCP Cluster | Version: >= 4.12, Node Count >= 3 with 2 cnf-worker nodes | Yes
| Installed Operators | Performance Addon, Machine-config-operator | Yes
| | Machine config pool, PTP operator, SR-IOV operator| No
| OCP Cluster | Version: >= 4.12, Node Count >= 3 with 2 cnf-worker nodes | Yes |
| Installed Operators | Performance Addon, Machine-config-operator | Yes |
| | Machine config pool, PTP operator, SR-IOV operator| No |

> Bare-minimum requirements consists of a OCP cluster with 3 nodes where 2 are cnf-worker nodes and 1 worker node.
Expand All @@ -52,19 +52,20 @@ Choose the variant that suits you best:
### Environment variables

The following environment variables are used to configure the test setup.

| Env Variable Name | Purpose |
| ------ | ------ |
| FEATURES | To select the test scenarios that you are going to test, comma separated
| CERTSUITE_REPO_PATH | Points to the absolute path to [certsuite](https://github.com/redhat-best-practices-for-k8s/certsuite) on your machine
| CERTSUITE_IMAGE | Links to the Certsuite image. Default is quay.io/redhat-best-practices-for-k8s/certsuite
| CERTSUITE_IMAGE_TAG | image tag that is going to be tested. Default is latest
| TEST_IMAGE | Test image that is going to be used for all test resources such as deployments, daemonsets and so on. Default is quay.io/testnetworkfunction/k8s-best-practices-debug
| DEBUG_CERTSUITE | Generate `Debug` folder that will contain Certsuite suites folders with Certsuite logs for each test.
| CERTSUITE_LOG_LEVEL | Log level. Default is 4
| DISABLE_INTRUSIVE_TESTS | Turns off the intrusive tests for faster execution. Default is `false`.
| ENABLE_PARALLEL | Enable ginkgo -p parallel flags (experimental). Default is `false`.
| FORCE_DOWNLOAD_UNSTABLE | Force download the unstable image. Default is `false`.
| NON_LINUX_ENV | Allow the test suites to run in a non Linux environment. Default is `false`.
| FEATURES | To select the test scenarios that you are going to test, comma separated |
| CERTSUITE_REPO_PATH | Points to the absolute path to [certsuite](https://github.com/redhat-best-practices-for-k8s/certsuite) on your machine |
| CERTSUITE_IMAGE | Links to the Certsuite image. Default is quay.io/redhat-best-practices-for-k8s/certsuite |
| CERTSUITE_IMAGE_TAG | image tag that is going to be tested. Default is latest |
| TEST_IMAGE | Test image that is going to be used for all test resources such as deployments, daemonsets and so on. Default is quay.io/testnetworkfunction/k8s-best-practices-debug |
| DEBUG_CERTSUITE | Generate `Debug` folder that will contain Certsuite suites folders with Certsuite logs for each test. |
| CERTSUITE_LOG_LEVEL | Log level. Default is 4 |
| DISABLE_INTRUSIVE_TESTS | Turns off the intrusive tests for faster execution. Default is `false`. |
| ENABLE_PARALLEL | Enable ginkgo -p parallel flags (experimental). Default is `false`. |
| FORCE_DOWNLOAD_UNSTABLE | Force download the unstable image. Default is `false`. |
| NON_LINUX_ENV | Allow the test suites to run in a non Linux environment. Default is `false`. |

## Steps to run the tests

Expand Down
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/redhat-best-practices-for-k8s/certsuite-qe

go 1.23.6
go 1.24.0

require (
github.com/golang/glog v1.2.4
Expand All @@ -13,21 +13,21 @@ require (
github.com/openshift/machine-config-operator v0.0.1-0.20231024085435-7e1fb719c1ba
github.com/operator-framework/api v0.29.0
github.com/operator-framework/operator-lifecycle-manager v0.0.0-00010101000000-000000000000
github.com/redhat-best-practices-for-k8s/certsuite-claim v1.0.53
github.com/redhat-best-practices-for-k8s/oct v0.0.33
github.com/redhat-best-practices-for-k8s/certsuite-claim v1.0.54
github.com/redhat-best-practices-for-k8s/oct v0.0.34
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.10.0
github.com/test-network-function/cr-scale-operator v0.0.0-20230810174010-26b23b7b446f
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.32.1
k8s.io/apiextensions-apiserver v0.32.1
k8s.io/apimachinery v0.32.1
k8s.io/api v0.32.2
k8s.io/apiextensions-apiserver v0.32.2
k8s.io/apimachinery v0.32.2
k8s.io/client-go v12.0.0+incompatible
k8s.io/utils v0.0.0-20241210054802-24370beab758
sigs.k8s.io/controller-runtime v0.20.1
sigs.k8s.io/controller-runtime v0.20.2
)

require github.com/evanphx/json-patch/v5 v5.9.0 // indirect
require github.com/evanphx/json-patch/v5 v5.9.11 // indirect

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
Expand Down Expand Up @@ -141,12 +141,12 @@ require (
gopkg.in/k8snetworkplumbingwg/multus-cni.v4 v4.1.4 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gorm.io/gorm v1.25.12 // indirect
helm.sh/helm/v3 v3.17.0 // indirect
k8s.io/cli-runtime v0.32.0 // indirect
k8s.io/component-base v0.32.1 // indirect
helm.sh/helm/v3 v3.17.1 // indirect
k8s.io/cli-runtime v0.32.1 // indirect
k8s.io/component-base v0.32.2 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect
k8s.io/kubectl v0.32.0 // indirect
k8s.io/kubectl v0.32.1 // indirect
k8s.io/kubelet v0.31.5 // indirect
sigs.k8s.io/container-object-storage-interface-api v0.1.0 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
Expand Down
Loading

0 comments on commit e833abf

Please sign in to comment.