k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/config/jobs/kubernetes/sig-testing/coverage.yaml (about)

     1  presubmits:
     2    kubernetes/kubernetes:
     3    # The presubmit version of the ci-kubernetes-coverage-unit job.
     4    - name: pull-kubernetes-coverage-unit
     5      cluster: eks-prow-build-cluster
     6      always_run: false
     7      skip_report: false
     8      max_concurrency: 12
     9      decorate: true
    10      path_alias: k8s.io/kubernetes
    11      decoration_config:
    12        timeout: 60m
    13      extra_refs:
    14      - org: kubernetes
    15        repo: test-infra
    16        base_ref: master
    17        path_alias: k8s.io/test-infra
    18      annotations:
    19        testgrid-dashboards: sig-testing-canaries
    20        description: unit test coverage presubmit
    21      spec:
    22        containers:
    23        - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20240515-17c6d50e24-master
    24          command:
    25          - runner.sh
    26          - bash
    27          args:
    28          - -c
    29          - |
    30            result=0
    31            ( cd hack/tools && GO111MODULE=on go install gotest.tools/gotestsum ) || result=$?
    32            make test KUBE_COVER=y KUBE_COVER_REPORT_DIR="${ARTIFACTS}" KUBE_TIMEOUT="--timeout=300s" || result=$?
    33            cd ../test-infra/gopherage
    34            GO111MODULE=on go build .
    35            find ${ARTIFACTS} -type f -iname 'junit*.xml' -exec rm {} \;
    36            ./gopherage filter --exclude-path="zz_generated,generated\.pb\.go"  "${ARTIFACTS}/combined-coverage.out" > "${ARTIFACTS}/filtered.cov" || result=$?
    37            ./gopherage junit --threshold 0.05 "${ARTIFACTS}/filtered.cov" > "${ARTIFACTS}/junit_coverage.xml" || result=$?
    38            # For now let's swallow the error - we can reenable returning $result once we're in better shape.
    39            exit 0
    40          resources:
    41            limits:
    42              cpu: 4
    43              memory: 16Gi
    44            requests:
    45              cpu: 4
    46              memory: 16Gi
    47          securityContext:
    48            privileged: true
    49  
    50  periodics:
    51  - interval: 1h
    52    name: ci-kubernetes-coverage-conformance
    53    cluster: k8s-infra-prow-build
    54    decorate: true
    55    labels:
    56      preset-service-account: "true"
    57      preset-k8s-ssh: "true"
    58      preset-dind-enabled: "true"
    59    extra_refs:
    60    - org: kubernetes
    61      repo: kubernetes
    62      base_ref: master
    63      path_alias: k8s.io/kubernetes
    64    - org: kubernetes
    65      repo: test-infra
    66      base_ref: master
    67      path_alias: k8s.io/test-infra
    68    - org: kubernetes
    69      repo: release
    70      base_ref: master
    71      path_alias: k8s.io/release
    72    decoration_config:
    73      timeout: 6h
    74    spec:
    75      containers:
    76      - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20240515-17c6d50e24-master
    77        command:
    78        - runner.sh
    79        - bash
    80        args:
    81        - -e
    82        - -c
    83        - |
    84          shopt -s globstar
    85          ../test-infra/scenarios/kubernetes_e2e.py \
    86            --build=quick \
    87            --dump-before-and-after \
    88            --extract=local \
    89            --stage=gs://k8s-release-dev/ci/ci-kubernetes-conformance-coverage \
    90            --gcp-zone=us-west1-b \
    91            --provider=gce \
    92            --timeout=300m \
    93            --test_args="--ginkgo.focus=\[Conformance\]"
    94          cd ../test-infra/gopherage
    95          GO111MODULE=on go build .
    96          ./gopherage merge "${ARTIFACTS}"/before/**/*.cov > "${ARTIFACTS}/before/merged.cov"
    97          ./gopherage merge "${ARTIFACTS}"/after/**/*.cov > "${ARTIFACTS}/after/merged.cov"
    98          ./gopherage diff "${ARTIFACTS}/before/merged.cov" "${ARTIFACTS}/after/merged.cov" > "${ARTIFACTS}/conformance.cov"
    99          ./gopherage filter --exclude-path="zz_generated,third_party/,cmd/,cloudprovider/providers/,alpha,beta,\.pb\.go,k8s\.io/legacy-cloud-providers,k8s\.io/kubernetes/pkg/volume/"  "${ARTIFACTS}/conformance.cov" > "${ARTIFACTS}/filtered.cov"
   100          ./gopherage html "${ARTIFACTS}/filtered.cov"  > "${ARTIFACTS}/conformance.html"
   101          ./gopherage junit --threshold 0 "${ARTIFACTS}/filtered.cov" > "${ARTIFACTS}/junit_coverage.xml"
   102        env:
   103        - name: KUBE_BUILD_WITH_COVERAGE
   104          value: "true"
   105        - name: KUBE_BUILD_CONFORMANCE
   106          value: "n"
   107        securityContext:
   108          privileged: true
   109        resources:
   110          limits:
   111            cpu: 4
   112            memory: 16Gi
   113          requests:
   114            cpu: 4
   115            memory: 16Gi
   116    # coverage for same tests that run in ci-kubernetes-e2e-gci-gce
   117    annotations:
   118      testgrid-dashboards: sig-testing-canaries
   119      description: build instrumented kubernetes, run conformance tests, generate line coverage using gopherage
   120  - interval: 1h
   121    name: ci-kubernetes-coverage-e2e-gci-gce
   122    cluster: k8s-infra-prow-build
   123    decorate: true
   124    labels:
   125      preset-service-account: "true"
   126      preset-k8s-ssh: "true"
   127      preset-dind-enabled: "true"
   128    extra_refs:
   129    - org: kubernetes
   130      repo: kubernetes
   131      base_ref: master
   132      path_alias: k8s.io/kubernetes
   133    - org: kubernetes
   134      repo: test-infra
   135      base_ref: master
   136      path_alias: k8s.io/test-infra
   137    - org: kubernetes
   138      repo: release
   139      base_ref: master
   140      path_alias: k8s.io/release
   141    decoration_config:
   142      timeout: 3h
   143    spec:
   144      containers:
   145      - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20240515-17c6d50e24-master
   146        command:
   147        - runner.sh
   148        - bash
   149        args:
   150        - -e
   151        - -c
   152        - |
   153          shopt -s globstar
   154          ../test-infra/scenarios/kubernetes_e2e.py \
   155            --build=quick \
   156            --dump-before-and-after \
   157            --extract=local \
   158            --stage=gs://k8s-release-dev/ci/ci-kubernetes-coverage-e2e-gci-gce \
   159            --gcp-master-image=gci \
   160            --gcp-node-image=gci \
   161            --gcp-nodes=4 \
   162            --gcp-zone=us-west1-b \
   163            --ginkgo-parallel=30 \
   164            --provider=gce \
   165            --timeout=150m \
   166            --test_args="--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8"
   167          cd ../test-infra/gopherage
   168          GO111MODULE=on go build .
   169          ./gopherage merge "${ARTIFACTS}"/before/**/*.cov > "${ARTIFACTS}/before/merged.cov"
   170          ./gopherage merge "${ARTIFACTS}"/after/**/*.cov > "${ARTIFACTS}/after/merged.cov"
   171          ./gopherage diff "${ARTIFACTS}/before/merged.cov" "${ARTIFACTS}/after/merged.cov" > "${ARTIFACTS}/e2e.cov"
   172          ./gopherage filter --exclude-path="zz_generated,third_party/,cmd/,cloudprovider/providers/,\.pb\.go,k8s\.io/legacy-cloud-providers,k8s\.io/kubernetes/pkg/volume/"  "${ARTIFACTS}/e2e.cov" > "${ARTIFACTS}/filtered.cov"
   173          ./gopherage html "${ARTIFACTS}/filtered.cov"  > "${ARTIFACTS}/e2e.html"
   174          ./gopherage junit --threshold 0 "${ARTIFACTS}/filtered.cov" > "${ARTIFACTS}/junit_coverage.xml"
   175        env:
   176        - name: KUBE_BUILD_WITH_COVERAGE
   177          value: "true"
   178        - name: KUBE_BUILD_CONFORMANCE
   179          value: "n"
   180        securityContext:
   181          privileged: true
   182        resources:
   183          limits:
   184            cpu: 4
   185            memory: 16Gi
   186          requests:
   187            cpu: 4
   188            memory: 16Gi
   189    annotations:
   190      testgrid-dashboards: sig-testing-canaries
   191      description: build instrumented kubernetes, run (non-slow/serial/disruptive/flaky/feature) e2e tests, generate line coverage using gopherage
   192  
   193  - interval: 1h
   194    name: ci-kubernetes-coverage-unit
   195    cluster: k8s-infra-prow-build
   196    decorate: true
   197    extra_refs:
   198    - org: kubernetes
   199      repo: kubernetes
   200      base_ref: master
   201      path_alias: k8s.io/kubernetes
   202    - org: kubernetes
   203      repo: test-infra
   204      base_ref: master
   205      path_alias: k8s.io/test-infra
   206    spec:
   207      containers:
   208      - image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20240515-17c6d50e24-master
   209        command:
   210        - runner.sh
   211        - bash
   212        args:
   213        - -c
   214        - |
   215          result=0
   216          ( cd hack/tools && GO111MODULE=on go install gotest.tools/gotestsum ) || result=$?
   217          make test KUBE_COVER=y KUBE_COVER_REPORT_DIR="${ARTIFACTS}" KUBE_TIMEOUT="--timeout=300s" || result=$?
   218          cd ../test-infra/gopherage
   219          GO111MODULE=on go build .
   220          find ${ARTIFACTS} -type f -iname 'junit*.xml' -exec rm {} \;
   221          ./gopherage filter --exclude-path="zz_generated,generated\.pb\.go"  "${ARTIFACTS}/combined-coverage.out" > "${ARTIFACTS}/filtered.cov" || result=$?
   222          ./gopherage junit --threshold 0.05 "${ARTIFACTS}/filtered.cov" > "${ARTIFACTS}/junit_coverage.xml" || result=$?
   223          exit $result
   224        resources:
   225          limits:
   226            cpu: 4
   227            memory: 16Gi
   228          requests:
   229            cpu: 4
   230            memory: 16Gi
   231        securityContext:
   232          privileged: true