From d71e30a6922096a524cc64a7ab21f2c73b3adfd9 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 31 May 2022 12:52:59 -0400 Subject: [PATCH] [v9.0.x] Docs: integration tests for using sqllite (#49784) * Docs: integration tests for using sqllite (#49455) * Update developer-guide.md * prettier formatting (cherry picked from commit f5d25c91f6b5de8d78298ed30a25767e3359b5bd) * Update contribute/developer-guide.md Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> * Update contribute/developer-guide.md Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> Co-authored-by: Eric Leijonmarck Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> --- contribute/developer-guide.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/contribute/developer-guide.md b/contribute/developer-guide.md index 9eb31be1f00..33abb37f798 100644 --- a/contribute/developer-guide.md +++ b/contribute/developer-guide.md @@ -136,17 +136,23 @@ Running the backend tests on Windows currently needs some tweaking, so use the b go run build.go test ``` -### Run PostgreSQL and MySQL integration tests +### Run SQLLite, PostgreSQL and MySQL integration tests -To run PostgreSQL and MySQL integration tests locally, you need to start the docker blocks for MySQL and/or PostgreSQL test data sources by running `make devenv sources=mysql_tests,postgres_tests`. When your test data sources are running, you can execute integration tests by running: +By default, Grafana runs SQLite to run tests with SQLite. +```bash +go test -covermode=atomic -tags=integration ./pkg/... ``` + +To run PostgreSQL and MySQL integration tests locally, start the Docker blocks for MySQL and/or PostgreSQL test data sources by running `make devenv sources=mysql_tests,postgres_tests`. When your test data sources are running, you can execute integration tests by running: + +```bash GRAFANA_TEST_DB=mysql go test -covermode=atomic -tags=integration ./pkg/... ``` and/or -``` +```bash GRAFANA_TEST_DB=postgres go test -covermode=atomic -tags=integration ./pkg/... ```