Skip to content

Commit f5db1ae

Browse files
committedJul 30, 2024
chore: Try new github actions config
1 parent 79a7793 commit f5db1ae

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed
 

‎.github/workflows/elixir.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: mix credo
4848
- name: Run tests
4949
run:
50-
mix ecto.create
50+
mix ecto.create -r EctoWatch.TestRepo
5151
mix test
5252
env:
5353
DB_PASSWORD: postgres

‎lib/test_repo.ex

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
defmodule EctoWatch.TestRepo do
2+
use Ecto.Repo,
3+
otp_app: :ecto_watch,
4+
adapter: Ecto.Adapters.Postgres
5+
6+
def init(_type, config) do
7+
{:ok,
8+
Keyword.merge(
9+
config,
10+
username: "postgres",
11+
password: "postgres",
12+
hostname: "localhost",
13+
database: "ecto_watch",
14+
stacktrace: true,
15+
show_sensitive_data_on_connection_error: true,
16+
pool_size: 10
17+
)}
18+
end
19+
end
20+

‎test/ecto_watch_test.exs

+2-20
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
defmodule EctoWatchTest do
2+
alias EctoWatch.TestRepo
3+
24
use ExUnit.Case, async: false
35

46
# TODO: Long module names (testing for limits of postgres labels)
@@ -46,26 +48,6 @@ defmodule EctoWatchTest do
4648
end
4749
end
4850

49-
defmodule TestRepo do
50-
use Ecto.Repo,
51-
otp_app: :ecto_watch,
52-
adapter: Ecto.Adapters.Postgres
53-
54-
def init(_type, config) do
55-
{:ok,
56-
Keyword.merge(
57-
config,
58-
username: "postgres",
59-
password: "postgres",
60-
hostname: "localhost",
61-
database: "ecto_watch",
62-
stacktrace: true,
63-
show_sensitive_data_on_connection_error: true,
64-
pool_size: 10
65-
)}
66-
end
67-
end
68-
6951
setup do
7052
start_supervised!(TestRepo)
7153

0 commit comments

Comments
 (0)