Skip to content

Commit 7b5a67f

Browse files
committed
Switch to ginkgo/v2
Migrate the unit tests to the latest ginkgo v2 release. Signed-off-by: Sascha Grunert <[email protected]>
1 parent 77718dc commit 7b5a67f

File tree

330 files changed

+17053
-11815
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+17053
-11815
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ jobs:
253253
name: unit
254254
path: |
255255
build/coverage
256-
build/junit
257256
258257
coverage:
259258
needs: unit

Makefile

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ CONTAINER_RUNTIME ?= podman
3232
BUILD_PATH := $(shell pwd)/build
3333
BUILD_BIN_PATH := ${BUILD_PATH}/bin
3434
COVERAGE_PATH := ${BUILD_PATH}/coverage
35-
JUNIT_PATH := ${BUILD_PATH}/junit
3635
TESTBIN_PATH := ${BUILD_PATH}/test
3736
MOCK_PATH := ${PWD}/test/mocks
3837

@@ -244,7 +243,7 @@ ${GO_MD2MAN}:
244243
$(call go-build,./vendor/github.com/cpuguy83/go-md2man)
245244

246245
${GINKGO}:
247-
$(call go-build,./vendor/github.com/onsi/ginkgo/ginkgo)
246+
$(call go-build,./vendor/github.com/onsi/ginkgo/v2/ginkgo)
248247

249248
${MOCKGEN}:
250249
$(call go-build,./vendor/github.com/golang/mock/mockgen)
@@ -286,25 +285,19 @@ check-vendor: vendor
286285

287286
testunit: ${GINKGO}
288287
rm -rf ${COVERAGE_PATH} && mkdir -p ${COVERAGE_PATH}
289-
rm -rf ${JUNIT_PATH} && mkdir -p ${JUNIT_PATH}
290-
ACK_GINKGO_DEPRECATIONS=1.16.0 \
291-
${BUILD_BIN_PATH}/ginkgo \
288+
${BUILD_BIN_PATH}/ginkgo run \
292289
${TESTFLAGS} \
293290
-r \
294291
--trace \
295292
--cover \
296293
--covermode atomic \
297-
--outputdir ${COVERAGE_PATH} \
294+
--output-dir ${COVERAGE_PATH} \
295+
--junit-report junit.xml \
298296
--coverprofile coverprofile \
299297
--tags "test $(BUILDTAGS)" \
300298
$(GO_MOD_VENDOR) \
301299
--succinct
302300
$(GO) tool cover -html=${COVERAGE_PATH}/coverprofile -o ${COVERAGE_PATH}/coverage.html
303-
$(GO) tool cover -func=${COVERAGE_PATH}/coverprofile | sed -n 's/\(total:\).*\([0-9][0-9].[0-9]\)/\1 \2/p'
304-
for f in $$(find . -name "*_junit.xml"); do \
305-
mkdir -p $(JUNIT_PATH)/$$(dirname $$f) ;\
306-
mv $$f $(JUNIT_PATH)/$$(dirname $$f) ;\
307-
done
308301

309302
testunit-bin:
310303
mkdir -p ${TESTBIN_PATH}

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ require (
4040
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
4141
github.com/intel/goresctrl v0.2.0
4242
github.com/json-iterator/go v1.1.12
43-
github.com/onsi/ginkgo v1.16.5
43+
github.com/onsi/ginkgo/v2 v2.1.3
4444
github.com/onsi/gomega v1.17.0
4545
github.com/opencontainers/go-digest v1.0.0
4646
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283
@@ -129,6 +129,7 @@ require (
129129
github.com/google/go-intervals v0.0.2 // indirect
130130
github.com/google/go-querystring v1.0.0 // indirect
131131
github.com/google/gofuzz v1.2.0 // indirect
132+
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
132133
github.com/googleapis/gnostic v0.5.5 // indirect
133134
github.com/gorilla/mux v1.8.0 // indirect
134135
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
@@ -167,8 +168,8 @@ require (
167168
github.com/morikuni/aec v1.0.0 // indirect
168169
github.com/mtrmac/gpgme v0.1.2 // indirect
169170
github.com/nozzle/throttler v0.0.0-20180817012639-2ea982251481 // indirect
170-
github.com/nxadm/tail v1.4.8 // indirect
171171
github.com/olekukonko/tablewriter v0.0.5 // indirect
172+
github.com/onsi/ginkgo v1.16.5 // indirect
172173
github.com/openshift/imagebuilder v1.2.2-0.20210415181909-87f3e48c2656 // indirect
173174
github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913 // indirect
174175
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,8 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe
716716
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
717717
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
718718
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
719+
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
720+
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
719721
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
720722
github.com/google/renameio v1.0.1 h1:Lh/jXZmvZxb0BBeSY5VKEfidcbcbenKjZFzM/q0fSeU=
721723
github.com/google/renameio v1.0.1/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk=
@@ -1052,6 +1054,8 @@ github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISq
10521054
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
10531055
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
10541056
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
1057+
github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc=
1058+
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
10551059
github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
10561060
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
10571061
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=

internal/config/apparmor/apparmor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package apparmor_test
22

33
import (
44
"github.com/cri-o/cri-o/internal/config/apparmor"
5-
. "github.com/onsi/ginkgo"
5+
. "github.com/onsi/ginkgo/v2"
66
. "github.com/onsi/gomega"
77
)
88

internal/config/apparmor/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55

66
. "github.com/cri-o/cri-o/test/framework"
7-
. "github.com/onsi/ginkgo"
7+
. "github.com/onsi/ginkgo/v2"
88
. "github.com/onsi/gomega"
99
)
1010

internal/config/blockio/blockio_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"io/ioutil"
55

66
"github.com/cri-o/cri-o/internal/config/blockio"
7-
. "github.com/onsi/ginkgo"
7+
. "github.com/onsi/ginkgo/v2"
88
. "github.com/onsi/gomega"
99
)
1010

internal/config/blockio/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55

66
. "github.com/cri-o/cri-o/test/framework"
7-
. "github.com/onsi/ginkgo"
7+
. "github.com/onsi/ginkgo/v2"
88
. "github.com/onsi/gomega"
99
)
1010

internal/config/capabilities/capabilities_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package capabilities_test
22

33
import (
44
"github.com/cri-o/cri-o/internal/config/capabilities"
5-
. "github.com/onsi/ginkgo"
5+
. "github.com/onsi/ginkgo/v2"
66
. "github.com/onsi/gomega"
77
)
88

internal/config/capabilities/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55

66
. "github.com/cri-o/cri-o/test/framework"
7-
. "github.com/onsi/ginkgo"
7+
. "github.com/onsi/ginkgo/v2"
88
. "github.com/onsi/gomega"
99
)
1010

0 commit comments

Comments
 (0)