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

Don't rely on the live api for the tests #645

Open
jnioche opened this issue Dec 19, 2024 · 1 comment
Open

Don't rely on the live api for the tests #645

jnioche opened this issue Dec 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jnioche
Copy link
Collaborator

jnioche commented Dec 19, 2024

Bug description

see #643

Our tests can fail because we are hitting the live version of the API on https://api.boavizta.org/ and its version can change anytime.

  1. start a Docker instance with a version known to be compatible within the tests
    https://rust.testcontainers.org/quickstart/testcontainers/ is probably the best solution for this

  2. mock what the API returns
    https://docs.rs/wiremock/latest/wiremock/

@demeringo
Copy link
Collaborator

Yes, this subject will become even more important when we start to integrate multiple cloud providers and need to test the inventory / scanning part (calling provider API's).

The current "test" implementation of the inventory is very naive, it calls the real AWS API, so it needs to have real resouces in the cloud to produce results. This is not portable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants