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

test: add integration tests #608

Merged
merged 2 commits into from
Dec 7, 2023

Conversation

fabriziosestito
Copy link
Contributor

Description

Add policy server integration tests.
The goal is to test that the API are working correctly with the policy evaluator, to then move the runtime related e2e-tests to policy-evaluator.
I've skipped redundant tests (e.g. monitor mode related tests) because we already have unit tests for these scenarios.

Tradeoff

Unfortunately, due to the complexity of the startup of the worker pool, async-sync world bridge and API server, I wasn't able to use the warp test utilities
.
Right now I am starting the http server and using reqwest against it in the integration tests.
If we manage to remove the worker pool, we could try to refactor the code so that it is testable without passing from the http stack.

@@ -0,0 +1,85 @@
use policy_server::config::{Config, Policy, PolicyMode};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need the old mod.rs here since otherwise common.rs will be interpreted as a test by cargo. See: https://doc.rust-lang.org/book/ch11-03-test-organization.html#submodules-in-integration-tests

Copy link
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

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

LGTM!

@jvanz jvanz merged commit 0095b04 into kubewarden:main Dec 7, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants