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

Full-spectrum integration testing system. #448

Open
grzkv opened this issue Dec 15, 2022 · 1 comment
Open

Full-spectrum integration testing system. #448

grzkv opened this issue Dec 15, 2022 · 1 comment

Comments

@grzkv
Copy link
Member

grzkv commented Dec 15, 2022

Motivation

There are multiple bugs that are not detected by our current CI and unit tests. The stability bugs are especially frequent of those. Unit tests are not well-suited to test the parts of code that call into the OS and especially the ones using networking. An integration testing system is a much better candidate here.

Requirements

  • Tests the following:
    • Stability and liveness of carbonapi while processing a set of requests.
    • Timeout test for a set of typical requests.
    • (in the future) Correctness test for a set of typical render and find requests.
    • (in the future) Test a metrics scrape.
  • Can run automatically for each PR.
  • Can run in any environment.
  • Uses mock backends, which:
    • Are tens in number.
    • Are split into clusters.
    • Have replication.
  • Uses neutral data. E.g. randomly generated data.

Design

System consists of three parts:

  1. HTTP requests player, which will send a set of requests to carbonapi that are defined in advance.
  2. carbonapi itself.
  3. Set of mock backends, which simulate the real-life backends.

In the first version, it makes sense to run them on a single box (it can also be a container) or inside 3 separate containers via docker-compose. Each backend will occupy a port on a single machine.

HTTP player details

There are multiple available. We don't have to write our own. We need to try and choose one.

Mock backends

We will have to implement this part. Mock backends should support the main procol we use for communication with a real backend. They will play back preset responses for each request.

Workflow

The test will run something like this:

  1. Bring up all the systems.
  2. Send a set of requests to carbonapi.
  3. Check if the responses were received.
  4. (in the future) Check correctness of the responses.
  5. (in the future) Try scraping metrics from carbonapi and check if they satisfy basic heuristics.
  6. Check liveness of carbonapi.
@deniszh
Copy link
Contributor

deniszh commented Dec 29, 2022

It makes sense to me.
In my opinion, we can start with the HTTP player part and correctness/scrape tests using the normal go-carbon backend, as we have in hurl tests, but without hurl. :)
Then we can spend time on the mock backend and create tests for stability and timeouts.

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

No branches or pull requests

2 participants