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

Refactor the operators_test and report test coverage #27

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

jordipiqueselles
Copy link
Collaborator

The operators_test was a badly designed test suite, since it said it was just testing the operators but in fact it was also testing the process of parsing them, since it's much easier to specify operations using the GenericWebhookConfig CRD.

The problem was that the CRD will evolve and the generic-k8s-webhook should support (and test) both old and new versions of the CRD. The refactor of the tests makes easier to keep test coverage for all the versions that are supported.

Apart from that, we're introducing pytest-cov to write a test coverage report after executing all the unittests.

The operators_test was a badly designed test suite, since it said it was
just testing the operators but in fact it was also testing the process
of parsing them, since it's much easier to specify operations using the
GenericWebhookConfig CRD.

The problem was that the CRD will evolve and the generic-k8s-webhook
should support (and test) both old and new versions of the CRD. The
refactor of the tests makes easier to keep test coverage for all the
versions that are supported.

Apart from that, we're introducing pytest-cov to write a test coverage
report after executing all the unittests.
@jordipiqueselles jordipiqueselles added the enhancement New feature or request label Apr 1, 2024
@jordipiqueselles jordipiqueselles merged commit 55f29e7 into main Apr 1, 2024
2 checks passed
@jordipiqueselles jordipiqueselles deleted the jordi/refactor-tests branch April 1, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant