From 01fb2be45306bafe112af68cafdd838c0ef5ab1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Wed, 16 Oct 2024 11:35:27 +0200 Subject: [PATCH] test: skip Testcontainers based tests on os other than linux --- drivers/mysql/register_test.go | 9 +++++++++ drivers/postgres/register_test.go | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/mysql/register_test.go b/drivers/mysql/register_test.go index 2a22be2..35338fd 100644 --- a/drivers/mysql/register_test.go +++ b/drivers/mysql/register_test.go @@ -3,6 +3,7 @@ package mysql import ( "context" _ "embed" + "runtime" "testing" "github.com/grafana/xk6-sql/sqltest" @@ -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") diff --git a/drivers/postgres/register_test.go b/drivers/postgres/register_test.go index 10574e2..b7070ee 100644 --- a/drivers/postgres/register_test.go +++ b/drivers/postgres/register_test.go @@ -3,6 +3,7 @@ package postgres import ( "context" _ "embed" + "runtime" "testing" "github.com/grafana/xk6-sql/sqltest" @@ -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",