Skip to content

Commit

Permalink
Merge branch 'ginkgo_removal' into new_log_package_with_slog
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontesi committed Nov 30, 2023
2 parents 17ef07a + a3a6492 commit d805c0c
Show file tree
Hide file tree
Showing 13 changed files with 269 additions and 162 deletions.
2 changes: 1 addition & 1 deletion cmd/tnf/claim/compare/compare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func Test_claimCompareFilesfunc(t *testing.T) {
}

if err != nil {
assert.Equal(t, err.Error(), tc.expectedError)
assert.Equal(t, tc.expectedError, err.Error())
} else {
// Read the output from the pipe.
out, _ := io.ReadAll(r)
Expand Down
8 changes: 4 additions & 4 deletions cmd/tnf/claim/compare/testcases/testcases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"reflect"
"testing"

"github.com/stretchr/testify/assert"
"github.com/test-network-function/cnf-certification-test/cmd/tnf/pkg/claim"
"gotest.tools/v3/assert"
)

func TestGetTestCasesResultsMap(t *testing.T) {
Expand Down Expand Up @@ -84,7 +84,7 @@ func TestGetTestCasesResultsMap(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.description, func(t *testing.T) {
resultsMap := getTestCasesResultsMap(tc.results)
assert.Equal(t, true, reflect.DeepEqual(tc.expectedTestCasesResultsMap, resultsMap))
assert.True(t, reflect.DeepEqual(tc.expectedTestCasesResultsMap, resultsMap))
})
}
}
Expand Down Expand Up @@ -143,7 +143,7 @@ func TestGetMergedTestCasesNames(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.description, func(t *testing.T) {
tcMergedNamesList := getMergedTestCasesNames(tc.claim1Results, tc.claim2Results)
assert.Equal(t, true, reflect.DeepEqual(tc.expectedMergedTcNames, tcMergedNamesList))
assert.True(t, reflect.DeepEqual(tc.expectedMergedTcNames, tcMergedNamesList))
})
}
}
Expand Down Expand Up @@ -308,7 +308,7 @@ func TestGetDiffReport(t *testing.T) {

// Check test case results differences
t.Logf("diffs: %+v", diffReport.TestCases)
assert.Equal(t, true, reflect.DeepEqual(tc.expectedDiffReport.TestCases, diffReport.TestCases))
assert.True(t, reflect.DeepEqual(tc.expectedDiffReport.TestCases, diffReport.TestCases))

// Check count
assert.Equal(t, tc.expectedDiffReport.DifferentTestCasesResults, diffReport.DifferentTestCasesResults)
Expand Down
10 changes: 5 additions & 5 deletions cmd/tnf/claim/show/failures/failures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/stretchr/testify/assert"
"github.com/test-network-function/cnf-certification-test/cmd/tnf/pkg/claim"
"gotest.tools/v3/assert"
)

func TestParseTargetTestSuitesFlag(t *testing.T) {
Expand Down Expand Up @@ -50,7 +50,7 @@ func TestParseTargetTestSuitesFlag(t *testing.T) {
for _, tc := range testCases {
testSuitesFlag = tc.flag
parsedTestSuites := parseTargetTestSuitesFlag()
assert.DeepEqual(t, tc.expectedTestSuites, parsedTestSuites)
assert.Equal(t, tc.expectedTestSuites, parsedTestSuites)
}
}

Expand Down Expand Up @@ -265,7 +265,7 @@ func TestGetNonCompliantObjectsFromFailureReason(t *testing.T) {
assert.Equal(t, tc.expectedError, err.Error())
}

assert.DeepEqual(t, tc.expectedNonCompliantObjects, nonCompliantObjects)
assert.Equal(t, tc.expectedNonCompliantObjects, nonCompliantObjects)
}
}

Expand Down Expand Up @@ -376,7 +376,7 @@ func TestGetFailedTestCasesByTestSuite(t *testing.T) {

for _, tc := range testCases {
claimScheme, err := claim.Parse(tc.claimFilePath)
assert.NilError(t, err)
assert.Nil(t, err)

// Order test case results by test suite, using a helper map.
resultsByTestSuite := map[string][]*claim.TestCaseResult{}
Expand All @@ -393,6 +393,6 @@ func TestGetFailedTestCasesByTestSuite(t *testing.T) {
map[string]bool{tc.targetTestSuite: true},
)
fmt.Printf("%#v\n\n", testSuites)
assert.DeepEqual(t, tc.expectedFailedTestSuites, testSuites)
assert.Equal(t, tc.expectedFailedTestSuites, testSuites)
}
}
2 changes: 1 addition & 1 deletion cmd/tnf/pkg/claim/claim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package claim
import (
"testing"

"gotest.tools/v3/assert"
"github.com/stretchr/testify/assert"
)

func TestIsClaimFormatVersionSupported(t *testing.T) {
Expand Down
Loading

0 comments on commit d805c0c

Please sign in to comment.