Skip to content

Update Docs With Incluster Testing Support#526

Merged
AlexNPavel merged 9 commits into
operator-framework:masterfrom
AlexNPavel:incluster-docs
Sep 26, 2018
Merged

Update Docs With Incluster Testing Support#526
AlexNPavel merged 9 commits into
operator-framework:masterfrom
AlexNPavel:incluster-docs

Conversation

@AlexNPavel
Copy link
Copy Markdown
Contributor

Updates docs to match changes made in #469

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 25, 2018
Comment thread doc/sdk-cli-reference.md Outdated

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pushed to a remote registry

Comment thread doc/sdk-cli-reference.md Outdated
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

buld ==> build

@AlexNPavel AlexNPavel changed the title Update Docs With Incluster Testing Support [WIP] Update Docs With Incluster Testing Support Sep 25, 2018
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 25, 2018
Comment thread doc/sdk-cli-reference.md Outdated
##### 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-init to namespaced-manifest
  • global-init to global-manifest
  • Keep --namespace as the flag for running the tests in a single namespace

@AlexNPavel
Copy link
Copy Markdown
Contributor Author

Rebased due to weird travis config issues

@AlexNPavel
Copy link
Copy Markdown
Contributor Author

PR for flags: #528

@AlexNPavel AlexNPavel changed the title [WIP] Update Docs With Incluster Testing Support Update Docs With Incluster Testing Support Sep 25, 2018
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 25, 2018
@AlexNPavel
Copy link
Copy Markdown
Contributor Author

/cc @hasbro17 @fanminshi

Comment thread doc/sdk-cli-reference.md Outdated
* `--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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

timeout in seconds for the testing pod to stay in pending state (default 60s)

Comment thread doc/sdk-cli-reference.md Outdated
ok github.com/operator-framework/operator-sdk-samples/memcached-operator/test/e2e 20.410s
```

#### cluster - Runs the tests within a cluster
Copy link
Copy Markdown
Contributor

@hasbro17 hasbro17 Sep 25, 2018

Choose a reason for hiding this comment

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

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

Comment thread doc/sdk-cli-reference.md Outdated
* `-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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Args
  • <test-location> location of e2e test files e.g "./test/e2e"

Comment thread doc/sdk-cli-reference.md Outdated
##### 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread doc/sdk-cli-reference.md Outdated
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mention that this also creates an example deploy/test-pod.yaml that you can use to run the image as a test-pod.

Comment thread doc/test-framework/writing-e2e-tests.md Outdated
Test Successfully Completed
```

If the tests fail, the command will output the errors in the standard `go test` loggin/error format.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@hasbro17
Copy link
Copy Markdown
Contributor

LGTM after nit.

@AlexNPavel AlexNPavel merged commit 7818fd7 into operator-framework:master Sep 26, 2018
@AlexNPavel AlexNPavel deleted the incluster-docs branch September 26, 2018 20:54
johnkim76 pushed a commit to johnkim76/operator-sdk that referenced this pull request Sep 27, 2018
* doc/test-framework: update test framework walkthrough

* doc/sdk-cli-reference.md: update for incluster testing support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants