Skip to content

Commit

Permalink
exclude tests that use live timing data by default - data is temporar…
Browse files Browse the repository at this point in the history
…ily(?) not accessible
  • Loading branch information
recursiveGecko committed Jun 27, 2024
1 parent bb86adb commit 60d3799
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ config :f1_bot, F1BotWeb.InternalEndpoint,
server: false

# Print only warnings and errors during test
config :logger, level: :warn
config :logger, level: :warning

# Initialize plugs at runtime for faster test compilation
config :phoenix, :plug_init_mode, :runtime
4 changes: 3 additions & 1 deletion test/integration/canada_2022_quali_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ defmodule Integration.Canada2022QualiTest do
use ExUnit.Case, async: true
alias F1Bot.Replay

@moduletag :uses_live_timing_data

setup_all context do
replay_options = %Replay.Options{
exclude_files_regex: ~r/\.z\./
}

{:ok, %{session: session}} =
"http://livetiming.formula1.com/static/2022/2022-06-19_Canadian_Grand_Prix/2022-06-18_Qualifying/"
"https://livetiming.formula1.com/static/2022/2022-06-19_Canadian_Grand_Prix/2022-06-18_Qualifying/"
|> Replay.start_replay(replay_options)

{:ok, fastest_lap} = "1:21.299" |> F1Bot.DataTransform.Parse.parse_lap_time()
Expand Down
4 changes: 3 additions & 1 deletion test/integration/miami_2022_quali_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ defmodule Integration.Miami2022QualiTest do
alias F1Bot.F1Session
alias F1Bot.Replay

@moduletag :uses_live_timing_data

setup_all context do
replay_options = %Replay.Options{
exclude_files_regex: ~r/\.z\./
}

{:ok, %{session: session}} =
"http://livetiming.formula1.com/static/2022/2022-05-08_Miami_Grand_Prix/2022-05-07_Qualifying"
"https://livetiming.formula1.com/static/2022/2022-05-08_Miami_Grand_Prix/2022-05-07_Qualifying"
|> Replay.start_replay(replay_options)

Map.put(context, :session, session)
Expand Down
6 changes: 4 additions & 2 deletions test/integration/monaco_2022_race_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ defmodule Integration.Monaco2022RaceTest do
solved. If the issue being tested here re-appears, a better solution should be found.
"""
use ExUnit.Case, async: true
@moduletag :skip_inconclusive

alias F1Bot.F1Session
alias F1Bot.Replay

@moduletag :skip_inconclusive
@moduletag :uses_live_timing_data

setup_all context do
replay_options = %Replay.Options{
exclude_files_regex: ~r/\.z\./
}

{:ok, %{session: session}} =
"http://livetiming.formula1.com/static/2022/2022-05-29_Monaco_Grand_Prix/2022-05-29_Race"
"https://livetiming.formula1.com/static/2022/2022-05-29_Monaco_Grand_Prix/2022-05-29_Race"
|> Replay.start_replay(replay_options)

Map.put(context, :session, session)
Expand Down
2 changes: 2 additions & 0 deletions test/integration/monza_2022_race_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ defmodule Integration.Monza2022RaceTest do
alias F1Bot.F1Session
alias F1Bot.Replay

@moduletag :uses_live_timing_data

setup_all context do
replay_options = %Replay.Options{
exclude_files_regex: ~r/\.z\./
Expand Down
2 changes: 2 additions & 0 deletions test/integration/saudi_2022_quali_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ defmodule Integration.Saudi2022QualiTest do
alias F1Bot.F1Session
alias F1Bot.Replay

@moduletag :uses_live_timing_data

setup_all context do
replay_options = %Replay.Options{
exclude_files_regex: ~r/\.z\./
Expand Down
7 changes: 6 additions & 1 deletion test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Logger.configure(level: :info)
ExUnit.start(exclude: [skip_inconclusive: true], capture_log: true)

ExUnit.start(
exclude: [skip_inconclusive: true, uses_live_timing_data: true],
capture_log: true
)

Ecto.Adapters.SQL.Sandbox.mode(F1Bot.Repo, :manual)

0 comments on commit 60d3799

Please sign in to comment.