Fix formatting
This commit is contained in:
parent
6fa4f08e67
commit
d95e1066b9
4 changed files with 19 additions and 5 deletions
|
|
@ -4,7 +4,9 @@ defmodule Mix.Tasks.Pleroma.TestRunner do
|
||||||
use Mix.Task
|
use Mix.Task
|
||||||
|
|
||||||
def run(args \\ []) do
|
def run(args \\ []) do
|
||||||
case System.cmd("mix", ["test", "--warnings-as-errors"] ++ args, into: IO.stream(:stdio, :line)) do
|
case System.cmd("mix", ["test", "--warnings-as-errors"] ++ args,
|
||||||
|
into: IO.stream(:stdio, :line)
|
||||||
|
) do
|
||||||
{_, 0} ->
|
{_, 0} ->
|
||||||
:ok
|
:ok
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ defmodule Pleroma.Application do
|
||||||
Finch.start_link(name: MyFinch)
|
Finch.start_link(name: MyFinch)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Disable warnings_as_errors at runtime, it breaks Phoenix live reload
|
# Disable warnings_as_errors at runtime, it breaks Phoenix live reload
|
||||||
# due to protocol consolidation warnings
|
# due to protocol consolidation warnings
|
||||||
# :warnings_as_errors is deprecated via Code.compiler_options/2 since 1.18
|
# :warnings_as_errors is deprecated via Code.compiler_options/2 since 1.18
|
||||||
|
|
|
||||||
|
|
@ -2670,7 +2670,11 @@ defmodule Pleroma.UserTest do
|
||||||
assert {:ok, user} = User.update_last_active_at(user)
|
assert {:ok, user} = User.update_last_active_at(user)
|
||||||
|
|
||||||
assert NaiveDateTime.compare(user.last_active_at, test_started_at) in [:gt, :eq]
|
assert NaiveDateTime.compare(user.last_active_at, test_started_at) in [:gt, :eq]
|
||||||
assert NaiveDateTime.compare(user.last_active_at, NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)) in [:lt, :eq]
|
|
||||||
|
assert NaiveDateTime.compare(
|
||||||
|
user.last_active_at,
|
||||||
|
NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)
|
||||||
|
) in [:lt, :eq]
|
||||||
|
|
||||||
last_active_at =
|
last_active_at =
|
||||||
NaiveDateTime.utc_now()
|
NaiveDateTime.utc_now()
|
||||||
|
|
@ -2681,11 +2685,16 @@ defmodule Pleroma.UserTest do
|
||||||
user
|
user
|
||||||
|> cast(%{last_active_at: last_active_at}, [:last_active_at])
|
|> cast(%{last_active_at: last_active_at}, [:last_active_at])
|
||||||
|> User.update_and_set_cache()
|
|> User.update_and_set_cache()
|
||||||
|
|
||||||
assert NaiveDateTime.compare(user.last_active_at, last_active_at) == :eq
|
assert NaiveDateTime.compare(user.last_active_at, last_active_at) == :eq
|
||||||
|
|
||||||
assert {:ok, user} = User.update_last_active_at(user)
|
assert {:ok, user} = User.update_last_active_at(user)
|
||||||
assert NaiveDateTime.compare(user.last_active_at, test_started_at) in [:gt, :eq]
|
assert NaiveDateTime.compare(user.last_active_at, test_started_at) in [:gt, :eq]
|
||||||
assert NaiveDateTime.compare(user.last_active_at, NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)) in [:lt, :eq]
|
|
||||||
|
assert NaiveDateTime.compare(
|
||||||
|
user.last_active_at,
|
||||||
|
NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)
|
||||||
|
) in [:lt, :eq]
|
||||||
end
|
end
|
||||||
|
|
||||||
test "active_user_count/1" do
|
test "active_user_count/1" do
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,11 @@ defmodule Pleroma.Web.Plugs.UserTrackingPlugTest do
|
||||||
|> UserTrackingPlug.call(%{})
|
|> UserTrackingPlug.call(%{})
|
||||||
|
|
||||||
assert NaiveDateTime.compare(user.last_active_at, test_started_at) in [:gt, :eq]
|
assert NaiveDateTime.compare(user.last_active_at, test_started_at) in [:gt, :eq]
|
||||||
assert NaiveDateTime.compare(user.last_active_at, NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)) in [:lt, :eq]
|
|
||||||
|
assert NaiveDateTime.compare(
|
||||||
|
user.last_active_at,
|
||||||
|
NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)
|
||||||
|
) in [:lt, :eq]
|
||||||
end
|
end
|
||||||
|
|
||||||
test "doesn't update last_active_at if it was updated recently", %{conn: conn} do
|
test "doesn't update last_active_at if it was updated recently", %{conn: conn} do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue