mirror of
https://github.com/grafana/grafana.git
synced 2024-12-25 08:21:46 -06:00
Update docs readme for running MySQL/Postgres tests
This commit is contained in:
parent
3680b95b44
commit
6f4625bb78
30
README.md
30
README.md
@ -147,12 +147,34 @@ Writing & watching frontend tests
|
||||
```bash
|
||||
# Run Golang tests using sqlite3 as database (default)
|
||||
go test ./pkg/...
|
||||
```
|
||||
|
||||
# Run Golang tests using mysql as database - convenient to use /docker/blocks/mysql_tests
|
||||
GRAFANA_TEST_DB=mysql go test ./pkg/...
|
||||
##### Running the MySQL or Postgres backend tests:
|
||||
|
||||
# Run Golang tests using postgres as database - convenient to use /docker/blocks/postgres_tests
|
||||
GRAFANA_TEST_DB=postgres go test ./pkg/...
|
||||
Run these by setting `GRAFANA_TEST_DB` in your environment.
|
||||
|
||||
- `GRAFANA_TEST_DB=mysql` to test MySQL
|
||||
- `GRAFANA_TEST_DB=postgres` to test Postgres
|
||||
|
||||
Follow the instructions in `./devenv` to spin up test containers running the appropriate databases with `docker-compose`
|
||||
- Use `docker/blocks/mysql_tests` or `docker/blocks/postgres_tests` as appropriate
|
||||
|
||||
```bash
|
||||
# MySQL
|
||||
# Tests can only be ran in one Go package at a time due to clashing db queries. To run MySQL tests for the "pkg/services/sqlstore" package, run:
|
||||
GRAFANA_TEST_DB=mysql go test ./pkg/services/sqlstore/...
|
||||
|
||||
# Or run all the packages using the circle CI scripts. This method will be slower as the scripts will run all the tests, including the integration tests.
|
||||
./scripts/circle-test-mysql.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
# Postgres
|
||||
# Tests can only be ran in one Go package at a time due to clashing db queries. To run Postgres tests for the "pkg/services/sqlstore" package, run:
|
||||
GRAFANA_TEST_DB=postgres go test ./pkg/services/sqlstore/...
|
||||
|
||||
# Or run all the packages using the circle CI scripts. This method will be slower as the scripts will run all the tests, including the integration tests.
|
||||
./scripts/circle-test-postgres.sh
|
||||
```
|
||||
|
||||
#### End-to-end
|
||||
|
Loading…
Reference in New Issue
Block a user