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

Unit tests with fake client #34

Merged
merged 6 commits into from
Mar 15, 2023
Merged

Unit tests with fake client #34

merged 6 commits into from
Mar 15, 2023

Conversation

hellt
Copy link
Member

@hellt hellt commented Mar 15, 2023

This is a first stab at refactoring test harness. It introduces unit tests that use controller-client fake client instead of doing integration tests with envtest right away.

The envtest-based test suite (that uses ginkgo) is moved to ./tests/integration dir and is invoked right now automatically when make test is called.

Running only unit tests is possible with make unit-test.

In future PRs I will carve out ginkgo from the integration test and use go test instead, based on the Cluster API examples - https://github.com/kubernetes-sigs/cluster-api/blob/main/internal/controllers/machinedeployment/suite_test.go

@hellt hellt marked this pull request as ready for review March 15, 2023 11:17
@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Merging #34 (75d6cda) into main (dd417e9) will increase coverage by 0.72%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   65.69%   66.42%   +0.72%     
==========================================
  Files           7        7              
  Lines         548      548              
==========================================
+ Hits          360      364       +4     
+ Misses        164      158       -6     
- Partials       24       26       +2     

see 1 file with indirect coverage changes

@hellt hellt merged commit 502b5bd into main Mar 15, 2023
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.

1 participant