Skip to content
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

replace testify with stdlib in tests #21

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

thaJeztah
Copy link
Member

Looks like we only minimally depended on testify, so we might as well use stdlib.

@thaJeztah thaJeztah marked this pull request as draft November 19, 2024 11:17
Looks like we only minimally depended on testify, so we might
as well use stdlib.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@@ -323,7 +328,9 @@ func TestMatchComparerMatch_LCOW(t *testing.T) {
match: true,
},
} {
assert.Equal(t, test.match, m.Match(test.platform), "should match %b, %s to %s", test.match, m.Platform, test.platform)
if actual := m.Match(test.platform); actual != test.match {
t.Errorf("should match %b, %s to %s", test.match, m.Platform, test.platform)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh; looks like the linter now actually picked up an existing bug
Screenshot 2024-11-19 at 12 19 57

@thaJeztah thaJeztah marked this pull request as ready for review November 19, 2024 11:20
Copy link
Member

@dims dims left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE!

@thaJeztah
Copy link
Member Author

Heh, yeah, found this stashed locally, so thought I'd push it, but I'm not really attached to it if others still find it useful to have the assert available (testify is still in the dependency tree otherwise, but it may save a bit on maintenance not having to keep it up-to-date)

@samuelkarp
Copy link
Member

+25 −15

Maybe it's not popular, but I am a fan of testify rather than having to repeat the "expected: %v, actual: %v" format strings everywhere.

@kzys kzys merged commit 9ada2e3 into containerd:main Dec 19, 2024
7 checks passed
@thaJeztah thaJeztah deleted the stdlib_testing branch December 19, 2024 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants