Closed marcomorain closed 5 years ago
Thank you for opening this issue.
This is unfortunately by design.
The only time the application is meant to return anything other than 0 as a exit code is when the argument --required
is used.
For this case though, I'll take it under consideration and think about whether we should return something else when wrong arguments are used.
Thanks Kim.
Let me tell you about how I ended up in the situation. I was working on my macOS Workstation. I wanted to add a flag to designate the platform to our codecov uploads. We are currently building a project on Linux and Windows. I added -F Linux
to our linux job, using the bash uploaded docs for reference. Then I applied the same change to the Windows job, without checking the Windows docs (since we are using just the -f <file>
flag on both platforms, it appeared like the argument were the same across all uploaders on all platforms.
I pushed the Windows job, and the CodeCov step “succeeded”, so I assumed that it worked, and moved on. It took me a few days to realize that CodeCov on Windows was no longer working.
I see.
Sounds like I should look into making the arguments using in this application be similiar/equal to the ones used in codecov-bash.
I've opened #53 for tracking the progress of this.
I have decided that invalid arguments should definitely return a non-zero exit code. I plan to have this change available whenever version 1.6.0 is released.
Thanks Kim 👍
This have now been implemented and will be part of the 1.6.0
release.
When the next release hits, invalid arguments will cause codecov to exit with the exit code of 160
(this seemed to be the most appropriate exit code when I did some research).
👋 Hi there, thanks for the codecov tool!
Actual
I invoked the
codecov.exe
tool incorrectly on Windows:I was using
-F
from the bash uploader, rather than--flag
, which print the usage information, but the exit code is 0 (success)This caused my CircleCI step to pass:
Even though the output showed the error:
Full example:
Expected
I expect the tool to return a non-zero status code, to indicate failure.