Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump elixir to 1.17.3 and OTP to 27.2.1 #5040

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true

env:
CACHE_VERSION: v8
CACHE_VERSION: v9
PERSISTENT_CACHE_DIR: cached

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
erlang 27.0
elixir 1.17.1-otp-27
erlang 27.2.1
elixir 1.17.3-otp-27
nodejs 21.7.3
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# platform specific, it makes sense to build it in the docker

#### Builder
FROM hexpm/elixir:1.17.1-erlang-27.0-alpine-3.20.1 AS buildcontainer
FROM hexpm/elixir:1.17.3-erlang-27.2.1-alpine-3.20.5 AS buildcontainer
ruslandoga marked this conversation as resolved.
Show resolved Hide resolved

ARG MIX_ENV=ce

Expand Down Expand Up @@ -54,7 +54,7 @@ COPY rel rel
RUN mix release plausible

# Main Docker Image
FROM alpine:3.20.1
FROM alpine:3.20.5
LABEL maintainer="plausible.io <[email protected]>"

ARG BUILD_METADATA={}
Expand Down
10 changes: 7 additions & 3 deletions test/plausible/exports_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
{:ok, ch: start_supervised!({Ch, config})}
end

test "creates zip archive", %{ch: ch, tmp_dir: tmp_dir} do

Check failure on line 75 in test/plausible/exports_test.exs

View workflow job for this annotation

GitHub Actions / Build and test (ce_test, postgres:16)

test stream_archive/3 creates zip archive (Plausible.ExportsTest)
queries = %{
"1.csv" => from(n in fragment("numbers(3)"), select: n.number),
"2.csv" =>
Expand All @@ -89,7 +89,9 @@
end)

assert {:ok, files} =
:zip.unzip(to_charlist(Path.join(tmp_dir, "numbers.zip")), cwd: tmp_dir)
ruslandoga marked this conversation as resolved.
Show resolved Hide resolved
:zip.unzip(to_charlist(Path.join(tmp_dir, "numbers.zip")),
cwd: to_charlist(tmp_dir)
)

assert Enum.map(files, &Path.basename/1) == ["1.csv", "2.csv"]

Expand Down Expand Up @@ -137,8 +139,10 @@
end)
end

assert {:error, :einval} =
:zip.unzip(to_charlist(Path.join(tmp_dir, "failed.zip")), cwd: tmp_dir)
assert {:error, :bad_eocd} =
:zip.unzip(to_charlist(Path.join(tmp_dir, "failed.zip")),
cwd: to_charlist(tmp_dir)
)
end
end
end
8 changes: 5 additions & 3 deletions test/plausible/imported/csv_importer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,17 +1228,19 @@ defmodule Plausible.Imported.CSVImporterTest do
)
)
else
File.rename!(context.local_path, Path.join(tmp_dir, "plausible-export.zip"))
Plausible.File.mv!(context.local_path, Path.join(tmp_dir, "plausible-export.zip"))
end

context
end

defp unzip_archive(%{tmp_dir: tmp_dir} = context) do
assert {:ok, files} =
:zip.unzip(to_charlist(Path.join(tmp_dir, "plausible-export.zip")), cwd: tmp_dir)
:zip.unzip(to_charlist(Path.join(tmp_dir, "plausible-export.zip")),
cwd: to_charlist(tmp_dir)
)

Map.put(context, :exported_files, files)
Map.put(context, :exported_files, Enum.map(files, &to_string/1))
end
ruslandoga marked this conversation as resolved.
Show resolved Hide resolved

defp upload_csvs(%{exported_files: files} = context) do
Expand Down
Loading