yonahd / kor

A Golang Tool to discover unused Kubernetes Resources
MIT License
1.04k stars 96 forks source link

Test refactor and test all #184

Closed yonahd closed 4 months ago

yonahd commented 10 months ago

Split resource creation functions into separate functions from client creation. Allowing reuse of code for all.go test

codecov-commenter commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (fb6a2e3) 46.33% compared to head (8a830c4) 46.33%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #184 +/- ## ======================================= Coverage 46.33% 46.33% ======================================= Files 24 24 Lines 2236 2236 ======================================= Hits 1036 1036 Misses 1023 1023 Partials 177 177 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

doronkg commented 8 months ago

Hey, this PR should be updated with:

  1. all_test.go - TestGetUnusedAllNamespaced() & TestGetUnusedAllNonNamespaced()
  2. New unused resources tests (such as daemonsets, clusterroles, etc)