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

Remove cnf #2452

Merged
merged 1 commit into from
Sep 19, 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
2 changes: 1 addition & 1 deletion .github/workflows/pre-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Build the `cnf-certification-test` image
- name: Build the `certsuite` image
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
timeout_minutes: 90
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/qe-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ permissions:
env:
QE_REPO: redhat-best-practices-for-k8s/certsuite-qe
CERTSUITE_IMAGE_NAME: quay.io/redhat-best-practices-for-k8s/certsuite
CERTSUITE_IMAGE_NAME_LEGACY: quay.io/redhat-best-practices-for-k8s/redhat-best-practices-for-k8s-certsuite
sebrandon1 marked this conversation as resolved.
Show resolved Hide resolved
TEST_CERTSUITE_IMAGE_TAG: localtest
CERTSUITE_CONFIG_DIR: '/tmp/certsuite_config'
CERTSUITE_REPORT_DIR: '/tmp/certsuite_report'
Expand Down Expand Up @@ -65,7 +64,6 @@ jobs:
file: ./Dockerfile
tags: |
${{ env.CERTSUITE_IMAGE_NAME }}:${{ env.TEST_CERTSUITE_IMAGE_TAG }}
${{ env.CERTSUITE_IMAGE_NAME_LEGACY }}:${{ env.TEST_CERTSUITE_IMAGE_TAG }}
outputs: type=docker,dest=/tmp/testimage.tar

- name: Store image as artifact
Expand Down
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
bin/
catalog.json
claim.json
cnf-certification-test/certsuite.log
certsuite/certsuite.log
.idea
vendor
*.test
redhat-best-practices-for-k8s_junit.xml
cover.out
cover.out.tmp
cnf-certification-test/cnf-certification-tests_junit.xml
cnf-certification-tests_junit.xml
cnftests-junit.xml
certsuite/certsuite-tests_junit.xml
certsuite_junit.xml
certsuitetests-junit.xml
setup_junit.xml
validation_junit.xml
.vscode
jsontest-cli
test-out.json
cnf-certification-test/results.html
certsuite/results.html
redhat-best-practices-for-k8s
cnf-certification-test/claimjson.js
certsuite/claimjson.js

temp/
/certsuite
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ GO_PACKAGES=$(shell go list ./... | grep -v vendor)
REGISTRY_LOCAL?=localhost
REGISTRY?=quay.io
CERTSUITE_IMAGE_NAME?=redhat-best-practices-for-k8s/certsuite
CERTSUITE_IMAGE_NAME_LEGACY?=testnetworkfunction/cnf-certification-test
CERTSUITE_IMAGE_NAME_LEGACY?=testnetworkfunction/certsuite
IMAGE_TAG?=localtest
.PHONY: all clean test build
.PHONY: \
Expand Down Expand Up @@ -69,9 +69,9 @@ build-darwin-arm64: results-html

# Cleans up auto-generated and report files
clean:
go clean && rm -f all-releases.txt cover.out claim.json cnf-certification-test/claim.json \
cnf-certification-test/claimjson.js cnf-certification-test/cnf-certification-tests_junit.xml \
cnf-certification-test/results.html jsontest-cli latest-release-tag.txt \
go clean && rm -f all-releases.txt cover.out claim.json certsuite/claim.json \
certsuite/claimjson.js certsuite/certsuites_junit.xml \
certsuite/results.html jsontest-cli latest-release-tag.txt \
release-tag.txt test-out.json certsuite

# Runs configured linters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8373,7 +8373,7 @@
"duration": 249071,
"endTime": "2023-09-04 09:19:06.658058151 -0500 CDT m=+36.192982330",
"failureLineContent": "\t\tginkgo.Skip(\"No role contains rules that apply to at least one CRD under test\")",
"failureLocation": "/home/greyerof/github/certsuite/cnf-certification-test/accesscontrol/suite.go:933",
"failureLocation": "/home/greyerof/github/certsuite/certsuite/accesscontrol/suite.go:933",
"skipReason": "No role contains rules that apply to at least one CRD under test",
"startTime": "2023-09-04 09:19:06.657809085 -0500 CDT m=+36.192733259",
"state": "skipped",
Expand Down Expand Up @@ -8589,7 +8589,7 @@
"duration": 300309189,
"endTime": "2023-09-04 09:18:50.964966148 -0500 CDT m=+20.499890322",
"failureLineContent": "\t\t\tginkgo.Fail(\"Pod has been found with default service account name.\")",
"failureLocation": "/home/greyerof/github/certsuite/cnf-certification-test/accesscontrol/suite.go:612",
"failureLocation": "/home/greyerof/github/certsuite/certsuite/accesscontrol/suite.go:612",
"skipReason": "Pod has been found with default service account name.",
"startTime": "2023-09-04 09:18:50.664656954 -0500 CDT m=+20.199581133",
"state": "failed",
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/images/demo-certsuite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ To enable this, set:
--create-xml-junit-file true
```

This will create a file named `cnf-certification-test/cnf-certification-tests_junit.xml`.
This will create a file named `certsuite/certsuite-tests_junit.xml`.

#### Enable running container against OpenShift Local

Expand Down
4 changes: 2 additions & 2 deletions docs/test-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ go run cmd/tools/cmd/main.go claim-add --claimfile=claim.json

```json
"results": {
"cnf-certification-tests_junit": {
"certsuite-tests_junit": {
"testsuite": {
"-errors": "0",
"-failures": "2",
Expand Down Expand Up @@ -61,7 +61,7 @@ The "20230620-110654" sample prefix means "June-20th 2023, 11:06:54"
This is the content of the tar.gz file:

* claim.json
* cnf-certification-tests_junit.xml (Only if enabled via flag)
* certsuite-tests_junit.xml (Only if enabled via flag)
* claimjson.js
* classification.js
* results.html
Expand Down
4 changes: 2 additions & 2 deletions docs/test-spec-implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This section explains the implementation of some test cases so that users can ha

## [lifecycle-deployment-scaling](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-deployment-scaling) and [lifecycle-statefulset-scaling](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-statefulset-scaling)

For each discovered deployment in the [target namespaces](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/cnf-certification-test/certsuite_config.yml#L1), the test case will try to modify its replica count to check whether pod's can be correctly removed and re-deployed in the cluster.
For each discovered deployment in the [target namespaces](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/config/certsuite_config.yml#L1), the test case will try to modify its replica count to check whether pod's can be correctly removed and re-deployed in the cluster.

<!-- markdownlint-disable MD033 -->
<img src="../assets/images/tests-flow-charts/lifecycle-deployment-scaling.png"></img>
Expand All @@ -19,7 +19,7 @@ As depicted in the image, the way to modify the number of replicas varies depend

## [lifecycle-crd-scaling](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-crd-scaling)

During the program's startup, an autodiscovery phase is performed where all the CRDs and their existing CRs in the [target namespaces](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/cnf-certification-test/certsuite_config.yml#L1) are stored to be tested later. Only CRs whose CRD's suffix matches at least one of the [targetCrdFilters](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/d2b718753f438ec8f33ed8bca5ac60ecf71ef599/cnf-certification-test/certsuite_config.yml#L8) and has an [scale subresource](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#scale-subresource) will be selected as test targets.
During the program's startup, an autodiscovery phase is performed where all the CRDs and their existing CRs in the [target namespaces](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/config/certsuite_config.yml#L1) are stored to be tested later. Only CRs whose CRD's suffix matches at least one of the [targetCrdFilters](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/config/certsuite_config.yml#L9) and has an [scale subresource](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#scale-subresource) will be selected as test targets.

For every CR under test, a similar approach to the scaling of deployments and statefulsets is done.

Expand Down
2 changes: 1 addition & 1 deletion pkg/certsuite/certsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func LoadChecksDB(labelsExpr string) {
}

const (
junitXMLOutputFileName = "cnf-certification-tests_junit.xml"
junitXMLOutputFileName = "certsuite-tests_junit.xml"
ramperher marked this conversation as resolved.
Show resolved Hide resolved
claimFileName = "claim.json"
collectorAppURL = "http://claims-collector.cnf-certifications.sysdeseng.com"
timeoutDefaultvalue = 24 * time.Hour
Expand Down
2 changes: 1 addition & 1 deletion script/create-missing-test-files.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
for folder in cnf-certification-test internal pkg; do
for folder in certsuite internal pkg; do
echo "./$folder"
find ./$folder -name "*.go" | grep -v "_test.go" | grep -v "_moq.go" | sed 's/.go//g' | xargs -I{} sh -c \
"
Expand Down
Loading