Update Docs With Incluster Testing Support#526
Conversation
|
|
||
| The operator-sdk build command compiles the code, builds the executables, | ||
| and generates Kubernetes manifests. After build completes, the image would be built locally in docker. Then it needs to be pushed to remote registry. | ||
| The operator-sdk build command compiles the code and builds the executables. After build completes, the image is built locally in docker. Then it needs to be pushed to remote registry. |
There was a problem hiding this comment.
pushed to a remote registry
| and generates Kubernetes manifests. After build completes, the image would be built locally in docker. Then it needs to be pushed to remote registry. | ||
| The operator-sdk build command compiles the code and builds the executables. After build completes, the image is built locally in docker. Then it needs to be pushed to remote registry. | ||
|
|
||
| If `--enable-tests` is set, the buld command will also build the testing binary and add it to the docker image. |
| ##### Flags | ||
| * `-k, --kubeconfig` string - location of kubeconfig for kubernetes cluster | ||
| * `-g, --global-init` string - location of global resource manifest yaml file | ||
| * `-n, --namespaced-init` string - location of namespaced resource manifest yaml file |
There was a problem hiding this comment.
We need to revise the flags a bit to make them consistent.
Let's get rid of short flags to avoid naming collisions.
And change:
namespaced-inittonamespaced-manifestglobal-inittoglobal-manifest- Keep
--namespaceas the flag for running the tests in a single namespace
30ae025 to
c435bae
Compare
|
Rebased due to weird travis config issues |
|
PR for flags: #528 |
a83b8a0 to
c435bae
Compare
c435bae to
2218b72
Compare
|
/cc @hasbro17 @fanminshi |
| * `--kubeconfig` string - location of kubeconfig for kubernetes cluster | ||
| * `--image-pull-policy` string - set test pod image pull policy. Allowed values: Always, Never (default "Always") | ||
| * `--namespace` string - namespace to run tests in (default "default") | ||
| * `--pending-timeout` int - timeout for testing pod in pending state (default 60) |
There was a problem hiding this comment.
timeout in seconds for the testing pod to stay in pending state (default 60s)
| ok github.com/operator-framework/operator-sdk-samples/memcached-operator/test/e2e 20.410s | ||
| ``` | ||
|
|
||
| #### cluster - Runs the tests within a cluster |
There was a problem hiding this comment.
cluster
Runs the e2e tests packaged in an operator image as a pod in the cluster
Args
<image>the operator image that is used to run the tests in a pod
| * `-n, --namespaced-init` string - location of namespaced resource manifest yaml file | ||
| * `-f, --go-test-flags` string - extra arguments to pass to `go test` (e.g. -f "-v -parallel=2") | ||
| * `-h, --help` - help for test | ||
| #### local - Runs the tests locally |
There was a problem hiding this comment.
Args
<test-location>location of e2e test files e.g "./test/e2e"
| ##### Flags | ||
| * `--kubeconfig` string - location of kubeconfig for kubernetes cluster | ||
| * `--global-manifest` string - location of global resource manifest yaml file | ||
| * `--namespaced-manifest` string - location of namespaced resource manifest yaml file |
There was a problem hiding this comment.
Let's clearly specify the defaults for all these flags here. Especially the --namespaced-manifest flag which combines the expected files deploy/sa.yaml,deploy/rbac.yaml and deploy/operator.yaml.
| and generates Kubernetes manifests. After build completes, the image would be built locally in docker. Then it needs to be pushed to remote registry. | ||
| The operator-sdk build command compiles the code and builds the executables. After build completes, the image is built locally in docker. Then it needs to be pushed to a remote registry. | ||
|
|
||
| If `--enable-tests` is set, the build command will also build the testing binary and add it to the docker image. |
There was a problem hiding this comment.
Mention that this also creates an example deploy/test-pod.yaml that you can use to run the image as a test-pod.
a3bda38 to
4d0c2e2
Compare
| Test Successfully Completed | ||
| ``` | ||
|
|
||
| If the tests fail, the command will output the errors in the standard `go test` loggin/error format. |
There was a problem hiding this comment.
How about a little clarification on how the command actually runs the test. So its clear how this is different from test local. e.g:
The test command will deploy a test pod in the given namespace that will run the e2e tests packaged in the image.
The command will wait until the tests succeed(pod phase=Succeeded ) or fail(pod phase=Failed ).
If the tests fail, the command will output the test pod logs which should be the standard go test error logs.
|
LGTM after nit. |
* doc/test-framework: update test framework walkthrough * doc/sdk-cli-reference.md: update for incluster testing support
Updates docs to match changes made in #469