Skip to content

Commit

Permalink
Update default postgres user for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Olson committed Oct 21, 2020
1 parent 42a88e3 commit c691950
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ otp_release:
elixir:
- 1.11.1
before_script:
- export SCRIVENER_ECTO_DB_USER=postgres
- MIX_ENV=test mix db.reset
script:
- mix test
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ First, you'll need to build the test database.
MIX_ENV=test mix db.reset
```

This task assumes you have postgres installed and that your current user can create / drop databases. If you'd prefer to use a different user, you can specify it with the environment variable `SCRIVENER_ECTO_DB_USER`.
This task assumes you have postgres installed and that the `postgres` user can create / drop databases. If you'd prefer to use a different user, you can specify it with the environment variable `SCRIVENER_ECTO_DB_USER`.

With the database built, you can now run the tests.

Expand Down
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ config :scrivener_ecto, Scrivener.Ecto.Repo,
adapter: Ecto.Adapters.Postgres,
pool: Ecto.Adapters.SQL.Sandbox,
database: "scrivener_test",
username: System.get_env("SCRIVENER_ECTO_DB_USER") || System.get_env("USER")
username: System.get_env("SCRIVENER_ECTO_DB_USER") || "postgres"

config :logger, :console, level: :error
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ services:
ports:
- "127.0.0.1:5432:5432"
environment:
- POSTGRES_USER=${USER}
- POSTGRES_HOST_AUTH_METHOD=trust

0 comments on commit c691950

Please sign in to comment.