Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Add an integration testing pattern and a few team integration tests #105

Closed
wants to merge 14 commits into from

Conversation

mdb
Copy link
Contributor

@mdb mdb commented Aug 14, 2022

Summary:

  • add pattern by which grafana-api-golang-client can be integration tested using a local, Dockerized Grafana instance
  • add a few Team-specific integration tests, largely to help facilitate some PR 102 discussion

Further context:

Without a suite of easy-to-run integration tests, grafana-api-golang-client functionality and bugs were a bit difficult to prove and discuss. In particular, this PR seeks to offer a simple testing technique to assist PR 102 discussion.

Potential further follow-on improvements:

  • add additional integration tests
  • run the integration tests in CI

Signed-off-by: Mike Ball <mikedball@gmail.com>
Signed-off-by: Mike Ball <mikedball@gmail.com>
Signed-off-by: Mike Ball <mikedball@gmail.com>
Signed-off-by: Mike Ball <mikedball@gmail.com>
Signed-off-by: Mike Ball <mikedball@gmail.com>
Signed-off-by: Mike Ball <mikedball@gmail.com>
Signed-off-by: Mike Ball <mikedball@gmail.com>
Signed-off-by: Mike Ball <mikedball@gmail.com>
grafana:
image: grafana/grafana:${GRAFANA_VERSION}
networks:
- grafana-api-golang-client-test
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is very similar to terraform-provider-grafana's docker-compose.yml.

if err != nil {
t.Fatalf("failed to delete team: %v", err)
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There may be more elegant ways to organize these tests, but I chose to err on the side of simplicity, at least for now.

@julienduchesne
Copy link
Member

👋 I am closing this PR because this repository is now deprecated and will be archived. It will still be accessible in read-only mode.

We are now generating the Grafana client from its OpenAPI spec. Check out https://github.com/grafana/grafana-openapi-client-go for the new client. Consider opening an issue or a PR there if functionality is missing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants