-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add --local-operator-flags for testing with --up-local #1509
Add --local-operator-flags for testing with --up-local #1509
Conversation
--local-operator-flags
in for testing with --up-local
e87e94f
to
989c646
Compare
989c646
to
e0fbbb5
Compare
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 <nikthoma@redhat.com >
e0fbbb5
to
f97341c
Compare
it would be nice to see this merged in! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This needs some E2E tests to make sure we don't accidentally break the functionality later, but we can handle that in a separate PR.
true, I shall add an e2e test in a different PR. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! lgtm
operator-sdk test : add
--local-operator-flags
tooperator-sdk test local --up-local
commandwhy this change was made: without this flag, we cannot write tests to test operator code that uses command line flags. A flag like this is already there in
operator-sdk up local
command (--operator-flags
).Fixes #1476
Description of the change:
This patch adds
--local-operator-flags
tooperator-sdk test local --up-local
commandIt is provides the functionality provided by
--operator-flags
flag inoperator-sdk up local --operator-flags
command.Motivation for the change:
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 tothe operator code being tested using
--up-local
flagSigned-off-by: Nikhil Thomas <nikthoma@redhat.com >