Chore: Update test database initialization (#81673)
* streamline initialization of test databases, support on-disk sqlite test db * clean up test databases * introduce testsuite helper * use testsuite everywhere we use a test db * update documentation * improve error handling * disable entity integration test until we can figure out locking error
This commit is contained in:
@@ -11,8 +11,13 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/store/entity"
|
||||
"github.com/grafana/grafana/pkg/services/store/entity/db/dbimpl"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/tests/testsuite"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
testsuite.Run(m)
|
||||
}
|
||||
|
||||
func TestCreate(t *testing.T) {
|
||||
s := setUpTestServer(t)
|
||||
|
||||
|
||||
+5
@@ -18,8 +18,13 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/store/entity/sqlstash"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
"github.com/grafana/grafana/pkg/tests/testinfra"
|
||||
"github.com/grafana/grafana/pkg/tests/testsuite"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
testsuite.Run(m)
|
||||
}
|
||||
|
||||
func createServiceAccountAdminToken(t *testing.T, env *server.TestEnv) (string, *user.SignedInUser) {
|
||||
t.Helper()
|
||||
|
||||
@@ -110,9 +110,9 @@ func requireVersionMatch(t *testing.T, obj *entity.Entity, m objectVersionMatche
|
||||
}
|
||||
|
||||
func TestIntegrationEntityServer(t *testing.T) {
|
||||
// TODO figure out why this still runs into sqlite database locked error
|
||||
if true {
|
||||
// TODO: enable this test once we fix test "database locked" issues
|
||||
t.Skip()
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
|
||||
if testing.Short() {
|
||||
|
||||
Reference in New Issue
Block a user