Chore: Use proper database in integration tests (#109119)

* Chore: Apply proper database settings to integration tests

* add logging

* join host and port in database config to override default ports

* apply test fixes from the original pr

* host might contain port already

* increase timeout

* increase timeout even more

* even larger timeouts

* Use eventually for stats

* Use eventually also for listing settings as index takes some time

---------

Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
This commit is contained in:
Serge Zaitsev
2025-08-08 14:24:17 +02:00
committed by GitHub
parent 3a4dc10d3f
commit f3ca49f2b3
4 changed files with 84 additions and 38 deletions
+15
View File
@@ -22,6 +22,11 @@ type TestDB struct {
DriverName string
ConnStr string
Path string
Host string
Port string
User string
Password string
Database string
Cleanup func()
}
@@ -132,6 +137,11 @@ func mySQLTestDB() (*TestDB, error) {
return &TestDB{
DriverName: "mysql",
ConnStr: conn_str,
Host: host,
Port: port,
User: "grafana",
Password: "password",
Database: "grafana_tests",
Cleanup: func() {},
}, nil
}
@@ -149,6 +159,11 @@ func postgresTestDB() (*TestDB, error) {
return &TestDB{
DriverName: "postgres",
ConnStr: connStr,
Host: host,
Port: port,
User: "grafanatest",
Password: "grafanatest",
Database: "grafanatest",
Cleanup: func() {},
}, nil
}