Skip to content

Commit

Permalink
Switch to 1-to-1 result struct mapping (#616)
Browse files Browse the repository at this point in the history
* Switch to 1-to-1 result struct mapping

* Add depends-on action

* Add image build
  • Loading branch information
sebrandon1 authored Dec 1, 2023
1 parent da1cdd5 commit 998775b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
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

0 comments on commit 998775b

Please sign in to comment.