Commit f5db1ae 1 parent 79a7793 commit f5db1ae Copy full SHA for f5db1ae
File tree 3 files changed +23
-21
lines changed
3 files changed +23
-21
lines changed Original file line number Diff line number Diff line change 47
47
run : mix credo
48
48
- name : Run tests
49
49
run :
50
- mix ecto.create
50
+ mix ecto.create -r EctoWatch.TestRepo
51
51
mix test
52
52
env :
53
53
DB_PASSWORD : postgres
Original file line number Diff line number Diff line change
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
+
Original file line number Diff line number Diff line change 1
1
defmodule EctoWatchTest do
2
+ alias EctoWatch.TestRepo
3
+
2
4
use ExUnit.Case , async: false
3
5
4
6
# TODO: Long module names (testing for limits of postgres labels)
@@ -46,26 +48,6 @@ defmodule EctoWatchTest do
46
48
end
47
49
end
48
50
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
-
69
51
setup do
70
52
start_supervised! ( TestRepo )
71
53
You can’t perform that action at this time.
0 commit comments