You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+48
Original file line number
Diff line number
Diff line change
@@ -70,9 +70,57 @@ Follow the [Grafana documentation][service-account] for details.
70
70
To disable a category of tools, set the environment variable `GRAFANA_TOOLS__<CATEGORY>__ENABLED` to `"false"`.
71
71
For example, to disable the search tools, set `"GRAFANA_TOOLS__SEARCH__ENABLED": "false"`.
72
72
73
+
## Development
74
+
75
+
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
76
+
77
+
This project uses [`uv`] to manage dependencies. Install `uv` following the instructions for your platform.
78
+
79
+
You can then create a virtual environment and install the dependencies with:
80
+
81
+
```bash
82
+
uv sync --all-groups
83
+
```
84
+
85
+
### Testing
86
+
87
+
TL;DR: start a Grafana instance with `docker-compose up`, run `uv run ruff check .` for lints, and `uv run pytest tests --integration` to run unit and integration tests.
88
+
89
+
To run unit tests, run:
90
+
91
+
```bash
92
+
uv run pytest tests
93
+
```
94
+
95
+
More comprehensive integration tests will require a Grafana instance to be running locally on port 3000; you can start one with Docker Compose:
96
+
97
+
```bash
98
+
docker-compose up -d
99
+
```
100
+
101
+
The integration tests can be run with:
102
+
103
+
```bash
104
+
uv run pytest --integration tests
105
+
```
106
+
107
+
If you're adding more tools, please add integration tests for them. The existing tests should be a good starting point.
108
+
109
+
Certain tools use functionality that is only available in Grafana Cloud. Such tests should use the `mark_cloud` Pytest mark; see the [incident_test.py](tests/tools/incident_test.py) file for an example.
110
+
Use the `GRAFANA_URL` and `GRAFANA_API_KEY` environment variables to configure the Grafana instance to use for testing, and run these tests with:
111
+
112
+
```bash
113
+
GRAFANA_URL=https://myinstance.grafana.net GRAFANA_API_KEY=my-api-key uv run pytest --cloud tests
114
+
```
115
+
116
+
### Linting
117
+
118
+
This project uses [ruff](https://github.com/charliermarsh/ruff) for linting.
119
+
73
120
## License
74
121
75
122
This project is licensed under the [Apache License, Version 2.0](LICENSE).
0 commit comments