Skip to content

Commit

Permalink
test: skip Testcontainers based tests on os other than linux
Browse files Browse the repository at this point in the history
  • Loading branch information
szkiba committed Oct 16, 2024
1 parent 16d12dc commit 01fb2be
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/mysql/register_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mysql
import (
"context"
_ "embed"
"runtime"
"testing"

"github.com/grafana/xk6-sql/sqltest"
Expand All @@ -15,6 +16,14 @@ import (
var script string

func TestIntegration(t *testing.T) { //nolint:paralleltest
if testing.Short() {
t.Skip()
}

if runtime.GOOS != "linux" {
t.Skip("Works only on Linux (Testcontainers)")
}

ctx := context.Background()

ctr, err := mysql.Run(ctx, "mysql:8.0.36")
Expand Down
9 changes: 9 additions & 0 deletions drivers/postgres/register_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package postgres
import (
"context"
_ "embed"
"runtime"
"testing"

"github.com/grafana/xk6-sql/sqltest"
Expand All @@ -17,6 +18,14 @@ import (
var script string

func TestIntegration(t *testing.T) { //nolint:paralleltest
if testing.Short() {
t.Skip()
}

if runtime.GOOS != "linux" {
t.Skip("Works only on Linux (Testcontainers)")
}

ctx := context.Background()

ctr, err := postgres.Run(ctx, "docker.io/postgres:16-alpine",
Expand Down

0 comments on commit 01fb2be

Please sign in to comment.