Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] vendor, tests, Bump to ginkgo v2 #362

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions automation/check-patch.e2e-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

teardown() {
make cluster-down
cp $(find . -name "*junit*.xml") $ARTIFACTS || true
}

main() {
Expand All @@ -17,7 +16,7 @@ main() {
make cluster-up
trap teardown EXIT SIGINT SIGTERM SIGSTOP
make cluster-sync
make E2E_TEST_ARGS="-ginkgo.noColor --junit-output=$ARTIFACTS/junit.functest.xml" functest
make E2E_TEST_ARGS="-ginkgo.noColor --output-dir=$ARTIFACTS --junit-report=junit.functest.xml" functest
}

[[ "${BASH_SOURCE[0]}" == "$0" ]] && main "$@"
6 changes: 0 additions & 6 deletions automation/check-patch.unit-test.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#!/bin/bash -e

teardown() {
Copy link
Member

@oshoval oshoval Jun 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove line 11 please then

cp $(find . -name "*junit*.xml") $ARTIFACTS || true
}

main() {
source automation/check-patch.setup.sh
cd ${TMP_PROJECT_PATH}

trap teardown EXIT SIGINT SIGTERM SIGSTOP

make all
make check
make test
Expand Down
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/go-logr/logr v1.2.0
github.com/intel/multus-cni v0.0.0-20200316125841-bfaf22964b51
github.com/mattn/goveralls v0.0.7
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.1.3
github.com/onsi/gomega v1.17.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.1
Expand All @@ -18,7 +18,6 @@ require (
k8s.io/code-generator v0.23.1
kubevirt.io/client-go v0.37.1
kubevirt.io/kubevirt v0.37.1
kubevirt.io/qe-tools v0.1.6
sigs.k8s.io/controller-runtime v0.11.1
sigs.k8s.io/controller-tools v0.6.0
sigs.k8s.io/kustomize/kustomize/v3 v3.3.0
Expand Down Expand Up @@ -58,7 +57,6 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/openshift/custom-resource-status v0.0.0-20200602122900-c002fd1547ca // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
Expand All @@ -81,7 +79,6 @@ require (
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apiextensions-apiserver v0.23.1 // indirect
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v0.0.0-20170306145142-6a5e28554805/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down Expand Up @@ -670,6 +671,8 @@ github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvw
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc=
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.2-0.20180831124310-ae19f1b56d53/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
Expand Down
2 changes: 1 addition & 1 deletion hack/functest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -xe
source ./cluster/cluster.sh

export KUBEVIRT_CLIENT_GO_SCHEME_REGISTRATION_VERSION=v1
KUBECONFIG=${KUBECONFIG:-$(cluster::kubeconfig)} $GO test -test.timeout=1h -race -test.v ./tests/... $E2E_TEST_ARGS -ginkgo.v --test-suite-params="$POLARION_TEST_SUITE_PARAMS"
KUBECONFIG=${KUBECONFIG:-$(cluster::kubeconfig)} $GO test ./tests/... -test.timeout=2h --ginkgo.timeout=2h -race -test.v $E2E_TEST_ARGS -ginkgo.v
2 changes: 1 addition & 1 deletion pkg/names/names_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package names
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/names/names_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"reflect"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
41 changes: 20 additions & 21 deletions pkg/pool-manager/macentry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import (
"fmt"
"time"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down Expand Up @@ -60,39 +59,39 @@ var _ = Describe("mac-entry", func() {
macAddress string
shouldSucceed bool
}
table.DescribeTable("and performing hasExpiredTransaction on macPoolMap entry",
DescribeTable("and performing hasExpiredTransaction on macPoolMap entry",
func(i *hasExpiredTransactionParams) {
entry := poolManager.macPoolMap[i.macAddress]
isStale, err := entry.hasExpiredTransaction(poolManager.waitTime)
Expect(err).ToNot(HaveOccurred(), "hasExpiredTransaction should not return error")
Expect(isStale).To(Equal(i.shouldSucceed), fmt.Sprintf("mac entry %s staleness status is not as expected", i.macAddress))
},
table.Entry("Should find all stale entries in macPoolMap on entry mac: 02:00:00:00:00:00",
Entry("Should find all stale entries in macPoolMap on entry mac: 02:00:00:00:00:00",
&hasExpiredTransactionParams{
macAddress: "02:00:00:00:00:00",
shouldSucceed: false,
}),
table.Entry("Should find all stale entries in macPoolMap on entry mac: 02:00:00:00:00:01",
Entry("Should find all stale entries in macPoolMap on entry mac: 02:00:00:00:00:01",
&hasExpiredTransactionParams{
macAddress: "02:00:00:00:00:01",
shouldSucceed: true,
}),
table.Entry("Should find all stale entries in macPoolMap on entry mac: mac: 02:00:00:00:00:02",
Entry("Should find all stale entries in macPoolMap on entry mac: mac: 02:00:00:00:00:02",
&hasExpiredTransactionParams{
macAddress: "02:00:00:00:00:02",
shouldSucceed: false,
}),
table.Entry("Should find all stale entries in macPoolMap on entry mac: mac: 02:00:00:00:00:03",
Entry("Should find all stale entries in macPoolMap on entry mac: mac: 02:00:00:00:00:03",
&hasExpiredTransactionParams{
macAddress: "02:00:00:00:00:03",
shouldSucceed: true,
}),
table.Entry("Should find all stale entries in macPoolMap on entry mac: mac: 02:00:00:00:00:04",
Entry("Should find all stale entries in macPoolMap on entry mac: mac: 02:00:00:00:00:04",
&hasExpiredTransactionParams{
macAddress: "02:00:00:00:00:04",
shouldSucceed: false,
}),
table.Entry("Should find all stale entries in macPoolMap on entry mac: mac: 02:00:00:00:00:05",
Entry("Should find all stale entries in macPoolMap on entry mac: mac: 02:00:00:00:00:05",
&hasExpiredTransactionParams{
macAddress: "02:00:00:00:00:05",
shouldSucceed: false,
Expand All @@ -103,38 +102,38 @@ var _ = Describe("mac-entry", func() {
macAddress string
shouldSucceed bool
}
table.DescribeTable("and performing hasPendingTransaction on macPoolMap entry",
DescribeTable("and performing hasPendingTransaction on macPoolMap entry",
func(i *hasPendingTransactionParams) {
entry := poolManager.macPoolMap[i.macAddress]
hasPendingTransaction := entry.hasPendingTransaction()
Expect(hasPendingTransaction).To(Equal(i.shouldSucceed), fmt.Sprintf("mac entry %s update required status is not as expected", i.macAddress))
},
table.Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:00",
Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:00",
&hasPendingTransactionParams{
macAddress: "02:00:00:00:00:00",
shouldSucceed: true,
}),
table.Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:01",
Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:01",
&hasPendingTransactionParams{
macAddress: "02:00:00:00:00:01",
shouldSucceed: true,
}),
table.Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:02",
Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:02",
&hasPendingTransactionParams{
macAddress: "02:00:00:00:00:02",
shouldSucceed: true,
}),
table.Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:03",
Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:03",
&hasPendingTransactionParams{
macAddress: "02:00:00:00:00:03",
shouldSucceed: true,
}),
table.Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:04",
Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:04",
&hasPendingTransactionParams{
macAddress: "02:00:00:00:00:04",
shouldSucceed: true,
}),
table.Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:05",
Entry("Should distinguish between entries that needs update on mac entry: 02:00:00:00:00:05",
&hasPendingTransactionParams{
macAddress: "02:00:00:00:00:05",
shouldSucceed: false,
Expand All @@ -146,31 +145,31 @@ var _ = Describe("mac-entry", func() {
latestPersistedTimestamp *time.Time
expectedEntryReadiness bool
}
table.DescribeTable("and performing hasReadyTransaction on macPoolMap",
DescribeTable("and performing hasReadyTransaction on macPoolMap",
func(i *hasReadyTransactionParams) {
entry := poolManager.macPoolMap[i.macAddress]
isUpdated := entry.hasReadyTransaction(i.latestPersistedTimestamp)
Expect(isUpdated).To(Equal(i.expectedEntryReadiness), fmt.Sprintf("should get expected readiness on mac %s", i.macAddress))
},
table.Entry("Should deem mac entry with old timestamp as ready if persistent timestamp occurred after it",
Entry("Should deem mac entry with old timestamp as ready if persistent timestamp occurred after it",
&hasReadyTransactionParams{
macAddress: "02:00:00:00:00:01",
latestPersistedTimestamp: &timestampBeforeCurrentTimestamp,
expectedEntryReadiness: true,
}),
table.Entry("Should deem mac entry with current timestamp as ready if persistent timestamp occurred after it",
Entry("Should deem mac entry with current timestamp as ready if persistent timestamp occurred after it",
&hasReadyTransactionParams{
macAddress: "02:00:00:00:00:02",
latestPersistedTimestamp: &newTimestamp,
expectedEntryReadiness: true,
}),
table.Entry("Should deem mac entry with current timestamp as ready if persistent timestamp equals to it",
Entry("Should deem mac entry with current timestamp as ready if persistent timestamp equals to it",
&hasReadyTransactionParams{
macAddress: "02:00:00:00:00:02",
latestPersistedTimestamp: &currentTimestamp,
expectedEntryReadiness: true,
}),
table.Entry("Should deem mac entry with current timestamp as not ready if persistent timestamp occurred before it",
Entry("Should deem mac entry with current timestamp as not ready if persistent timestamp occurred before it",
&hasReadyTransactionParams{
macAddress: "02:00:00:00:00:02",
latestPersistedTimestamp: &timestampBeforeCurrentTimestamp,
Expand Down
Loading