From f655a59089a2b1f22fd51aa3192dba32bb5713d1 Mon Sep 17 00:00:00 2001 From: Ciaran Liedeman <3578740+cliedeman@users.noreply.github.com> Date: Thu, 19 Nov 2020 14:46:02 +0200 Subject: [PATCH] entc/integration: add postgres13 (#961) --- .github/workflows/ci.yml | 24 ++++++++++++++++++++ entc/integration/compose/docker-compose.yaml | 10 ++++++++ entc/integration/customid/customid_test.go | 2 +- entc/integration/integration_test.go | 2 +- entc/integration/json/json_test.go | 2 +- entc/integration/migrate/migrate_test.go | 4 +--- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f561ea526..7db0dab60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,6 +151,18 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 + postgres13: + image: postgres:13.1 + env: + POSTGRES_DB: test + POSTGRES_PASSWORD: pass + ports: + - 5434:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 gremlin-server: image: entgo/gremlin-server ports: @@ -252,6 +264,18 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 + postgres13: + image: postgres:13.1 + env: + POSTGRES_DB: test + POSTGRES_PASSWORD: pass + ports: + - 5434:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 gremlin-server: image: entgo/gremlin-server ports: diff --git a/entc/integration/compose/docker-compose.yaml b/entc/integration/compose/docker-compose.yaml index e4ffb4135..d5e0f9ecb 100644 --- a/entc/integration/compose/docker-compose.yaml +++ b/entc/integration/compose/docker-compose.yaml @@ -66,6 +66,16 @@ services: ports: - 5433:5432 + postgres13: + image: postgres:13 + environment: + POSTGRES_DB: test + POSTGRES_PASSWORD: pass + healthcheck: + test: pg_isready -U postgres + ports: + - 5434:5432 + gremlin: image: entgo/gremlin-server build: gremlin-server diff --git a/entc/integration/customid/customid_test.go b/entc/integration/customid/customid_test.go index 10bf18602..7a94f3b5d 100644 --- a/entc/integration/customid/customid_test.go +++ b/entc/integration/customid/customid_test.go @@ -50,7 +50,7 @@ func TestMySQL(t *testing.T) { } func TestPostgres(t *testing.T) { - for version, port := range map[string]int{"10": 5430, "11": 5431, "12": 5433} { + for version, port := range map[string]int{"10": 5430, "11": 5431, "12": 5433, "13": 5434} { t.Run(version, func(t *testing.T) { dsn := fmt.Sprintf("host=localhost port=%d user=postgres password=pass sslmode=disable", port) db, err := sql.Open(dialect.Postgres, dsn) diff --git a/entc/integration/integration_test.go b/entc/integration/integration_test.go index 6807b904f..91832855f 100644 --- a/entc/integration/integration_test.go +++ b/entc/integration/integration_test.go @@ -72,7 +72,7 @@ func TestMySQL(t *testing.T) { } func TestPostgres(t *testing.T) { - for version, port := range map[string]int{"10": 5430, "11": 5431, "12": 5433} { + for version, port := range map[string]int{"10": 5430, "11": 5431, "12": 5433, "13": 5434} { t.Run(version, func(t *testing.T) { client := enttest.Open(t, dialect.Postgres, fmt.Sprintf("host=localhost port=%d user=postgres dbname=test password=pass sslmode=disable", port), opts) defer client.Close() diff --git a/entc/integration/json/json_test.go b/entc/integration/json/json_test.go index 7b9c70323..41d173cf2 100644 --- a/entc/integration/json/json_test.go +++ b/entc/integration/json/json_test.go @@ -57,7 +57,7 @@ func TestMySQL(t *testing.T) { } func TestPostgres(t *testing.T) { - for version, port := range map[string]int{"10": 5430, "11": 5431, "12": 5433} { + for version, port := range map[string]int{"10": 5430, "11": 5431, "12": 5433, "13": 5434} { t.Run(version, func(t *testing.T) { dsn := fmt.Sprintf("host=localhost port=%d user=postgres password=pass sslmode=disable", port) db, err := sql.Open(dialect.Postgres, dsn) diff --git a/entc/integration/migrate/migrate_test.go b/entc/integration/migrate/migrate_test.go index 1fb1e940b..e5c8bcd80 100644 --- a/entc/integration/migrate/migrate_test.go +++ b/entc/integration/migrate/migrate_test.go @@ -47,9 +47,7 @@ func TestMySQL(t *testing.T) { } func TestPostgres(t *testing.T) { - // Version 12 is disabled here due to segfault on migration. It will be re-enabled on its next release. - // More info can be found here: https://www.postgresql.org/message-id/23031.1572362774%40sss.pgh.pa.us - for version, port := range map[string]int{"10": 5430, "11": 5431, "12": 5433} { + for version, port := range map[string]int{"10": 5430, "11": 5431, "12": 5433, "13": 5434} { t.Run(version, func(t *testing.T) { dsn := fmt.Sprintf("host=localhost port=%d user=postgres password=pass sslmode=disable", port) root, err := sql.Open(dialect.Postgres, dsn)