-
Notifications
You must be signed in to change notification settings - Fork 243
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
Fix odo config view #5234
Fix odo config view #5234
Conversation
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
@anandrkskd that's a nice catch and looks like an elegant fix to me. I have just one question - do you think adding a test would help so that we don't end up having a regression some day? I am inclined to a "yes", but I'll leave it up to you. And thanks for the code contribution! 👍🏾 |
I agree, I will add a test for this ASAP. |
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
It("should pass if devfile is present in current dir", func() { | ||
helper.Chdir(commonVar.Context) | ||
cmpName := helper.RandString(6) | ||
helper.Cmd("odo", "create", cmpName, "--devfile", helper.GetExamplePath("source", "devfiles", "nodejs", "devfile.yaml")).ShouldPass() | ||
out := helper.Cmd("odo", "config", "view").ShouldPass().Out() | ||
helper.MatchAllInOutput(out, []string{"runtime", "Memory: 1024Mi"}) | ||
}) |
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.
IMO, it's sufficient to have failure test in this case because other parts of this test file are executing odo config view
in some form, and hence the success case is being implicitly tested.
I'm more of "explicit is better than implicit" person, but every extra integration test adds to our already slow integration test suite, so I'm fine with implicit nature here.
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 we should have this case as this is different from what we are testing in the other test case. Also, this test case will not take much time to execute, for me, it passed withing 6-8 seconds.
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feloy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* fix odo config view Signed-off-by: anandrkskd <anandrkskd@gmail.com> * add test for odo config view Signed-off-by: anandrkskd <anandrkskd@gmail.com> * use genericclioptions.New Signed-off-by: anandrkskd <anandrkskd@gmail.com> * update failcase check Signed-off-by: anandrkskd <anandrkskd@gmail.com> * remove commented code Signed-off-by: anandrkskd <anandrkskd@gmail.com>
Signed-off-by: anandrkskd anandrkskd@gmail.com
What type of PR is this?
/kind bug
What does this PR do / why we need it:
Current
odo config view
fails if we run this command in a dir not containing devfile.This PR fixes
odo config view
command for any directory not containing devfile.Which issue(s) this PR fixes:
Fixes #?
PR acceptance criteria:
Unit test
Integration test
Documentation
I have read the test guidelines
How to test changes / Special notes to the reviewer:
Steps to test changes
How to Reproduce the failure