Skip to content

Commit

Permalink
Don't ever skip tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanlong committed May 31, 2018
1 parent f344cd8 commit 76d6ba5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
PGUSER: pgx
PGDATABASE: pgx-test
PGHOST: 127.0.0.1
PGX_FORCE_TESTS: true
TERM: xterm
- image: circleci/postgres:9.6-alpine
environment:
Expand Down
8 changes: 7 additions & 1 deletion pgx_test/src/pgx_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ module Make_tests (IO : Pgx.IO) = struct

type async_test = unit -> unit IO.t

let force_tests =
try
Unix.getenv "PGX_FORCE_TESTS" |> ignore;
true
with Not_found -> false

let set_to_default_db () =
Unix.putenv "PGDATABASE" default_database

Expand All @@ -36,7 +42,7 @@ module Make_tests (IO : Pgx.IO) = struct
with_conn ?database (fun _ ->
return ()))
>>= function
| Error (Unix.Unix_error (Unix.ENOENT, _, _)) ->
| Error (Unix.Unix_error (Unix.ENOENT, _, _)) when not force_tests ->
OUnit2.skip_if true "Could not connect to a PostgreSQL server";
assert false
| Error exn ->
Expand Down

0 comments on commit 76d6ba5

Please sign in to comment.