-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Custom flags for test local (no go test ones) #1476
Comments
You should be able to pass the flags to your test using |
@AlexNPavel I was doing that, the |
|
This patch adds `--local-operator-flags` to `operator-sdk test local --up-local` command It is prvides the functionalisty provided by `--operator-flags` flag in `operator-sdk up local --operator-flags` command. At present there is no way to pass command line flags to an operator while testing using `operator-sdk test local --up-local` command. There is a flag `--go-test-flags` but it cannot be used to pass flags to the operator code being tested using `--up-local` flag This resolves operator-framework#1476 : **Custom flags for test local (no go test ones)** Signed-off-by: Nikhil Thomas <[email protected] >
@AlexNPavel this works only if the flag is being used inside the test code. I believe what @smiklosovic is asking for is a way to pass a flag to operator code under test. ie, an equivalent for At present, if we use here: operator-sdk/pkg/test/main_entry.go Line 77 in e9e59c0
|
i have made a PR addressing this issue. |
This patch adds `--operator-flags` to `operator-sdk test local --up-local` command It is prvides the functionalisty provided by `--operator-flags` flag in `operator-sdk up local --operator-flags` command. At present there is no way to pass command line flags to an operator while testing using `operator-sdk test local --up-local` command. There is a flag `--go-test-flags` but it cannot be used to pass flags to the operator code being tested using `--up-local` flag This resolves operator-framework#1476 : **Custom flags for test local (no go test ones)** Signed-off-by: Nikhil Thomas <[email protected] >
This patch adds `--operator-flags` to `operator-sdk test local --up-local` command It is prvides the functionalisty provided by `--operator-flags` flag in `operator-sdk up local --operator-flags` command. At present there is no way to pass command line flags to an operator while testing using `operator-sdk test local --up-local` command. There is a flag `--go-test-flags` but it cannot be used to pass flags to the operator code being tested using `--up-local` flag This resolves operator-framework#1476 : **Custom flags for test local (no go test ones)** Signed-off-by: Nikhil Thomas <[email protected] >
This patch adds `--operator-flags` to `operator-sdk test local --up-local` command It is prvides the functionalisty provided by `--operator-flags` flag in `operator-sdk up local --operator-flags` command. At present there is no way to pass command line flags to an operator while testing using `operator-sdk test local --up-local` command. There is a flag `--go-test-flags` but it cannot be used to pass flags to the operator code being tested using `--up-local` flag This resolves operator-framework#1476 : **Custom flags for test local (no go test ones)** Signed-off-by: Nikhil Thomas <[email protected] >
@nikhil-thomas I want to do something like this https://github.com/operator-framework/operator-sdk/blob/master/test/e2e/main_test.go#L27 On whatever flag, not just image. (after looking on PR it seems like that's what it does!) |
This patch adds `--local-operator-flags` to `operator-sdk test local --up-local` command It is prvides the functionalisty provided by `--operator-flags` flag in `operator-sdk up local --operator-flags` command. At present there is no way to pass command line flags to an operator while testing using `operator-sdk test local --up-local` command. There is a flag `--go-test-flags` but it cannot be used to pass flags to the operator code being tested using `--up-local` flag This resolves operator-framework#1476 : **Custom flags for test local (no go test ones)** Signed-off-by: Nikhil Thomas <[email protected] >
yes, the idea is to pass any flag which is defined in the operator code. my PR adds that functionality to |
This patch adds `--local-operator-flags` to `operator-sdk test local --up-local` command It is prvides the functionalisty provided by `--operator-flags` flag in `operator-sdk up local --operator-flags` command. At present there is no way to pass command line flags to an operator while testing using `operator-sdk test local --up-local` command. There is a flag `--go-test-flags` but it cannot be used to pass flags to the operator code being tested using `--up-local` flag This resolves #1476 : **Custom flags for test local (no go test ones)** Signed-off-by: Nikhil Thomas <[email protected] >
Feature Request
Is your feature request related to a problem? Please describe.
I see there in memcached example in main that you are doing flag.String("image") but this flag is set in stone in operator-sdk in test command.
If I want to add my flag (as I have other properties to set, specific to my test), I can not propagate any to "test local" because operator-sdk and go test itself does not recognise them.
Describe the solution you'd like
I want to be able to specify my own additional flags.
The text was updated successfully, but these errors were encountered: