Skip update check in tests (#2593)

This commit is contained in:
Jonatan Kłosko 2024-05-09 07:12:14 +02:00 committed by GitHub
parent 2348214f19
commit 4f7826fd77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,7 +44,7 @@ defmodule Livebook.UpdateCheck do
@impl true @impl true
def init({}) do def init({}) do
state = %{ state = %{
enabled: Livebook.Settings.update_check_enabled?(), enabled: update_check_enabled?(),
new_version: nil, new_version: nil,
timer_ref: nil, timer_ref: nil,
request_ref: nil request_ref: nil
@ -102,6 +102,12 @@ defmodule Livebook.UpdateCheck do
def handle_info(_msg, state), do: {:noreply, state} def handle_info(_msg, state), do: {:noreply, state}
if Mix.env() == :test do
defp update_check_enabled?(), do: false
else
defp update_check_enabled?(), do: Livebook.Settings.update_check_enabled?()
end
defp schedule_check(%{enabled: false} = state, _time), do: state defp schedule_check(%{enabled: false} = state, _time), do: state
defp schedule_check(state, time) do defp schedule_check(state, time) do