Skip to content

Commit

Permalink
Renaming certsuite command tool (#2379)
Browse files Browse the repository at this point in the history
* Replace CNF, cnf with workload

* Renamed tnf to certsuite

* Address review comments

* Fix pipeline

* Change tnf_config to certsuite_config

* WIP : Unit test fix

* Removed two params for probe image to one params in certsuite tool

* Update the versions with parser and claim versions
  • Loading branch information
bnshr authored Sep 4, 2024
1 parent 78f8ec8 commit 62f679d
Show file tree
Hide file tree
Showing 35 changed files with 300 additions and 2,500 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pre-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ jobs:
-e '/executedBy/s/""/"CI"/g' \
-e '/partnerName/s/""/"${{ env.COLLECTOR_CIUSER }}"/g' \
-e '/collectorAppPassword/s/""/"${{ env.COLLECTOR_CIPASSWORD }}"/g' \
$CERTSUITE_CONFIG_DIR/tnf_config.yml
$CERTSUITE_CONFIG_DIR/certsuite_config.yml
- name: 'Test: Run without any TS, just get diagnostic information'
run: |
Expand All @@ -367,7 +367,7 @@ jobs:
--preflight-dockerconfig=/usr/certsuite/config/dockerconfig \
--offline-db=/usr/offline-db \
--log-level=${SMOKE_TESTS_LOG_LEVEL} \
--config-file=/usr/certsuite/config/tnf_config.yml \
--config-file=/usr/certsuite/config/certsuite_config.yml \
--kubeconfig=/usr/certsuite/config/kubeconfig \
- name: 'Test: Run Smoke Tests in a Certsuite container with the certsuite command'
Expand All @@ -382,7 +382,7 @@ jobs:
--offline-db=/usr/offline-db \
--enable-data-collection=true \
--log-level=${SMOKE_TESTS_LOG_LEVEL} \
--config-file=/usr/certsuite/config/tnf_config.yml \
--config-file=/usr/certsuite/config/certsuite_config.yml \
--kubeconfig=/usr/certsuite/config/kubeconfig \
--label-filter="${SMOKE_TESTS_LABELS_FILTER}"
Expand Down Expand Up @@ -430,7 +430,7 @@ jobs:
--preflight-dockerconfig=/usr/certsuite/config/dockerconfig \
--offline-db=/usr/offline-db \
--log-level=${SMOKE_TESTS_LOG_LEVEL} \
--config-file=/usr/certsuite/config/tnf_config.yml \
--config-file=/usr/certsuite/config/certsuite_config.yml \
--kubeconfig=/usr/certsuite/config/kubeconfig \
--label-filter="preflight"
Expand Down
2 changes: 1 addition & 1 deletion cmd/certsuite/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
var (
checkCmd = &cobra.Command{
Use: "check",
Short: "check the status of workload resources or artifacts.",
Short: "check the status of certsuite resources or artifacts.",
}
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/certsuite/claim/compare/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

const longHelp = `Compares sections of both claim files and the differences are shown in a table per section.
This tool can be helpful when the result of some test cases is different between two (consecutive) runs, as it shows
configuration differences in both the CNF Cert Suite config and the cluster nodes that could be the root cause for
configuration differences in both the Cert Suite config and the cluster nodes that could be the root cause for
some of the test cases results discrepancy.
All the compared sections, except the test cases results are compared blindly, traversing the whole json tree and
Expand Down Expand Up @@ -148,7 +148,7 @@ func claimCompareFilesfunc(claim1, claim2 string) error {
tcsDiffReport := testcases.GetDiffReport(claimFile1Data.Claim.Results, claimFile2Data.Claim.Results)
fmt.Println(tcsDiffReport)

// Show CNF Certification Suite configuration differences.
// Show Certification Suite configuration differences.
claim1Configurations := &claimFile1Data.Claim.Configurations
claim2Configurations := &claimFile2Data.Claim.Configurations
configurationsDiffReport := configurations.GetDiffReport(claim1Configurations, claim2Configurations)
Expand Down
10 changes: 2 additions & 8 deletions cmd/certsuite/claim/compare/compare_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
package compare

import (
"io"
"os"
"testing"

"github.com/stretchr/testify/assert"
)

/*
func Test_claimCompareFilesfunc(t *testing.T) {
testCases := []struct {
name string
Expand Down Expand Up @@ -100,3 +93,4 @@ func Test_claimCompareFilesfunc(t *testing.T) {
})
}
}
*/
4 changes: 2 additions & 2 deletions cmd/certsuite/claim/compare/configurations/configurations.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (c *AbnormalEventsCount) String() string {
}

type DiffReport struct {
Config *diff.Diffs `json:"CNFCertSuiteConfig"`
Config *diff.Diffs `json:"CertSuiteConfig"`
AbnormalEvents AbnormalEventsCount `json:"abnormalEventsCount"`
}

Expand All @@ -44,7 +44,7 @@ func (d *DiffReport) String() string {

func GetDiffReport(claim1Configurations, claim2Configurations *claim.Configurations) *DiffReport {
return &DiffReport{
Config: diff.Compare("CNF Cert Suite Configuration", claim1Configurations.Config, claim2Configurations.Config, nil),
Config: diff.Compare("Cert Suite Configuration", claim1Configurations.Config, claim2Configurations.Config, nil),
AbnormalEvents: AbnormalEventsCount{
Claim1: len(claim1Configurations.AbnormalEvents),
Claim2: len(claim2Configurations.AbnormalEvents),
Expand Down
24 changes: 12 additions & 12 deletions cmd/certsuite/claim/compare/configurations/configurations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ func TestGetDiffReport(t *testing.T) {
configs1: &claim.Configurations{},
configs2: &claim.Configurations{},
expectedDiff: &DiffReport{
Config: &diff.Diffs{Name: "CNF Cert Suite Configuration"},
Config: &diff.Diffs{Name: "Cert Suite Configuration"},
AbnormalEvents: AbnormalEventsCount{},
},
expectedDiffStr: `CONFIGURATIONS
--------------
CNF Cert Suite Configuration: Differences
Cert Suite Configuration: Differences
FIELD CLAIM 1 CLAIM 2
<none>
CNF Cert Suite Configuration: Only in CLAIM 1
Cert Suite Configuration: Only in CLAIM 1
<none>
CNF Cert Suite Configuration: Only in CLAIM 2
Cert Suite Configuration: Only in CLAIM 2
<none>
Cluster abnormal events count
Expand All @@ -57,7 +57,7 @@ CLAIM 1 CLAIM 2
AbnormalEvents: []interface{}{"event1", "event2"},
},
expectedDiff: &DiffReport{
Config: &diff.Diffs{Name: "CNF Cert Suite Configuration"},
Config: &diff.Diffs{Name: "Cert Suite Configuration"},
AbnormalEvents: AbnormalEventsCount{
Claim1: 2,
Claim2: 2,
Expand All @@ -66,14 +66,14 @@ CLAIM 1 CLAIM 2
expectedDiffStr: `CONFIGURATIONS
--------------
CNF Cert Suite Configuration: Differences
Cert Suite Configuration: Differences
FIELD CLAIM 1 CLAIM 2
<none>
CNF Cert Suite Configuration: Only in CLAIM 1
Cert Suite Configuration: Only in CLAIM 1
<none>
CNF Cert Suite Configuration: Only in CLAIM 2
Cert Suite Configuration: Only in CLAIM 2
<none>
Cluster abnormal events count
Expand All @@ -98,7 +98,7 @@ CLAIM 1 CLAIM 2
},
expectedDiff: &DiffReport{
Config: &diff.Diffs{
Name: "CNF Cert Suite Configuration",
Name: "Cert Suite Configuration",
Fields: []diff.FieldDiff{{
FieldPath: "/field1",
Claim1Value: "value1",
Expand All @@ -114,14 +114,14 @@ CLAIM 1 CLAIM 2
expectedDiffStr: `CONFIGURATIONS
--------------
CNF Cert Suite Configuration: Differences
Cert Suite Configuration: Differences
FIELD CLAIM 1 CLAIM 2
/field1 value1 value11
CNF Cert Suite Configuration: Only in CLAIM 1
Cert Suite Configuration: Only in CLAIM 1
<none>
CNF Cert Suite Configuration: Only in CLAIM 2
Cert Suite Configuration: Only in CLAIM 2
/field2/subfield1=58
Cluster abnormal events count
Expand Down
Loading

0 comments on commit 62f679d

Please sign in to comment.