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 14 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions test/plausible/exports_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -122,7 +124,7 @@
)
end

test "stops on error", %{ch: ch, tmp_dir: tmp_dir} do

Check failure on line 127 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 stops on error (Plausible.ExportsTest)
queries = %{
"1.csv" => from(n in fragment("numbers(1000)"), select: n.number),
"2.csv" => from(n in "no_such_table", select: n.number)
Expand All @@ -138,7 +140,9 @@
end

assert {:error, :einval} =
Copy link
Contributor

@ruslandoga ruslandoga Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert {:error, :einval} =
assert {:error, :bad_eocd} =

(this is sort of expected, since the archive is incomplete in this test)

:zip.unzip(to_charlist(Path.join(tmp_dir, "failed.zip")), cwd: tmp_dir)
: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 @@ -1226,17 +1226,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