Uploaded image for project: 'Infrastructure'
  1. Infrastructure
  2. INFRA-2882

Use the "Junit" report feature from CST for Docker Image tests

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Why

      As Jenkins users building and testing our own Docker images in our Jenkins controllers, a native integration of the Docker test harnesses would provides a shorted feedback loop (e.g. we could only focus on the failing tests, not on searching what went wrong...).

      Requirements before starting the issue

      What

      Following INFRA-2860, we are now using https://github.com/GoogleContainerTools/container-structure-test to test docker images.

      We are currently using the version 1.10.0 of cst, which features a Junit test report output (https://github.com/GoogleContainerTools/container-structure-test/pull/254).
      Alas this report seems to be invalid and Jenkins fails to parse it, as reported in https://github.com/GoogleContainerTools/container-structure-test/issues/273.

      Once the issue on Container Structure Test is fixed (either on cst's side, or on the Jenkins side), then it could be a great improvement to use junit and report it in Jenkins:

      How

      What has to be done:

      • Ensure that the correct version of container-structure-test is used (`> v1.10.0`)
      • Update the `Makefile`'s command for the target `make test` (`container-structure-test test ...`) to add both flags `-output=junit` and `-test-report=junit-report.xml`
      • Update the Pipeline's library function buildDockerAndPublishImage to add the junit test report as a post step, always run (even if the `make test` step fails)
      stage('test') {
        steps {
          sh 'make test'
        }
        post {
          always {
              junit 'junit-report.xml'
          }
        }
      }
      

      Definition of Done

        Attachments

          Issue Links

            Activity

            Hide
            dduportal Damien Duportal added a comment -

            This contribution requires to contribute to https://github.com/GoogleContainerTools/container-structure-test to fix the Junit parsing issue.

            Show
            dduportal Damien Duportal added a comment - This contribution requires to contribute to https://github.com/GoogleContainerTools/container-structure-test to fix the Junit parsing issue.
            Hide
            dduportal Damien Duportal added a comment -

            Clsoing because the future of ContainerStructureTest is yet to be decided as per https://github.com/GoogleContainerTools/container-structure-test/issues/279#issuecomment-925986351

            Show
            dduportal Damien Duportal added a comment - Clsoing because the future of ContainerStructureTest is yet to be decided as per https://github.com/GoogleContainerTools/container-structure-test/issues/279#issuecomment-925986351

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              dduportal Damien Duportal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: