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

chore: Add unit test for PodMetrics object informer #202

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

pijusn-cast
Copy link
Contributor

This test was missing. While it doesn't cover everything related, this verifies at least some informer basics.

@@ -182,7 +183,7 @@ func TestController_ShouldReceiveDeltasBasedOnAvailableResources(t *testing.T) {
item.Data != nil &&
strings.Contains(string(*item.Data), expectedGVString) // Hacky but OK given this is for testing purposes.
})
require.True(t, found)
require.Truef(t, found, "missing object for %s %s", expectedGVString, expected.Kind)
Copy link
Contributor

Choose a reason for hiding this comment

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

If there was an empty string, %q would produce an error msg that is easier to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it can be empty right now but replaced it. Maybe it will be some time or when something breaks.

@pijusn-cast pijusn-cast merged commit 415b154 into main Nov 18, 2024
2 checks passed
@pijusn-cast pijusn-cast deleted the pijusn/podmetrics-add-test-case branch November 18, 2024 09:20
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.

2 participants