@@ -247,6 +247,8 @@ jobs:
247247 runs-on : windows-2019
248248 timeout-minutes : 30
249249 needs : [project, linters, protos, man]
250+ env :
251+ GOTEST : gotestsum --
250252
251253 defaults :
252254 run :
@@ -270,6 +272,7 @@ jobs:
270272 - name : Set env
271273 run : |
272274 echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
275+ echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
273276 echo "${{ github.workspace }}/src/github.com/containerd/containerd/bin" >> $GITHUB_PATH
274277
275278 - run : script/setup/install-dev-tools
@@ -287,22 +290,32 @@ jobs:
287290 git checkout "${SHIM_COMMIT}"
288291 GO111MODULE=on go build -mod=vendor -o "${bindir}/integration/client/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1
289292
293+ - run : script/setup/install-gotestsum
290294 - name : Tests
291295 env :
292296 CGO_ENABLED : 1
297+ GOTESTSUM_JUNITFILE : ${{github.workspace}}/test-unit-root.xml
293298 run : mingw32-make.exe test root-test
294299
295300 - name : Integration 1
296301 env :
297302 CGO_ENABLED : 1
303+ GOTESTSUM_JUNITFILE : ${{github.workspace}}/test-integration-serial-junit.xml
298304 run : mingw32-make.exe integration
299305
300- # Run the integration suite a second time. See discussion in github.com/containerd/containerd/pull/175
306+ # Run the integration suite a second time. See discussion in github.com/containerd/containerd/pull/1759
301307 - name : Integration 2
302308 env :
303309 TESTFLAGS_PARALLEL : 1
304310 CGO_ENABLED : 1
311+ GOTESTSUM_JUNITFILE : ${{github.workspace}}/test-integration-parallel-junit.xml
305312 run : mingw32-make.exe integration
313+ - uses : actions/upload-artifact@v2
314+ if : always()
315+ with :
316+ name : TestResults Windows
317+ path : |
318+ ${{github.workspace}}/*-junit.xml
306319
307320 integration-linux :
308321 name : Linux Integration
@@ -321,6 +334,8 @@ jobs:
321334 - runtime : io.containerd.runtime.v1.linux
322335 runc : crun
323336
337+ env :
338+ GOTEST : gotestsum --
324339 steps :
325340 - uses : actions/setup-go@v2
326341 with :
@@ -370,9 +385,12 @@ jobs:
370385 sudo make install
371386 working-directory : src/github.com/containerd/containerd
372387
388+ - run : sudo -E PATH=$PATH script/setup/install-gotestsum
389+ working-directory : src/github.com/containerd/containerd
373390 - name : Tests
374391 env :
375392 GOPROXY : direct
393+ GOTESTSUM_JUNITFILE : ${{github.workspace}}/test-unit-root-junit.xml
376394 run : |
377395 make test
378396 sudo -E PATH=$PATH GOPATH=$GOPATH GOPROXY=$GOPROXY make root-test
@@ -383,6 +401,7 @@ jobs:
383401 GOPROXY : direct
384402 TEST_RUNTIME : ${{ matrix.runtime }}
385403 RUNC_FLAVOR : ${{ matrix.runc }}
404+ GOTESTSUM_JUNITFILE : ${{github.workspace}}/test-integration-serial-junit.xml
386405 run : |
387406 sudo GOPATH=$GOPATH GOPROXY=$GOPROXY TEST_RUNTIME=$TEST_RUNTIME RUNC_FLAVOR=$RUNC_FLAVOR make integration EXTRA_TESTFLAGS=-no-criu TESTFLAGS_RACE=-race
388407 working-directory : src/github.com/containerd/containerd
@@ -393,6 +412,7 @@ jobs:
393412 GOPROXY : direct
394413 TEST_RUNTIME : ${{ matrix.runtime }}
395414 RUNC_FLAVOR : ${{ matrix.runc }}
415+ GOTESTSUM_JUNITFILE : ${{github.workspace}}/test-integration-parallel-junit.xml
396416 run : |
397417 sudo GOPATH=$GOPATH GOPROXY=$GOPROXY TEST_RUNTIME=$TEST_RUNTIME RUNC_FLAVOR=$RUNC_FLAVOR TESTFLAGS_PARALLEL=1 make integration EXTRA_TESTFLAGS=-no-criu
398418 working-directory : src/github.com/containerd/containerd
@@ -404,6 +424,7 @@ jobs:
404424 GOPROXY : direct
405425 TEST_RUNTIME : ${{ matrix.runtime }}
406426 RUNC_FLAVOR : ${{ matrix.runc }}
427+ GOTESTSUM_JUNITFILE : ${{github.workspace}}/test-integration-criu-junit.xml
407428 # crun doesn't have "checkpoint" command.
408429 if : ${{ matrix.runc == 'runc' }}
409430 run : |
@@ -433,7 +454,7 @@ jobs:
433454 sudo ls /etc/cni/net.d
434455 sudo PATH=$PATH BDIR=$BDIR /usr/local/bin/containerd -a ${BDIR}/c.sock --config ${BDIR}/config.toml --root ${BDIR}/root --state ${BDIR}/state --log-level debug &> ${BDIR}/containerd-cri.log &
435456 sudo PATH=$PATH BDIR=$BDIR /usr/local/bin/ctr -a ${BDIR}/c.sock version
436- sudo PATH=$PATH BDIR=$BDIR GOPATH=$GOPATH critest --runtime-endpoint=unix:///${BDIR}/c.sock --parallel=8
457+ sudo PATH=$PATH BDIR=$BDIR GOPATH=$GOPATH critest --report-dir "${{github.workspace}}/critestreport" -- runtime-endpoint=unix:///${BDIR}/c.sock --parallel=8
437458 TEST_RC=$?
438459 test $TEST_RC -ne 0 && cat ${BDIR}/containerd-cri.log
439460 sudo pkill containerd
@@ -449,12 +470,21 @@ jobs:
449470 mount
450471 df
451472 losetup -l
473+ - uses : actions/upload-artifact@v2
474+ if : always()
475+ with :
476+ name : TestResults ${{ matrix.runtime }} ${{matrix.runc}}
477+ path : |
478+ *-junit.xml
479+ ${{github.workspace}}/critestreport/*.xml
452480
453481 tests-mac-os :
454482 name : MacOS unit tests
455483 runs-on : macos-10.15
456484 timeout-minutes : 10
457485 needs : [project, linters, protos, man]
486+ env :
487+ GOTEST : gotestsum --
458488
459489 steps :
460490 - uses : actions/setup-go@v2
@@ -470,12 +500,21 @@ jobs:
470500 echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
471501 echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
472502
503+ - run : sudo -E PATH=$PATH script/setup/install-gotestsum
504+ working-directory : src/github.com/containerd/containerd
473505 - name : Tests
474506 env :
475507 GOPROXY : direct
508+ GOTESTSUM_JUNITFILE : " ${{ github.workspace }}/macos-test-junit.xml"
476509 run : |
477510 make test
478511 working-directory : src/github.com/containerd/containerd
512+ - uses : actions/upload-artifact@v2
513+ if : always()
514+ with :
515+ name : TestResults MacOS
516+ path : |
517+ *-junit.xml
479518
480519 cgroup2 :
481520 name : CGroupsV2 and SELinux Integration
@@ -488,6 +527,8 @@ jobs:
488527 # Currently crun is disabled to decrease CI flakiness.
489528 # We can enable crun again when we get a better CI infra.
490529 runc : [runc]
530+ env :
531+ GOTEST : gotestsum --
491532 steps :
492533 - uses : actions/checkout@v2
493534
@@ -506,10 +547,27 @@ jobs:
506547 env :
507548 RUNC_FLAVOR : ${{ matrix.runc }}
508549 SELINUX : Enforcing
509- run : vagrant up --provision-with=selinux,install-runc,test-integration
550+ GOTESTSUM_JUNITFILE : /tmp/test-integration-junit.xml
551+ run : vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-integration
510552
511553 - name : CRI test
512554 env :
513555 RUNC_FLAVOR : ${{ matrix.runc }}
514556 SELINUX : Enforcing
515- run : vagrant up --provision-with=selinux,install-runc,test-cri
557+ REPORT_DIR : /tmp/critestreport
558+ run : vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-cri
559+ - name : Get test reports
560+ if : always()
561+ run : |
562+ set -e
563+ vagrant plugin install vagrant-vbguest
564+ vagrant plugin install vagrant-scp
565+ vagrant scp :/tmp/test-integration-junit.xml "${{ github.workspace }}/"
566+ vagrant scp :/tmp/critestreport "${{ github.workspace }}/critestreport"
567+ - uses : actions/upload-artifact@v2
568+ if : always()
569+ with :
570+ name : TestResults cgroup2 ${{ matrix.runtime }} ${{matrix.runc}}
571+ path : |
572+ ${{github.workspace}}/*-junit.xml
573+ ${{github.workspace}}/critestreport/*
0 commit comments