From 8b8f5e242272703b7c6cf2b1bdd9c640dba0ffe1 Mon Sep 17 00:00:00 2001 From: Izel Nakri Date: Sun, 1 Mar 2020 03:45:29 +0100 Subject: [PATCH] CI test fix --- .env | 2 +- config/test.exs | 4 ++-- docker-compose.yaml | 2 +- test/paper_trail/bang_functions_simple_mode_test.exs | 1 + test/paper_trail/bang_functions_strict_mode_test.exs | 1 + test/paper_trail/paper_trail_version_test.exs | 1 + test/paper_trail/version_queries_test.exs | 3 +++ 7 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 50c4a026..fe4fc6dc 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_HOST=localhost -# PG_HOST=localhost +PG_HOST=localhost MIX_ENV=test # CIRCLE_BRANCH=$$(if [ -v CIRCLE_BRANCH ]; then echo master; else git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'; fi) CIRCLE_BRANCH=$CIRCLE_BRANCH diff --git a/config/test.exs b/config/test.exs index 015d3ef8..89a702c3 100644 --- a/config/test.exs +++ b/config/test.exs @@ -9,7 +9,7 @@ config :paper_trail, PaperTrail.Repo, username: System.get_env("POSTGRES_USER"), password: System.get_env("POSTGRES_PASSWORD"), database: "paper_trail_test", - hostname: System.get_env("PGHOST"), + hostname: System.get_env("PG_HOST"), poolsize: 10 config :paper_trail, PaperTrail.UUIDRepo, @@ -17,5 +17,5 @@ config :paper_trail, PaperTrail.UUIDRepo, username: System.get_env("POSTGRES_USER"), password: System.get_env("POSTGRES_PASSWORD"), database: "paper_trail_uuid_test", - hostname: System.get_env("PGHOST"), + hostname: System.get_env("PG_HOST"), poolsize: 10 diff --git a/docker-compose.yaml b/docker-compose.yaml index 40cc76dd..b6b9db27 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -20,7 +20,7 @@ services: POSTGRES_USER: $POSTGRES_USER POSTGRES_PASSWORD: $POSTGRES_PASSWORD PGPORT: 5432 - PGHOST: db + PG_HOST: db MIX_ENV: $MIX_ENV tty: true depends_on: diff --git a/test/paper_trail/bang_functions_simple_mode_test.exs b/test/paper_trail/bang_functions_simple_mode_test.exs index ccd3e24b..8680061f 100644 --- a/test/paper_trail/bang_functions_simple_mode_test.exs +++ b/test/paper_trail/bang_functions_simple_mode_test.exs @@ -21,6 +21,7 @@ defmodule PaperTrailTest.SimpleModeBangFunctions do setup_all do Application.put_env(:paper_trail, :strict_mode, false) Application.put_env(:paper_trail, :repo, PaperTrail.Repo) + Application.put_env(:paper_trail, :originator_type, :integer) Code.eval_file("lib/paper_trail.ex") Code.eval_file("lib/version.ex") MultiTenant.setup_tenant(@repo) diff --git a/test/paper_trail/bang_functions_strict_mode_test.exs b/test/paper_trail/bang_functions_strict_mode_test.exs index ebbd18fb..f0103a16 100644 --- a/test/paper_trail/bang_functions_strict_mode_test.exs +++ b/test/paper_trail/bang_functions_strict_mode_test.exs @@ -21,6 +21,7 @@ defmodule PaperTrailTest.StrictModeBangFunctions do setup_all do Application.put_env(:paper_trail, :strict_mode, true) Application.put_env(:paper_trail, :repo, PaperTrail.Repo) + Application.put_env(:paper_trail, :originator_type, :integer) Code.eval_file("lib/paper_trail.ex") Code.eval_file("lib/version.ex") MultiTenant.setup_tenant(@repo) diff --git a/test/paper_trail/paper_trail_version_test.exs b/test/paper_trail/paper_trail_version_test.exs index 730740fb..3ca99963 100644 --- a/test/paper_trail/paper_trail_version_test.exs +++ b/test/paper_trail/paper_trail_version_test.exs @@ -19,6 +19,7 @@ defmodule PaperTrailTest.Version do setup_all do Application.put_env(:paper_trail, :strict_mode, false) Application.put_env(:paper_trail, :repo, PaperTrail.Repo) + Application.put_env(:paper_trail, :originator_type, :integer) Code.eval_file("lib/paper_trail.ex") Code.eval_file("lib/version.ex") MultiTenant.setup_tenant(@repo) diff --git a/test/paper_trail/version_queries_test.exs b/test/paper_trail/version_queries_test.exs index 55d1c0ed..5a7d4d02 100644 --- a/test/paper_trail/version_queries_test.exs +++ b/test/paper_trail/version_queries_test.exs @@ -11,6 +11,9 @@ defmodule PaperTrailTest.VersionQueries do @repo PaperTrail.RepoClient.repo() setup_all do + Application.put_env(:paper_trail, :repo, PaperTrail.Repo) + Application.put_env(:paper_trail, :originator_type, :integer) + Code.eval_file("lib/version.ex") MultiTenant.setup_tenant(@repo) reset_all_data()