Skip to content
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

Merged
merged 13 commits into from
Nov 30, 2018

Conversation

AlexNPavel
Copy link
Contributor

Description of the change: Add --up-local flag to the test local subcommand

Motivation for the change: See #745

Resolves #745

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 27, 2018
var localCmd *exec.Cmd
var localCmdOutBuf, localCmdErrBuf bytes.Buffer
if *localOperator {
// taken from commands/operator-sdk/cmd/up/local.go
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 27, 2018
@@ -0,0 +1,65 @@
package main
Copy link
Contributor

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.

Copy link
Contributor Author

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).

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, thank you @AlexNPavel

Copy link
Member

@estroz estroz left a 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.

pkg/test/main_entry.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ravisantoshgudimetla ravisantoshgudimetla left a 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.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 29, 2018
@ravisantoshgudimetla
Copy link
Contributor

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?

@AlexNPavel
Copy link
Contributor Author

@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

@ravisantoshgudimetla
Copy link
Contributor

Got it, I was assuming that this will be part of cli doc.

@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 29, 2018
Copy link
Contributor

@hasbro17 hasbro17 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants