possibility to run rollback in test env
This commit is contained in:
parent
0ca13be499
commit
538af14d52
|
@ -20,7 +20,8 @@ defmodule Mix.Tasks.Pleroma.Ecto.Rollback do
|
||||||
start: :boolean,
|
start: :boolean,
|
||||||
quiet: :boolean,
|
quiet: :boolean,
|
||||||
log_sql: :boolean,
|
log_sql: :boolean,
|
||||||
migrations_path: :string
|
migrations_path: :string,
|
||||||
|
env: :string
|
||||||
]
|
]
|
||||||
|
|
||||||
@moduledoc """
|
@moduledoc """
|
||||||
|
@ -59,7 +60,7 @@ def run(args \\ []) do
|
||||||
level = Logger.level()
|
level = Logger.level()
|
||||||
Logger.configure(level: :info)
|
Logger.configure(level: :info)
|
||||||
|
|
||||||
if Pleroma.Config.get(:env) == :test do
|
if opts[:env] == "test" do
|
||||||
Logger.info("Rollback succesfully")
|
Logger.info("Rollback succesfully")
|
||||||
else
|
else
|
||||||
{:ok, _, _} =
|
{:ok, _, _} =
|
||||||
|
|
|
@ -12,7 +12,7 @@ test "ecto.rollback info message" do
|
||||||
Logger.configure(level: :warn)
|
Logger.configure(level: :warn)
|
||||||
|
|
||||||
assert capture_log(fn ->
|
assert capture_log(fn ->
|
||||||
Mix.Tasks.Pleroma.Ecto.Rollback.run()
|
Mix.Tasks.Pleroma.Ecto.Rollback.run(["--env", "test"])
|
||||||
end) =~ "[info] Rollback succesfully"
|
end) =~ "[info] Rollback succesfully"
|
||||||
|
|
||||||
Logger.configure(level: level)
|
Logger.configure(level: level)
|
||||||
|
|
Loading…
Reference in a new issue