1
1
Logger . configure ( level: :info )
2
2
3
- ExUnit . start (
3
+ ExUnit . configure (
4
4
exclude: [
5
5
:array_type ,
6
6
:strict_savepoint ,
7
7
:update_with_join ,
8
8
:delete_with_join ,
9
9
:foreign_key_constraint ,
10
10
:modify_column ,
11
+ :modify_column_with_from ,
11
12
:modify_foreign_key ,
12
13
:prefix ,
13
14
:remove_column ,
@@ -20,7 +21,7 @@ ExUnit.start(
20
21
:modify_foreign_key_on_delete ,
21
22
:modify_foreign_key_on_update ,
22
23
:alter_primary_key ,
23
- :map_boolean_in_subquery ,
24
+ :map_boolean_in_expression ,
24
25
:upsert_all ,
25
26
:with_conflict_target ,
26
27
:without_conflict_target ,
@@ -30,53 +31,54 @@ ExUnit.start(
30
31
31
32
# Configure Ecto for support and tests
32
33
Application . put_env ( :ecto , :primary_key_type , :id )
33
-
34
- # Old Ecto files don't compile cleanly in Elixir 1.4, so we disable warnings first.
35
- case System . version ( ) do
36
- "1.4." <> _ -> Code . compiler_options ( warnings_as_errors: false )
37
- _ -> :ok
38
- end
39
-
40
- pool =
41
- case System . get_env ( "ECTO_POOL" ) || "poolboy" do
42
- "poolboy" -> DBConnection.Poolboy
43
- "sojourn_broker" -> DBConnection.Sojourn
44
- end
34
+ Application . put_env ( :ecto , :async_integration_tests , true )
35
+ Application . put_env ( :ecto_sql , :lock_for_update , "FOR UPDATE" )
45
36
46
37
# Load support files
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__ )
38
+ Code . require_file ( "../../deps/ecto_sql /integration_test/support/repo.exs" , __DIR__ )
39
+ Code . require_file ( "../../deps/ecto_sql /integration_test/support/file_helpers .exs" , __DIR__ )
40
+ Code . require_file ( "../../deps/ecto_sql /integration_test/support/migration.exs" , __DIR__ )
50
41
51
42
Code . require_file ( "../../test/support/schemas.exs" , __DIR__ )
52
43
Code . require_file ( "../../test/support/migration.exs" , __DIR__ )
53
44
54
45
# Pool repo for async, safe tests
55
46
alias Ecto.Integration.TestRepo
56
47
57
- Application . put_env ( :ecto , TestRepo ,
48
+ Application . put_env ( :ecto_sql , TestRepo ,
58
49
adapter: Sqlite.Ecto2 ,
59
50
database: "/tmp/test_repo.db" ,
60
- pool: Ecto.Adapters.SQL.Sandbox ,
61
- ownership_pool: pool
51
+ pool: Ecto.Adapters.SQL.Sandbox
62
52
)
63
53
64
54
defmodule Ecto.Integration.TestRepo do
65
- use Ecto.Integration.Repo , otp_app: :ecto
55
+ use Ecto.Integration.Repo , otp_app: :ecto_sql , adapter: Sqlite.Ecto2
56
+
57
+ def create_prefix ( prefix ) do
58
+ "create schema #{ prefix } "
59
+ end
60
+
61
+ def drop_prefix ( prefix ) do
62
+ "drop schema #{ prefix } "
63
+ end
64
+
65
+ def uuid do
66
+ Ecto.UUID
67
+ end
66
68
end
67
69
68
70
# Pool repo for non-async tests
69
71
alias Ecto.Integration.PoolRepo
70
72
71
- Application . put_env ( :ecto , PoolRepo ,
73
+ Application . put_env ( :ecto_sql , PoolRepo ,
72
74
adapter: Sqlite.Ecto2 ,
73
- pool: DBConnection.Poolboy ,
75
+ pool: DBConnection.ConnectionPool ,
74
76
database: "/tmp/test_repo.db" ,
75
77
pool_size: 10
76
78
)
77
79
78
80
defmodule Ecto.Integration.PoolRepo do
79
- use Ecto.Integration.Repo , otp_app: :ecto
81
+ use Ecto.Integration.Repo , otp_app: :ecto_sql , adapter: Sqlite.Ecto2
80
82
81
83
def create_prefix ( prefix ) do
82
84
"create schema #{ prefix } "
@@ -95,11 +97,12 @@ defmodule Ecto.Integration.Case do
95
97
end
96
98
end
97
99
98
- { :ok , _ } = Sqlite.Ecto2 . ensure_all_started ( TestRepo , :temporary )
100
+ { :ok , _ } = Sqlite.Ecto2 . ensure_all_started ( TestRepo . config ( ) , :temporary )
101
+ # TODO: FIX THIS?
99
102
100
103
# Load support models and migration
101
104
Code . require_file ( "../../deps/ecto/integration_test/support/schemas.exs" , __DIR__ )
102
- Code . require_file ( "../../deps/ecto/integration_test/support/migration .exs" , __DIR__ )
105
+ Code . require_file ( "../../deps/ecto/integration_test/support/types .exs" , __DIR__ )
103
106
104
107
# Load up the repository, start it, and run migrations
105
108
_ = Sqlite.Ecto2 . storage_down ( TestRepo . config ( ) )
@@ -112,3 +115,5 @@ _ = Sqlite.Ecto2.storage_down(TestRepo.config())
112
115
:ok = Ecto.Migrator . up ( TestRepo , 1 , Sqlite.Ecto2.Test.Migration , log: false )
113
116
Ecto.Adapters.SQL.Sandbox . mode ( TestRepo , :manual )
114
117
Process . flag ( :trap_exit , true )
118
+
119
+ ExUnit . start ( )
0 commit comments