1
1
Logger . configure ( level: :info )
2
- ExUnit . start exclude: [ :array_type ,
3
- :strict_savepoint ,
4
- :update_with_join ,
5
- :delete_with_join ,
6
- :foreign_key_constraint ,
7
- :modify_column ,
8
- :modify_foreign_key ,
9
- :prefix ,
10
- :remove_column ,
11
- :rename_column ,
12
- :right_join ,
13
- :unique_constraint ,
14
- :uses_usec ,
15
- :transaction_isolation ,
16
- :insert_cell_wise_defaults ,
17
- :modify_foreign_key_on_delete ,
18
- :modify_foreign_key_on_update ,
19
- :alter_primary_key ,
20
- :map_boolean_in_subquery ,
21
- :upsert_all ,
22
- :with_conflict_target ,
23
- :without_conflict_target ,
24
- :decimal_type ]
2
+
3
+ ExUnit . start (
4
+ exclude: [
5
+ :array_type ,
6
+ :strict_savepoint ,
7
+ :update_with_join ,
8
+ :delete_with_join ,
9
+ :foreign_key_constraint ,
10
+ :modify_column ,
11
+ :modify_foreign_key ,
12
+ :prefix ,
13
+ :remove_column ,
14
+ :rename_column ,
15
+ :right_join ,
16
+ :unique_constraint ,
17
+ :uses_usec ,
18
+ :transaction_isolation ,
19
+ :insert_cell_wise_defaults ,
20
+ :modify_foreign_key_on_delete ,
21
+ :modify_foreign_key_on_update ,
22
+ :alter_primary_key ,
23
+ :map_boolean_in_subquery ,
24
+ :upsert_all ,
25
+ :with_conflict_target ,
26
+ :without_conflict_target ,
27
+ :decimal_type
28
+ ]
29
+ )
25
30
26
31
# Configure Ecto for support and tests
27
32
Application . put_env ( :ecto , :primary_key_type , :id )
34
39
35
40
pool =
36
41
case System . get_env ( "ECTO_POOL" ) || "poolboy" do
37
- "poolboy" -> DBConnection.Poolboy
42
+ "poolboy" -> DBConnection.Poolboy
38
43
"sojourn_broker" -> DBConnection.Sojourn
39
44
end
40
45
41
46
# Load support files
42
- Code . require_file "../../deps/ecto/integration_test/support/repo.exs" , __DIR__
43
- Code . require_file "../../deps/ecto/integration_test/support/schemas.exs" , __DIR__
44
- Code . require_file "../../deps/ecto/integration_test/support/migration.exs" , __DIR__
47
+ Code . require_file ( "../../deps/ecto/integration_test/support/repo.exs" , __DIR__ )
48
+ Code . require_file ( "../../deps/ecto/integration_test/support/schemas.exs" , __DIR__ )
49
+ Code . require_file ( "../../deps/ecto/integration_test/support/migration.exs" , __DIR__ )
45
50
46
- Code . require_file "../../test/support/schemas.exs" , __DIR__
47
- Code . require_file "../../test/support/migration.exs" , __DIR__
51
+ Code . require_file ( "../../test/support/schemas.exs" , __DIR__ )
52
+ Code . require_file ( "../../test/support/migration.exs" , __DIR__ )
48
53
49
54
# Pool repo for async, safe tests
50
55
alias Ecto.Integration.TestRepo
@@ -53,7 +58,8 @@ Application.put_env(:ecto, TestRepo,
53
58
adapter: Sqlite.Ecto2 ,
54
59
database: "/tmp/test_repo.db" ,
55
60
pool: Ecto.Adapters.SQL.Sandbox ,
56
- ownership_pool: pool )
61
+ ownership_pool: pool
62
+ )
57
63
58
64
defmodule Ecto.Integration.TestRepo do
59
65
use Ecto.Integration.Repo , otp_app: :ecto
@@ -66,7 +72,8 @@ Application.put_env(:ecto, PoolRepo,
66
72
adapter: Sqlite.Ecto2 ,
67
73
pool: DBConnection.Poolboy ,
68
74
database: "/tmp/test_repo.db" ,
69
- pool_size: 10 )
75
+ pool_size: 10
76
+ )
70
77
71
78
defmodule Ecto.Integration.PoolRepo do
72
79
use Ecto.Integration.Repo , otp_app: :ecto
91
98
{ :ok , _ } = Sqlite.Ecto2 . ensure_all_started ( TestRepo , :temporary )
92
99
93
100
# Load support models and migration
94
- Code . require_file "../../deps/ecto/integration_test/support/schemas.exs" , __DIR__
95
- Code . require_file "../../deps/ecto/integration_test/support/migration.exs" , __DIR__
101
+ Code . require_file ( "../../deps/ecto/integration_test/support/schemas.exs" , __DIR__ )
102
+ Code . require_file ( "../../deps/ecto/integration_test/support/migration.exs" , __DIR__ )
96
103
97
104
# Load up the repository, start it, and run migrations
98
- _ = Sqlite.Ecto2 . storage_down ( TestRepo . config )
99
- :ok = Sqlite.Ecto2 . storage_up ( TestRepo . config )
105
+ _ = Sqlite.Ecto2 . storage_down ( TestRepo . config ( ) )
106
+ :ok = Sqlite.Ecto2 . storage_up ( TestRepo . config ( ) )
100
107
101
- { :ok , _pid } = TestRepo . start_link
102
- { :ok , _pid } = PoolRepo . start_link
108
+ { :ok , _pid } = TestRepo . start_link ( )
109
+ { :ok , _pid } = PoolRepo . start_link ( )
103
110
104
111
:ok = Ecto.Migrator . up ( TestRepo , 0 , Ecto.Integration.Migration , log: false )
105
112
:ok = Ecto.Migrator . up ( TestRepo , 1 , Sqlite.Ecto2.Test.Migration , log: false )
0 commit comments