@@ -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 : |
@@ -434,7 +455,7 @@ jobs:
434455 sudo ls /etc/cni/net.d
435456 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 &
436457 sudo PATH=$PATH BDIR=$BDIR /usr/local/bin/ctr -a ${BDIR}/c.sock version
437- sudo PATH=$PATH BDIR=$BDIR GOPATH=$GOPATH critest --runtime-endpoint=unix:///${BDIR}/c.sock --parallel=8
458+ sudo PATH=$PATH BDIR=$BDIR GOPATH=$GOPATH critest --report-dir "${{github.workspace}}/critestreport" -- runtime-endpoint=unix:///${BDIR}/c.sock --parallel=8
438459 TEST_RC=$?
439460 test $TEST_RC -ne 0 && cat ${BDIR}/containerd-cri.log
440461 sudo pkill containerd
@@ -450,12 +471,21 @@ jobs:
450471 mount
451472 df
452473 losetup -l
474+ - uses : actions/upload-artifact@v2
475+ if : always()
476+ with :
477+ name : TestResults ${{ matrix.runtime }} ${{matrix.runc}}
478+ path : |
479+ *-junit.xml
480+ ${{github.workspace}}/critestreport/*.xml
453481
454482 tests-mac-os :
455483 name : MacOS unit tests
456484 runs-on : macos-10.15
457485 timeout-minutes : 10
458486 needs : [project, linters, protos, man]
487+ env :
488+ GOTEST : gotestsum --
459489
460490 steps :
461491 - uses : actions/setup-go@v2
@@ -471,12 +501,21 @@ jobs:
471501 echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
472502 echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
473503
504+ - run : sudo -E PATH=$PATH script/setup/install-gotestsum
505+ working-directory : src/github.com/containerd/containerd
474506 - name : Tests
475507 env :
476508 GOPROXY : direct
509+ GOTESTSUM_JUNITFILE : " ${{ github.workspace }}/macos-test-junit.xml"
477510 run : |
478511 make test
479512 working-directory : src/github.com/containerd/containerd
513+ - uses : actions/upload-artifact@v2
514+ if : always()
515+ with :
516+ name : TestResults MacOS
517+ path : |
518+ *-junit.xml
480519
481520 cgroup2 :
482521 name : CGroupsV2 and SELinux Integration
@@ -489,6 +528,8 @@ jobs:
489528 # Currently crun is disabled to decrease CI flakiness.
490529 # We can enable crun again when we get a better CI infra.
491530 runc : [runc]
531+ env :
532+ GOTEST : gotestsum --
492533 steps :
493534 - uses : actions/checkout@v2
494535
@@ -507,10 +548,27 @@ jobs:
507548 env :
508549 RUNC_FLAVOR : ${{ matrix.runc }}
509550 SELINUX : Enforcing
510- run : vagrant up --provision-with=selinux,install-runc,test-integration
551+ GOTESTSUM_JUNITFILE : /tmp/test-integration-junit.xml
552+ run : vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-integration
511553
512554 - name : CRI test
513555 env :
514556 RUNC_FLAVOR : ${{ matrix.runc }}
515557 SELINUX : Enforcing
516- run : vagrant up --provision-with=selinux,install-runc,test-cri
558+ REPORT_DIR : /tmp/critestreport
559+ run : vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-cri
560+ - name : Get test reports
561+ if : always()
562+ run : |
563+ set -e
564+ vagrant plugin install vagrant-vbguest
565+ vagrant plugin install vagrant-scp
566+ vagrant scp :/tmp/test-integration-junit.xml "${{ github.workspace }}/"
567+ vagrant scp :/tmp/critestreport "${{ github.workspace }}/critestreport"
568+ - uses : actions/upload-artifact@v2
569+ if : always()
570+ with :
571+ name : TestResults cgroup2 ${{ matrix.runtime }} ${{matrix.runc}}
572+ path : |
573+ ${{github.workspace}}/*-junit.xml
574+ ${{github.workspace}}/critestreport/*
0 commit comments