[id="osdk-cli-reference-test_{context}"]
= test

The `operator-sdk test` command can test the Operator locally.

== local

The `local` subcommand runs Go tests built using the test framework of the
Operator SDK locally.

.`test local` arguments
[options="header",cols="1,3"]
|===
|Arguments |Description

|`<test_location>` (string)
|Location of e2e test files (e.g., `./test/e2e/`).
|===

.`test local` flags
[options="header",cols="1,3"]
|===
|Flags |Description

|`--kubeconfig` (string)
|Location of `kubeconfig` for a cluster. Default: `~/.kube/config`.

|`--global-manifest` (string)
|Path to manifest for global resources. Default: `deploy/crd.yaml`.

|`--namespaced-manifest` (string)
|Path to manifest for per-test, namespaced resources. Default: combines
`deploy/service_account.yaml`, `deploy/rbac.yaml`, and `deploy/operator.yaml`.

|`--namespace` (string)
|If non-empty, a single namespace to run tests in (e.g., `operator-test`).
Default: `""`

|`--go-test-flags` (string)
|Extra arguments to pass to `go test` (e.g., `-f "-v -parallel=2"`).

|`--up-local`
|Enable running the Operator locally with `go run` instead of as an image in the
cluster.

|`--no-setup`
|Disable test resource creation.

|`--image` (string)
|Use a different Operator image from the one specified in the namespaced
manifest.

|`-h, --help`
|Usage help output.
|===

For example:

[source,terminal]
----
$ operator-sdk test local ./test/e2e/
----

.Example output
[source,terminal]
----
ok  	github.com/operator-framework/operator-sdk-samples/memcached-operator/test/e2e	20.410s
----
