Skip to content
Merged
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ clean:

.PHONY: e2e
e2e:
$(GO) run github.com/onsi/ginkgo/ginkgo --v --randomizeAllSpecs --randomizeSuites --race $(if $(TEST),-focus '$(TEST)') $(TAGS) ./test/e2e -- $(if $(SKIPTLS),-skip-tls-verify true) $(if $(USEHTTP),-use-http true)

$(GO) run github.com/onsi/ginkgo/v2/ginkgo --v --randomize-all --progress --trace --randomize-suites --race $(if $(TEST),-focus '$(TEST)') $(TAGS) ./test/e2e -- $(if $(SKIPTLS),-skip-tls-verify true) $(if $(USEHTTP),-use-http true)

.PHONY: release
export OPM_IMAGE_REPO ?= quay.io/operator-framework/opm
Expand Down
32 changes: 16 additions & 16 deletions docs/contributors/e2e_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ running even after the test suite has completed.
1. Run a specific BDD test using the `TEST` argument to make. Note that this argument uses regular expressions.

```bash
DOCKER_REGISTRY_HOST=localhost:5000 GOENV='GOOS=linux' make build e2e TEST='builds and manipulates bundle and index images' USEHTTP="true" CLUSTER=kind
DOCKER_REGISTRY_HOST=localhost:5000 GOENV='GOOS=linux' make build e2e TEST='builds and manipulates bundle and index images' USEHTTP="true" CLUSTER=kind
```

1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the
make file and use `-dryRun` with `-focus` and see if the regex would trigger your specific test(s).
1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the
make file and use `--dry-run` with `--focus` and see if the regex would trigger your specific test(s).

```bash
GOFLAGS="-mod=vendor" go run github.com/onsi/ginkgo/ginkgo --v --randomizeAllSpecs --randomizeSuites --race -dryRun -focus 'builds and manipulates bundle and index images' -tags=json1,kind ./test/e2e
GOFLAGS="-mod=vendor" go run github.com/onsi/ginkgo/v2/ginkgo --v --randomize-all --randomize-suites --race --dry-run --focus 'builds and manipulates bundle and index images' -tags=json1,kind ./test/e2e
```

## Kind with SSL
Expand All @@ -55,16 +55,16 @@ make file and use `-dryRun` with `-focus` and see if the regex would trigger you
DOCKER_REGISTRY_HOST=localhost:443 GOENV='GOOS=linux' make build e2e TEST='builds and manipulates bundle and index images' CLUSTER=kind
```

1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the
make file and use `-dryRun` with `-focus` and see if the regex would trigger your specific test(s).
1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the
make file and use `--dry-run` with `--focus` and see if the regex would trigger your specific test(s).

```bash
GOFLAGS="-mod=vendor" go run github.com/onsi/ginkgo/ginkgo --v --randomizeAllSpecs --randomizeSuites --race -dryRun -focus 'builds and manipulates bundle and index images' -tags=json1,kind ./test/e2e
GOFLAGS="-mod=vendor" go run github.com/onsi/ginkgo/v2/ginkgo --v --randomize-all --randomize-suites --race --dry-run --focus 'builds and manipulates bundle and index images' -tags=json1,kind ./test/e2e
```

## Minikube (or other type) using kubeconfig without SSL

1. Install `minikube` (see https://minikube.sigs.k8s.io/docs/start/)
1. Install [`minikube`](https://minikube.sigs.k8s.io/docs/start/)

1. Create a minikube cluster

Expand All @@ -90,18 +90,18 @@ make file and use `-dryRun` with `-focus` and see if the regex would trigger you
KUBECONFIG="$HOME/.kube/config" DOCKER_REGISTRY_HOST=localhost:5000 make build e2e TEST='builds and manipulates bundle and index images' SKIPTLS="true"
```

1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the
make file and use `-dryRun` with `-focus` and see if the regex would trigger your specific test(s).
1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the
make file and use `--dry-run` with `--focus` and see if the regex would trigger your specific test(s).

```bash
GOFLAGS="-mod=vendor" go run github.com/onsi/ginkgo/ginkgo --v --randomizeAllSpecs --randomizeSuites --race -dryRun -focus 'builds and manipulates bundle and index images' -tags=json1 ./test/e2e
GOFLAGS="-mod=vendor" go run github.com/onsi/ginkgo/v2/ginkgo --v --randomize-all --randomize-suites --race --dry-run --focus 'builds and manipulates bundle and index images' -tags=json1 ./test/e2e
```

TIP: use a non-dynamic `kind` server by using `kind get kubeconfig --name "kind" > /tmp/kindconfig` and set `KUBECONFIG="/tmp/kindconfig"`

## Minikube (or other type) using kubeconfig with SSL

1. Install `minikube` (see https://minikube.sigs.k8s.io/docs/start/)
1. Install [`minikube`](https://minikube.sigs.k8s.io/docs/start/)

1. Create a minikube cluster

Expand All @@ -127,11 +127,11 @@ TIP: use a non-dynamic `kind` server by using `kind get kubeconfig --name "kind"
KUBECONFIG="$HOME/.kube/config" DOCKER_REGISTRY_HOST=localhost:443 make build e2e TEST='builds and manipulates bundle and index images'
```

1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the
make file and use `-dryRun` with `-focus` and see if the regex would trigger your specific test(s).
1. If you want a quick way to ensure that your TEST regex argument will work, you can bypass the
make file and use `--dry-run` with `--focus` and see if the regex would trigger your specific test(s).

```bash
GOFLAGS="-mod=vendor" go run github.com/onsi/ginkgo/ginkgo --v --randomizeAllSpecs --randomizeSuites --race -dryRun -focus 'builds and manipulates bundle and index images' -tags=json1 ./test/e2e
GOFLAGS="-mod=vendor" go run github.com/onsi/ginkgo/v2/ginkgo --v --randomize-all --randomize-suites --race --dry-run --focus 'builds and manipulates bundle and index images' -tags=json1 ./test/e2e
```

TIP: use a non-dynamic `kind` server by using `kind get kubeconfig --name "kind" > /tmp/kindconfig` and set `KUBECONFIG="/tmp/kindconfig"`
Expand All @@ -140,4 +140,4 @@ TIP: use a non-dynamic `kind` server by using `kind get kubeconfig --name "kind"

Currently the test case `Launch bundle` in test/e2e/bundle_image_test.go assumes that the `opm` executable used in the test is compiled for linux.
If you run this test on a darwin environment, the kube job will not succeed unless you manually cross compile for linux and include
the binary at `bin/opm`.
the binary at `bin/opm`.
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/mattn/go-sqlite3 v1.14.10
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
github.com/mitchellh/hashstructure/v2 v2.0.2
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.1.3
github.com/onsi/gomega v1.18.1
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.2
Expand Down Expand Up @@ -80,7 +80,6 @@ require (
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.2.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/garyburd/redigo v1.6.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.1.0 // indirect
Expand All @@ -97,6 +96,7 @@ require (
github.com/google/cel-go v0.10.1 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/gorilla/handlers v1.4.2 // indirect
github.com/gorilla/mux v1.8.0 // indirect
Expand All @@ -121,7 +121,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
Expand Down Expand Up @@ -159,7 +158,6 @@ require (
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apiserver v0.24.0 // indirect
Expand Down
7 changes: 3 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
github.com/fsouza/fake-gcs-server v1.7.0/go.mod h1:5XIRs4YvwNbNoz+1JF8j6KLAyDh7RHGAyAK3EP2EsNk=
github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
Expand Down Expand Up @@ -416,6 +415,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 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
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/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
Expand Down Expand Up @@ -616,9 +616,9 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
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.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ=
github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
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-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
Expand Down Expand Up @@ -1078,7 +1078,6 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
9 changes: 4 additions & 5 deletions test/e2e/bundle_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
"strings"
"time"

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

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -88,7 +87,7 @@ var _ = Describe("Launch bundle", func() {
initImage := dockerHost + "/olmtest/init-operator-manifest:test"

Context("Deploy bundle job", func() {
table.DescribeTable("should populate specified configmap", func(bundleName, bundleDirectory string, gzip bool) {
DescribeTable("should populate specified configmap", func(bundleName, bundleDirectory string, gzip bool) {
// these permissions are only necessary for the e2e (and not OLM using the feature)
By("configuring configmap service account")
kubeclient, err := kubernetes.NewForConfig(ctx.Ctx().RESTConfig())
Expand Down Expand Up @@ -228,8 +227,8 @@ var _ = Describe("Launch bundle", func() {
Expect(err).NotTo(HaveOccurred())
},

table.Entry("Small bundle, uncompressed", "kiali.1.4.2", "testdata/bundles/kiali.1.4.2", false),
table.Entry("Large bundle, compressed", "redis.0.4.0", "testdata/bundles/redis.0.4.0", true),
Entry("Small bundle, uncompressed", "kiali.1.4.2", "testdata/bundles/kiali.1.4.2", false),
Entry("Large bundle, compressed", "redis.0.4.0", "testdata/bundles/redis.0.4.0", true),
)
})
})
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/ctx/ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
Expand Down Expand Up @@ -39,7 +39,7 @@ func (ctx TestContext) Logf(f string, v ...interface{}) {
if !strings.HasSuffix(f, "\n") {
f += "\n"
}
fmt.Fprintf(GinkgoWriter, f, v...)
_, _ = fmt.Fprintf(GinkgoWriter, f, v...)
}

func (ctx TestContext) Scheme() *runtime.Scheme {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os/exec"
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/spf13/cobra"

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/opm_bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"path/filepath"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"golang.org/x/mod/sumdb/dirhash"

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/opm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"path/filepath"
"reflect"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/otiai10/copy"
"github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package tools
import (
_ "github.com/grpc-ecosystem/grpc-health-probe"
_ "github.com/maxbrunsfeld/counterfeiter/v6"
_ "github.com/onsi/ginkgo/ginkgo"
_ "github.com/onsi/ginkgo/v2/ginkgo"
_ "google.golang.org/grpc/cmd/protoc-gen-go-grpc"
_ "google.golang.org/protobuf/cmd/protoc-gen-go"
)
12 changes: 0 additions & 12 deletions vendor/github.com/fsnotify/fsnotify/.editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/fsnotify/fsnotify/.gitattributes

This file was deleted.

6 changes: 0 additions & 6 deletions vendor/github.com/fsnotify/fsnotify/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/fsnotify/fsnotify/.mailmap

This file was deleted.

62 changes: 0 additions & 62 deletions vendor/github.com/fsnotify/fsnotify/AUTHORS

This file was deleted.

Loading