-
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
commands/.../test,pkg/test: add --up-local flag to test local #781
commands/.../test,pkg/test: add --up-local flag to test local #781
Conversation
df05974
to
1a24910
Compare
var localCmd *exec.Cmd | ||
var localCmdOutBuf, localCmdErrBuf bytes.Buffer | ||
if *localOperator { | ||
// taken from commands/operator-sdk/cmd/up/local.go |
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.
I think, this block could be moved to a separate file(like utils) and use it from there.
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.
There are a couple of small differences between the cmd/up/local code and this that make a generic function a little bit complicated. For now I think leaving this "as is" is fine and works, but I will make a TODO for that in the code and look into deduplicating this later.
@@ -0,0 +1,65 @@ | |||
package main |
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.
Not sure, if it makes sense to add this in test-framework. I'd rather have this in test/e2e directory so that we are clear that this is part of test suite not framework as such or else it may confuse new developers contributing to the repo.
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.
The way that the repo is designed, users shouldn't be using anything outside of pkg
for use as a library. The test
directory is where we keep all of the SDK's own tests and we further divided it based on what we are testing. e2e
contains our e2e tests and uses its own framework (which is similar to the exposed framework in pkg/test
but slightly modified). We have the test-framework
directory containing our tests to make sure the test-framework works properly, just like we have the ansible-memcached
directory there to test the ansible operator.
We make it pretty clear in the documentation that the test framework is in pkg/test
, so I believe the layout that we currently have with test/test-framework
is reasonable (and we've had this directory since the test framework was introduced and it doesn't seem like that has caused any problems so far).
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.
Alright, thank you @AlexNPavel
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 after other comments are addressed.
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
Thank you @AlexNPavel for quick turnaround.
Ohh forgot to mention, can we have an example in doc on how to use it? Perhaps as a separate PR, if not possible within this? |
@ravisantoshgudimetla This PR updates the Writing E2E Tests doc with a quick example of how to use it: https://github.com/operator-framework/operator-sdk/pull/781/files#diff-59ad6a5ff59239f33497d6206b778c43 |
Got it, I was assuming that this will be part of cli doc. |
New changes are detected. LGTM label has been removed. |
Co-Authored-By: AlexNPavel <[email protected]>
test/test-framework/pkg/controller/memcached/memcached_controller_test.go
Outdated
Show resolved
Hide resolved
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
Description of the change: Add
--up-local
flag to thetest local
subcommandMotivation for the change: See #745
Resolves #745