-
Notifications
You must be signed in to change notification settings - Fork 257
Update api version, vendor & enhance testing #605
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
Merged
openshift-merge-robot
merged 1 commit into
operator-framework:master
from
jchunkins:issue_568
Apr 15, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
# Execute end-to-end tests for local development | ||
jchunkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
To execute the end-to-end (e2e) test suite on your local development system, you have two options: | ||
|
||
1. Use a dynamically generated kind server. Each run of the test suite will automatically start a new kind cluster, | ||
and will be torn down upon completion of tests. | ||
|
||
1. Stand up your own minikube or other cluster and use kubeconfig. This option is good for starting a cluster and keeping it | ||
running even after the test suite has completed. | ||
|
||
## Kind without SSL | ||
|
||
1. Start a registry server without using SSL | ||
|
||
```bash | ||
./scripts/start_registry.sh -s kind-registry | ||
``` | ||
|
||
1. Start the e2e tests: | ||
|
||
```bash | ||
DOCKER_REGISTRY_HOST=localhost:5000 make build e2e SKIPTLS="true" CLUSTER=kind | ||
``` | ||
|
||
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 make build e2e TEST='builds and manipulates bundle and index images' SKIPTLS="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). | ||
|
||
```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 | ||
``` | ||
|
||
## Kind with SSL | ||
|
||
1. Start a registry server with SSL (NOTE: SSL CA root will be installed and server cert/key will be generated) | ||
|
||
```bash | ||
./scripts/start_registry.sh kind-registry | ||
``` | ||
|
||
1. Start the e2e tests: | ||
|
||
```bash | ||
DOCKER_REGISTRY_HOST=localhost:443 make build e2e CLUSTER=kind | ||
``` | ||
|
||
1. Run a specific BDD test using the `TEST` argument to make. Note that this argument uses regular expressions. | ||
|
||
```bash | ||
DOCKER_REGISTRY_HOST=localhost:443 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). | ||
|
||
```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 | ||
``` | ||
|
||
## Minikube (or other type) using kubeconfig without SSL | ||
|
||
1. Install `minikube` (see https://minikube.sigs.k8s.io/docs/start/) | ||
|
||
1. Create a minikube cluster | ||
|
||
```bash | ||
minikube start | ||
``` | ||
|
||
1. Start a registry server without using SSL | ||
|
||
```bash | ||
./scripts/start_registry.sh -s minikube-registry | ||
``` | ||
|
||
1. Start the e2e tests: | ||
|
||
```bash | ||
KUBECONFIG="$HOME/.kube/config" DOCKER_REGISTRY_HOST=localhost:5000 make build e2e SKIPTLS="true" | ||
``` | ||
|
||
1. Run a specific BDD test using the `TEST` argument to make. Note that this argument uses regular expressions. | ||
|
||
```bash | ||
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). | ||
|
||
```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 | ||
``` | ||
|
||
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. Create a minikube cluster | ||
|
||
```bash | ||
minikube start | ||
``` | ||
|
||
1. Start a registry server with SSL (NOTE: SSL CA root will be installed and server cert/key will be generated) | ||
|
||
```bash | ||
./scripts/start_registry.sh minikube-registry | ||
``` | ||
|
||
1. Start the e2e tests: | ||
|
||
```bash | ||
KUBECONFIG="$HOME/.kube/config" DOCKER_REGISTRY_HOST=localhost:443 make build e2e | ||
``` | ||
|
||
1. Run a specific BDD test using the `TEST` argument to make. Note that this argument uses regular expressions. | ||
|
||
```bash | ||
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). | ||
|
||
```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 | ||
``` | ||
|
||
TIP: use a non-dynamic `kind` server by using `kind get kubeconfig --name "kind" > /tmp/kindconfig` and set `KUBECONFIG="/tmp/kindconfig"` | ||
|
||
## Known Limitations | ||
|
||
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`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.