System tests: tighten 'is' operator#11776
System tests: tighten 'is' operator#11776openshift-merge-robot merged 1 commit intocontainers:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago 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 |
|
/hold DO NOT MERGE. This cannot merge until #11775 is fixed! That's a serious nasty flake, and I bet this PR will hit it on most if not all of the |
|
Well, phooey! There's a new flake: I'll worry about it tomorrow. |
|
And yet another different one: |
|
Nice work, that should help my brain to parse the errors. |
ea3379f to
f0db4ea
Compare
|
#11784 is an issue in runc. I suggest we just skip the test with runc and move on |
|
and probably also #10442 |
2ab71bf to
7e77927
Compare
test/system/005-info.bats
Outdated
There was a problem hiding this comment.
This will now fail if we ever vendor a -dev buildah, or something with letters.
There was a problem hiding this comment.
We regularly do this during development, will this block a merge to upstream?
There was a problem hiding this comment.
It probably would. Let me think of how to handle that; I will pore through git logs, find patterns, and resubmit. Thanks for letting me know.
test/system/125-import.bats
Outdated
There was a problem hiding this comment.
-t is tested in 450-interactive.bats (below), so I see little need to jump through the carriage-return hoops here. Please advise if there's something I've missed.
test/system/150-login.bats
Outdated
There was a problem hiding this comment.
Oops. My bad. This has been broken from the beginning. This is a great example of why we need this PR.
test/system/160-volumes.bats
Outdated
There was a problem hiding this comment.
This is another great example of why we need this PR. Between the time I wrote this test and today, someone added some new volumes, and this check was not catching the addition.
test/system/700-play.bats
Outdated
There was a problem hiding this comment.
This and line 52 are completely unrelated; it's just something that makes color highlighting work better in my editors.
|
LGTM |
|
/hold |
Fix day-one sloppiness: when I first wrote this framework
it compared strings using 'expr', not '=', to be more
forgiving of extra cruft in output. This was a bad decision.
It means that warnings or additional text are ignored:
is "all is ok, NOT!" "all is ok" <-- this would pass
Solution: tighten up the 'is' check. Use '=' (direct
compare) first. If it fails, look for wild cards ('*')
or character classes ('[') in the expect string. If
so, and only then, use 'expr'. And, thanks to a clever
suggestion from Luap99, include '(using expr)' in the
error message when we do so; this could make it easier
for a developer to understand a string mismatch.
This change exposes a lot of instances in which we weren't
doing proper comparisons. Fix those. Thankfully, there
weren't as many as I'd feared.
Also, and completely unrelated, add '-T' flag to bats
helper, for showing timing results. (I will open this
as a separate PR if requested. I too find it offensive
to jumble together unrelated commits.)
Signed-off-by: Ed Santiago <santiago@redhat.com>
7e77927 to
bf94ebf
Compare
| # add '-[0-9]' to all '*.package' queries below. | ||
| tests=" | ||
| host.buildahVersion | [0-9.] | ||
| host.buildahVersion | [1-9][0-9]*\.[0-9.]\\\+.* |
There was a problem hiding this comment.
Update on the -dev issue: I confirmed (back to 1.4) that the only values are N.M and N.M-dev, but then ended up unable to use expr to handle -dev. So the above expression now handles N.M with any suffix, such as 1.23.0-dev but also 1.23abcfoothisisnonsensehellogoodbye. I think we'll need to call that Good Enough.
|
Ready again. If there are in-flight PRs which add BATS tests that do lax checking, and they merge without rebasing, we may end up with a broken main. I've looked through the top half of open PRs and see none, but I might have missed one. |
Fix day-one sloppiness: when I first wrote this framework
it compared strings using 'expr', not '=', to be more
forgiving of extra cruft in output. This was a bad decision.
It means that warnings or additional text are ignored:
Solution: tighten up the 'is' check. Use '=' (direct
compare) first. If it fails, look for wild cards ('*')
or character classes ('[') in the expect string. If
so, and only then, use 'expr'. And, thanks to a clever
suggestion from Luap99, include '(using expr)' in the
error message when we do so; this could make it easier
for a developer to understand a string mismatch.
This change exposes a lot of instances in which we weren't
doing proper comparisons. Fix those. Thankfully, there
weren't as many as I'd feared.
Also, and completely unrelated, add '-T' flag to bats
helper, for showing timing results. (I will open this
as a separate PR if requested. I too find it offensive
to jumble together unrelated commits.)
Signed-off-by: Ed Santiago santiago@redhat.com