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

Switch to 1-to-1 result struct mapping #616

Merged
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
11 changes: 10 additions & 1 deletion .github/workflows/qe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
KUBECONFIG: '/home/runner/.kube/config'
PFLT_DOCKERCONFIG: '/home/runner/.docker/config'
TEST_TNF_IMAGE_NAME: quay.io/testnetworkfunction/cnf-certification-test
TEST_TNF_IMAGE_TAG: unstable
TEST_TNF_IMAGE_TAG: localtest
DOCKER_CONFIG_DIR: '/home/runner/.docker/'
SKIP_PRELOAD_IMAGES: true # Not needed for github-hosted runs

Expand Down Expand Up @@ -98,6 +98,15 @@ jobs:
repository: ${{ env.TEST_REPO }}
path: cnf-certification-test

- name: Extract dependent Pull Requests
uses: depends-on/depends-on-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Build the test image
run: make build-image-local # quay.io/testnetworkfunction/cnf-certification-test:localtest
working-directory: cnf-certification-test

- name: Run the tests
uses: nick-fields/retry@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions tests/globalhelper/reporthelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func isTestCaseInExpectedStatusInClaimReport(
expectedStatus string) (bool, error) {
for testCaseClaim := range claimReport.Claim.Results {
if formatTestCaseName(testCaseClaim) == formatTestCaseName(testCaseName) {
var testCaseResult []*claim.Result
var testCaseResult *claim.Result

encodedTestResult, err := json.Marshal(claimReport.Claim.Results[testCaseClaim])

Expand All @@ -213,14 +213,14 @@ func isTestCaseInExpectedStatusInClaimReport(
return false, err
}

if testCaseResult[0].State == expectedStatus {
if testCaseResult.State == expectedStatus {
glog.V(5).Info("claim report test case status passed")

return true, nil
}

return false, fmt.Errorf("invalid test status %s instead expected %s",
testCaseResult[0].State,
testCaseResult.State,
expectedStatus)
}
}
Expand Down
Loading