Skip to content

Introduce exporter (narrow) integration tests #73

@theodore86

Description

@theodore86

Description

Purpose of this ticket is to create (narrow) integration tests. Currently exporter library is supporting unittests.

Basic steps for the integration tests (via docker-compose):

  1. Startup the prometheus exporter with any other dependency (mockserver as Github)
  2. Use a library like prometheus-api-client to make http requests towards the exporter endpoint.
  3. Mock the Github ~ set expectations for rate-limits per authentication type.
  4. Verify that the returned metrics are as expected by comparing them to a pre-defined set of expected values.
  5. Repeat steps 3-4 for different scenarios, such as different input parameters or different configuration of the exporter.
  6. Stop the prometheus exporter service and any dependencies that were started from step .1

Folder structure with integration tests (via pytest)

tests
|-----integration_tests
|-----unittests

Update tox.ini

Separation of unit and integration tests in order to easily executed, in CI integration an unit test shall be executed in parallel.

Example:

[testenv:unittests]
description = Python unittests
``

```ini
[testenv:integration_tests]
description = Python integration tests

CI:

tox -e unittests,integration_tests

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpythonImprovements or additions to python source code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions