Skip to content

Commit

Permalink
Fix oban option, split operations in CSV import export test
Browse files Browse the repository at this point in the history
  • Loading branch information
apata committed Mar 4, 2025
1 parent 294f6da commit 06be244
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/plausible/imported/csv_importer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ defmodule Plausible.Imported.CSVImporterTest do
storage: on_ee(do: "s3", else: "local")
)

assert %{success: 1} = Oban.drain_queue(queue: :analytics_imports, with_safety?: false)
assert %{success: 1} = Oban.drain_queue(queue: :analytics_imports, with_safety: false)

assert %SiteImport{
start_date: ~D[2011-12-25],
Expand Down Expand Up @@ -414,7 +414,7 @@ defmodule Plausible.Imported.CSVImporterTest do
storage: on_ee(do: "s3", else: "local")
)

assert %{success: 1} = Oban.drain_queue(queue: :analytics_imports, with_safety?: false)
assert %{success: 1} = Oban.drain_queue(queue: :analytics_imports, with_safety: false)

assert %SiteImport{
start_date: ~D[2021-12-30],
Expand Down Expand Up @@ -484,7 +484,7 @@ defmodule Plausible.Imported.CSVImporterTest do
storage: on_ee(do: "s3", else: "local")
)

assert %{success: 1} = Oban.drain_queue(queue: :analytics_imports, with_safety?: false)
assert %{success: 1} = Oban.drain_queue(queue: :analytics_imports, with_safety: false)

assert %SiteImport{
start_date: ~D[2011-12-25],
Expand Down Expand Up @@ -546,7 +546,7 @@ defmodule Plausible.Imported.CSVImporterTest do
storage: on_ee(do: "s3", else: "local")
)

assert %{discard: 1} = Oban.drain_queue(queue: :analytics_imports, with_safety?: false)
assert %{discard: 1} = Oban.drain_queue(queue: :analytics_imports, with_safety: false)

# TODO
# assert {:discard, message} = Plausible.Workers.ImportAnalytics.perform(job)
Expand Down Expand Up @@ -1269,8 +1269,10 @@ defmodule Plausible.Imported.CSVImporterTest do
end

defp unzip_archive(%{tmp_dir: tmp_dir} = context) do
{:ok, binary} = :file.read_file(to_charlist(Path.join(tmp_dir, "plausible-export.zip")))

assert {:ok, files} =
:zip.unzip(to_charlist(Path.join(tmp_dir, "plausible-export.zip")),
:zip.unzip(binary,
cwd: to_charlist(tmp_dir)
)

Expand Down

0 comments on commit 06be244

Please sign in to comment.