Skip to content

Commit

Permalink
format test/**/*.exs
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski committed Oct 5, 2023
1 parent 5524177 commit 7a213ac
Show file tree
Hide file tree
Showing 8 changed files with 2,914 additions and 1,654 deletions.
1,470 changes: 934 additions & 536 deletions test/ecto/adapters/myxql_test.exs

Large diffs are not rendered by default.

2,064 changes: 1,330 additions & 734 deletions test/ecto/adapters/postgres_test.exs

Large diffs are not rendered by default.

210 changes: 137 additions & 73 deletions test/ecto/adapters/tds_test.exs

Large diffs are not rendered by default.

326 changes: 224 additions & 102 deletions test/ecto/migration_test.exs

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions test/ecto/migrator_repo_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defmodule Ecto.MigratorRepoTest do
use Ecto.Repo, otp_app: :ecto_sql, adapter: EctoSQL.TestAdapter
end

Application.put_env(:ecto_sql, MainRepo, [migration_repo: MigrationRepo])
Application.put_env(:ecto_sql, MainRepo, migration_repo: MigrationRepo)

setup do
{:ok, _} = start_supervised({MigrationsAgent, [{1, nil}, {2, nil}, {3, nil}]})
Expand All @@ -46,9 +46,9 @@ defmodule Ecto.MigratorRepoTest do
def put_test_adapter_config(config) do
Application.put_env(:ecto_sql, EctoSQL.TestAdapter, config)

on_exit fn ->
on_exit(fn ->
Application.delete_env(:ecto, EctoSQL.TestAdapter)
end
end)
end

setup_all do
Expand All @@ -60,7 +60,9 @@ defmodule Ecto.MigratorRepoTest do
describe "migration_repo option" do
test "upwards and downwards migrations" do
assert run(MainRepo, [{3, ChangeMigration}, {4, Migration}], :up, to: 4, log: false) == [4]
assert run(MainRepo, [{2, ChangeMigration}, {3, Migration}], :down, all: true, log: false) == [3, 2]

assert run(MainRepo, [{2, ChangeMigration}, {3, Migration}], :down, all: true, log: false) ==
[3, 2]
end

test "down invokes the repository adapter with down commands" do
Expand All @@ -74,13 +76,13 @@ defmodule Ecto.MigratorRepoTest do
end

test "migrations run inside a transaction if the adapter supports ddl transactions when configuring a migration repo" do
capture_log fn ->
capture_log(fn ->
put_test_adapter_config(supports_ddl_transaction?: true, test_process: self())
up(MainRepo, 0, Migration)

assert_receive {:transaction, %{repo: MainRepo}, _}
assert_receive {:lock_for_migrations, %{repo: MigrationRepo}, _, _}
end
end)
end
end
end
Loading

0 comments on commit 7a213ac

Please sign in to comment.