Skip to content

test: Implement fakes for prometheus api #1798

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ying-jeanne
Copy link
Contributor

@ying-jeanne ying-jeanne commented Apr 15, 2025

Fixes: Prometheus GitHub issue #1438

This PR addresses Prometheus GitHub issue #1438 and the related comment by @bwplotka here. It introduces a simple fake implementation of the Prometheus API to facilitate unit testing. This fake API simulates the behavior of the actual Prometheus API, enabling unit tests without the need for a live Prometheus server. By combining this with end-to-end (e2e) tests, users will be able to cover all test cases comprehensively.

As an example of a similar approach, see this Grafana project.

For simplicity, the fake implementation is placed within the same package to avoid any import complexity for now.

Signed-off-by: Ying WANG <[email protected]>
Signed-off-by: Ying WANG <[email protected]>
@ying-jeanne
Copy link
Contributor Author

@ArthurSens @bwplotka @kakkoyun @vesari could you please give this PR a look? thank you.

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

Successfully merging this pull request may close these issues.

API Mocks
1 participant