-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 exit codes of security:certificates commands #37783
Conversation
Also see issue #37784 which was the trigger for fixing this. |
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.
tests look good to me
Codecov Report
@@ Coverage Diff @@
## master #37783 +/- ##
============================================
- Coverage 64.71% 64.70% -0.01%
- Complexity 19391 19392 +1
============================================
Files 1284 1284
Lines 75753 75757 +4
Branches 1333 1333
============================================
Hits 49021 49021
- Misses 26340 26344 +4
Partials 392 392
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #37783 +/- ##
============================================
- Coverage 64.71% 64.70% -0.01%
- Complexity 19391 19392 +1
============================================
Files 1284 1284
Lines 75753 75757 +4
Branches 1333 1333
============================================
+ Hits 49021 49022 +1
- Misses 26340 26343 +3
Partials 392 392
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
codecov/project https://codecov.io/gh/owncloud/core/pull/37783/diff The uncovered code is in the |
Description
I was getting acceptance test fails when running
cliMain/securityCertificates.feature
against ownCloud10latest
(currently 10.5.0 tarball). Thesecurity:certificates:remove
andsecurity:certificates:import
commands are not exiting with proper error codes when something is wrong, so that makes it impossible for the acceptance test scenarios to react appropriately in steps likeThen the command should have been successful
- that step never fails because the command status is always 0 = success.The easiest thing to do is first to fix the bug that was already reported in the related issue.
When importing a certificate and the certificate file is not found, exit with status 1.
When removing a certificate and the certificate does not exist, exit with status 1.
Adjust the acceptance tests to have cases for these.
Adjust
.drone.star
- it hassecurity:certificates:import
commands for when tests are using HTTPS and certificates. Those commands were also being done in pipelines where the certificates did not exist and were not needed. The commands were never successful. Now that the commands exit with an error status, the pipelines were failing during the setup. The starlark code has been adjusted so that it only doessecurity:certificates:import
in the correct cases.Note 1: I did not find any existing unit tests for commands in
core/Command/Security
. The commands seem to have been introduced in PR #21370 but that PR had no automated tests.Note 2: I added some simple unit tests
Related Issue
How Has This Been Tested?
Locally running commands:
and scenarios in acceptance tests.
Types of changes
Checklist: