-
Notifications
You must be signed in to change notification settings - Fork 1.1k
test/config: fix "config dir should fail with invalid option" #4213
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
test/config: fix "config dir should fail with invalid option" #4213
Conversation
Sometimes this test fails like this:
> not ok 11 config dir should fail with invalid option
> (in test file ./config.bats, line 38)
> `RES=$(cat "$CRIO_LOG")' failed
> cat: /tmp/tmp.nho2aP6lqh/crio.log: No such file or directory
> unable to decode configuration /tmp/tmp.nho2aP6lqh/crio.conf: Near line 2 (last key parsed 'crio.runtime.log_level'): expected value but found "info" instead
The reason it fails is logs are written by using tee,
which for some reason is run in a subshell, and it looks
like a race between the main shell and the subshell.
Anyway, using tee is not needed here. Simplify it by using run,
and add a check for non-zero exit code.
The second proble is, the test is not doing what it supposed to.
Judging by the test name ("config dir should fail"), it seems the test
should write a correct log_level value to the main config file, a wrong
value to a file under crio.conf.d, and check that crio fails.
The problem is, the value in main file is wrong as well it is not quoted.
Fix the test so the main config file has the correct log_level value.
Fix the output check to look for the specific bad key.
Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kolyshkin, mrunalp The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
|
@kolyshkin: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Codecov Report
@@ Coverage Diff @@
## master #4213 +/- ##
=======================================
Coverage 38.72% 38.72%
=======================================
Files 111 111
Lines 8702 8702
=======================================
Hits 3370 3370
Misses 4967 4967
Partials 365 365 |
|
/cherry-pick release-1.19 |
|
/cherry-pick release-1.18 |
|
@haircommander: #4213 failed to apply on top of branch "release-1.18": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@haircommander: new pull request created: #4220 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Sometimes this test fails like this:
The reason it fails is logs are written by using tee,
which for some reason is run in a subshell, and it looks
like a race between the main shell and the subshell.
Anyway, using tee is not needed here. Simplify it by using run,
and add a check for non-zero exit code.
The second proble is, the test is not doing what it supposed to.
Judging by the test name ("config dir should fail"), it seems the test
should write a correct log_level value to the main config file, a wrong
value to a file under crio.conf.d, and check that crio fails.
The problem is, the value in main file is wrong as well it is not quoted.
Fix the test so the main config file has the correct log_level value.
Fix the output check to look for the specific bad key.
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Does this PR introduce a user-facing change?