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

Inconsistency in odo command exit code #1803

Closed
amitkrout opened this issue Jun 11, 2019 · 3 comments · Fixed by #1919
Closed

Inconsistency in odo command exit code #1803

amitkrout opened this issue Jun 11, 2019 · 3 comments · Fixed by #1919
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).

Comments

@amitkrout
Copy link
Contributor

[kind/bug]

What versions of software are you using?

  • Operating System: All supported platform
  • Output of odo version: master

How did you run odo exactly?

$ odo app describe test
 ✗  Application test has no components or services deployed.
Amits-MacBook-Pro:odo amit$ echo $?
0
Amits-MacBook-Pro:odo amit$ odo app delete test -f
 ✗  test app does not exists
Amits-MacBook-Pro:odo amit$ echo $?
1

Actual behavior

Inconsistent exit code

Expected behavior

Exit code should be consistent through out the odo command/sub-command execution. For example:

On a fresh cluster odo app describe test returns 0 (graceful exit) where as odo app delete test -f returns 1.

In both the case either it should be 0 (graceful exit) or non-zero otherwise.

Any logs, error output, etc?

@amitkrout amitkrout added kind/bug Categorizes issue or PR as related to a bug. priority/Medium Nice to have issue. Getting it done before priority changes would be great. labels Jun 11, 2019
@amitkrout
Copy link
Contributor Author

ping @kadel

@kadel
Copy link
Member

kadel commented Jun 11, 2019

If commands results in error, return code needs to be non-zero.

@amitkrout
Copy link
Contributor Author

amitkrout commented Jul 12, 2019

@girishramnani Found some weird behaviour observed which i believe is not acceptable for a cli tool. Due to the issue #1899 unfortunately it was not reported. When i am fixing the false positive issue via #1902 this is what i am hitting

$ odo app describe test --project myproject
 ✗  Application test has no components or services deployed.

$ echo $?
0

$ odo app describe test --project myproject > out 2>error

$ cat out 

$ cat error 
 ✗  Application test has no components or services deployed.

Analysis

Actual - For a graceful exit, message is redirected to stderr chanel
Expected - For a graceful exit, message should be redirected to stdout chanel

Due to this inconsistency in behaviour pr #1902 is failing. I am increasing the priority to bring more attention to this issue. For now i am commenting the assertion statment to make CI pass.

@amitkrout amitkrout added priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). and removed priority/Medium Nice to have issue. Getting it done before priority changes would be great. labels Jul 12, 2019
amitkrout added a commit to amitkrout/odo that referenced this issue Jul 12, 2019
amitkrout added a commit to amitkrout/odo that referenced this issue Jul 15, 2019
amitkrout added a commit to amitkrout/odo that referenced this issue Jul 16, 2019
openshift-merge-robot pushed a commit that referenced this issue Jul 17, 2019
* Fix CmdShouldFail false positive

* Commented test due to open issue #1803
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants