-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
More BeTrue cleanup #12454
More BeTrue cleanup #12454
Conversation
edsantiago
commented
Nov 30, 2021
- e2e tests: more cleanup of BeTrue()s
- Convert strings.Contains() to Expect(ContainSubstring)
- a few more manual BeTrue cleanups
Write a BeValidJSON() matcher, and replace IsJSONOutputValid(): sed -i -e 's/Expect(\(.*\)\.IsJSONOutputValid()).To(BeTrue())/Expect(\1.OutputToString())\.To(BeValidJSON())/' test/e2e/*_test.go (Plus a few manual tweaks) Signed-off-by: Ed Santiago <[email protected]>
...done manually, not via sed, because some of the inner expressions include nested commas. Signed-off-by: Ed Santiago <[email protected]>
[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
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Ed Santiago <[email protected]>
a6edec4
to
8eb0be0
Compare
LGTM |
@@ -225,7 +225,7 @@ var _ = Describe("Podman commit", func() { | |||
Expect(inspect).Should(Exit(0)) | |||
image := inspect.InspectImageJSON() | |||
_, ok := image[0].Config.Volumes["/foo"] | |||
Expect(ok).To(BeTrue()) | |||
Expect(ok).To(BeTrue(), ".Config.Volumes[/foo]") |
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.
FYI This can be changed to Expect(image[0].Config.Volumes).To(HaveKey("/foo))
The same for the other place where you compare a map. There is also a HaveKeyWithValue()
function.
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.
Oh, nice, thank you!
/lgtm |
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.
Thank you, @edsantiago! I find such PRs invaluable