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

Fix test fixtures, add a test for controllers #455

Merged
merged 9 commits into from
Dec 17, 2020
Merged

Conversation

rbren
Copy link
Contributor

@rbren rbren commented Dec 17, 2020

No description provided.

Copy link
Contributor

@baderbuddy baderbuddy left a comment

Choose a reason for hiding this comment

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

This looks great to me. There were a couple messages in the tests that were a little inaccurate and that's it.

namespaceCount := map[string]int{}
for _, controller := range resources.Controllers {
namespaceCount[controller.ObjectMeta.GetNamespace()]++
}
assert.Equal(t, 7, namespaceCount[""], "Should have seven controller in default namespace")
assert.Equal(t, 8, namespaceCount[""], "Should have seven controller in default namespace")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should get rid of these messages, both of them are out of sync now.

"daemonset": false,
}
for _, ctrl := range resources.Controllers {
expectedNames[ctrl.ObjectMeta.GetName()] = true
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this way of handling. I wonder if the assert library we use has something built in already or if we could contribute to it

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 think there's something like it, but it expects the same object type

@codecov
Copy link

codecov bot commented Dec 17, 2020

Codecov Report

Merging #455 (ad56cc6) into master (2393f0b) will increase coverage by 2.28%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #455      +/-   ##
==========================================
+ Coverage   45.85%   48.14%   +2.28%     
==========================================
  Files          12       12              
  Lines         700      700              
==========================================
+ Hits          321      337      +16     
+ Misses        325      302      -23     
- Partials       54       61       +7     
Impacted Files Coverage Δ
pkg/kube/resources.go 44.08% <0.00%> (-1.08%) ⬇️
pkg/kube/workload.go 44.18% <0.00%> (+13.95%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2393f0b...ad56cc6. Read the comment docs.

@rbren rbren merged commit 7c98598 into master Dec 17, 2020
@rbren rbren deleted the rb/test-fixtures branch December 17, 2020 22:32
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