Skip to content

Commit df4ea7e

Browse files
Update to Elixir 1.19 (#139)
* Update to 1.19 * Update to 1.19.2 * Pull elixir * Fix JSON formatter hanging forever * Run on 1.19.4 * adjust expected results for community-garden * Document smoke test gotcha in README --------- Co-authored-by: Jeremie Gillet <jie.gillet@gmail.com>
1 parent 0918beb commit df4ea7e

10 files changed

Lines changed: 25 additions & 17 deletions

File tree

.github/workflows/elixir_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-24.04
88

99
container:
10-
image: hexpm/elixir:1.18.1-erlang-27.2-debian-bookworm-20241223
10+
image: hexpm/elixir:1.19.4-erlang-28.1-debian-bookworm-20251117
1111

1212
steps:
1313
- name: Install git

.github/workflows/exercism_test_helper_build_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-24.04
1212

1313
container:
14-
image: hexpm/elixir:1.18.1-erlang-27.2-debian-bookworm-20241223
14+
image: hexpm/elixir:1.19.4-erlang-28.1-debian-bookworm-20251117
1515

1616
steps:
1717
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
elixir 1.18.1-otp-27
2-
erlang 27.2
1+
elixir 1.19.4-otp-28
2+
erlang 28.1

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM hexpm/elixir:1.18.1-erlang-27.2-debian-bookworm-20241223 as builder
1+
FROM hexpm/elixir:1.19.4-erlang-28.1-debian-bookworm-20251117 as builder
22

33
# Create appuser
44
RUN useradd -ms /bin/bash appuser
@@ -19,7 +19,7 @@ RUN mix local.rebar --force && \
1919
RUN MIX_ENV=prod mix escript.build && \
2020
mv exercism_test_helper /opt/test-runner/bin
2121

22-
FROM hexpm/elixir:1.18.1-erlang-27.2-debian-bookworm-20241223 as runner
22+
FROM hexpm/elixir:1.19.4-erlang-28.1-debian-bookworm-20251117 as runner
2323
COPY --from=builder /etc/passwd /etc/passwd
2424
COPY --from=builder /opt/test-runner /opt/test-runner
2525

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Exercism Automated Test Runner for Elixir Exercises
66

77
## Environment
88

9-
The test runner currently targets exercises supporting Elixir >= 1.14 and Erlang/OTP >= 25, but is running on Elixir 1.18.0 on hexpm's `elixir:1.18.1-erlang-27.2-debian-bookworm-20241223` image.
9+
The test runner currently targets exercises supporting Elixir >= 1.15 and Erlang/OTP >= 26, but is running on Elixir 1.19.4 on hexpm's `elixir:1.19.4-erlang-28.1-debian-bookworm-20251117` image.
1010

1111
The `Dockerfile` also has added `bash`, `jo` and `jq` to the image.
1212

@@ -19,6 +19,10 @@ The `Dockerfile` also has added `bash`, `jo` and `jq` to the image.
1919
2020
---
2121

22+
## Smoke tests
23+
24+
There is a gotcha in the smoke test setup: for the tests to work as expected locally, your **global** Elixir and Erlang versions must also be set to the same values as locally via `.tool-versions`.
25+
2226
## Contributing Guide
2327

2428
For an in-depth discussion of how exercism language tracks and exercises work, please see [CONTRIBUTING.md](https://github.com/exercism/elixir-test-runner/blob/master/CONTRIBUTING.md)

elixir

Submodule elixir updated 188 files

exercism_test_helper/lib/json_formatter.ex

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,7 @@ defmodule JSONFormatter do
235235

236236
# Colorize Utility Functions -- from ExUnit.CLIFormatter, but can't import d/t being private in source
237237

238-
defp colorize(escape, msg, config) when is_doc(msg) do
239-
msg = Inspect.Algebra.format(msg, 2)
240-
colorize(escape, msg, config)
241-
end
242-
243-
defp colorize(escape, string, %{colors: colors}) do
238+
defp colorize(escape, string, %{colors: colors}) when is_binary(string) do
244239
if colors[:enabled] do
245240
[escape, string, :reset]
246241
|> IO.ANSI.format_fragment(true)
@@ -250,6 +245,15 @@ defmodule JSONFormatter do
250245
end
251246
end
252247

248+
defp colorize(escape, msg, config) when is_doc(msg) do
249+
msg =
250+
msg
251+
|> Inspect.Algebra.format(2)
252+
|> IO.iodata_to_binary()
253+
254+
colorize(escape, msg, config)
255+
end
256+
253257
@doc """
254258
Helper function to get the full path of the generated report file.
255259
It can be passed 2 configurations via environment variable

exercism_test_helper/lib/meta/style.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule Meta.Style do
22
def format(ast) do
33
ast
44
|> Macro.to_string()
5-
|> Code.format_string!([line_length: 120, force_do_end_blocks: true])
5+
|> Code.format_string!(line_length: 120, force_do_end_blocks: true)
66
|> IO.iodata_to_binary()
77
end
88
end

exercism_test_helper/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule ExercismTestHelper.MixProject do
55
[
66
app: :exercism_test_helper,
77
version: "0.1.2",
8-
elixir: "~> 1.18",
8+
elixir: "~> 1.19",
99
start_permanent: Mix.env() == :prod,
1010
deps: deps(),
1111
escript: escript()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"message":null,"status":"fail","tests":[{"message":null,"name":"test start returns an alive pid","output":"","status":"pass","task_id":1,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert Process.alive?(pid)"},{"message":" 1) test when started, the registry is empty (CommunityGardenTest)\n \u001b[1m\u001b[30mtest/community_garden_test.exs:11\u001b[0m\n \u001b[31mAssertion with == failed\u001b[0m\n \u001b[36mcode: \u001b[0massert [] == CommunityGarden.list_registrations(pid)\n \u001b[36mleft: \u001b[0m\u001b[31m[]\u001b[0m\n \u001b[36mright: \u001b[0m\u001b[32mnil\u001b[0m\n \u001b[36mstacktrace:\u001b[0m\n test/community_garden_test.exs:14: (test)\n","name":"test when started, the registry is empty","output":"","status":"fail","task_id":2,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert [] == CommunityGarden.list_registrations(pid)"},{"message":" 2) test can register a new plot (CommunityGardenTest)\n \u001b[1m\u001b[30mtest/community_garden_test.exs:18\u001b[0m\n \u001b[31mmatch (=) failed\u001b[0m\n \u001b[36mcode: \u001b[0massert %Plot{} = CommunityGarden.register(pid, \"Johnny Appleseed\")\n \u001b[36mleft: \u001b[0m\u001b[31m%Plot{\n \n}\u001b[0m\n \u001b[36mright: \u001b[0m\u001b[32mnil\u001b[0m\n \u001b[36mstacktrace:\u001b[0m\n test/community_garden_test.exs:21: (test)\n","name":"test can register a new plot","output":"","status":"fail","task_id":3,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert %Plot{} = CommunityGarden.register(pid, \"Johnny Appleseed\")"},{"message":" 3) test maintains a registry of plots (CommunityGardenTest)\n \u001b[1m\u001b[30mtest/community_garden_test.exs:25\u001b[0m\n \u001b[31mmatch (=) failed\u001b[0m\n \u001b[36mcode: \u001b[0massert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\n \u001b[36mleft: \u001b[0m\u001b[31m%Plot{\n \n}\u001b[0m\n \u001b[36mright: \u001b[0m\u001b[32mnil\u001b[0m\n \u001b[36mstacktrace:\u001b[0m\n test/community_garden_test.exs:28: (test)\n","name":"test maintains a registry of plots","output":"","status":"fail","task_id":3,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\nassert [plot] == CommunityGarden.list_registrations(pid)"},{"message":" 4) test can release a plot (CommunityGardenTest)\n \u001b[1m\u001b[30mtest/community_garden_test.exs:33\u001b[0m\n \u001b[31mmatch (=) failed\u001b[0m\n \u001b[36mcode: \u001b[0massert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\n \u001b[36mleft: \u001b[0m\u001b[31m%Plot{\n \n}\u001b[0m\n \u001b[36mright: \u001b[0m\u001b[32mnil\u001b[0m\n \u001b[36mstacktrace:\u001b[0m\n test/community_garden_test.exs:36: (test)\n","name":"test can release a plot","output":"","status":"fail","task_id":4,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\nassert :ok = CommunityGarden.release(pid, plot.plot_id)\nassert [] == CommunityGarden.list_registrations(pid)"},{"message":" 5) test can get registration of a registered plot (CommunityGardenTest)\n \u001b[1m\u001b[30mtest/community_garden_test.exs:42\u001b[0m\n \u001b[31mmatch (=) failed\u001b[0m\n \u001b[36mcode: \u001b[0massert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\n \u001b[36mleft: \u001b[0m\u001b[31m%Plot{\n \n}\u001b[0m\n \u001b[36mright: \u001b[0m\u001b[32mnil\u001b[0m\n \u001b[36mstacktrace:\u001b[0m\n test/community_garden_test.exs:45: (test)\n","name":"test can get registration of a registered plot","output":"","status":"fail","task_id":5,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\nassert %Plot{} = registered_plot = CommunityGarden.get_registration(pid, plot.plot_id)\nassert registered_plot.plot_id == plot.plot_id\nassert registered_plot.registered_to == \"Johnny Appleseed\""},{"message":" 6) test return not_found when attempt to get registration of an unregistered plot (CommunityGardenTest)\n \u001b[1m\u001b[30mtest/community_garden_test.exs:52\u001b[0m\n \u001b[31mmatch (=) failed\u001b[0m\n \u001b[36mcode: \u001b[0massert {:not_found, \"plot is unregistered\"} = CommunityGarden.get_registration(pid, 1)\n \u001b[36mleft: \u001b[0m\u001b[31m{\n :not_found,\n \"plot is unregistered\"\n}\u001b[0m\n \u001b[36mright: \u001b[0m\u001b[32mnil\u001b[0m\n \u001b[36mstacktrace:\u001b[0m\n test/community_garden_test.exs:59: (test)\n","name":"test return not_found when attempt to get registration of an unregistered plot","output":"","status":"fail","task_id":5,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert {:not_found, \"plot is unregistered\"} = CommunityGarden.get_registration(pid, 1)"}],"version":3}
1+
{"message":null,"status":"fail","tests":[{"message":null,"name":"test start returns an alive pid","output":"","status":"pass","task_id":1,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert Process.alive?(pid)"},{"message":" 1) test when started, the registry is empty (CommunityGardenTest)\n \u001B[1m\u001B[30mtest/community_garden_test.exs:11\u001B[0m\n \u001B[31mAssertion with == failed\u001B[0m\n \u001B[36mcode: \u001B[0massert [] == CommunityGarden.list_registrations(pid)\n \u001B[36mleft: \u001B[0m\u001B[31m[]\u001B[0m\n \u001B[36mright: \u001B[0m\u001B[32mnil\u001B[0m\n \u001B[36mstacktrace:\u001B[0m\n test/community_garden_test.exs:14: (test)\n","name":"test when started, the registry is empty","output":"","status":"fail","task_id":2,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert [] == CommunityGarden.list_registrations(pid)"},{"message":" 2) test can register a new plot (CommunityGardenTest)\n \u001B[1m\u001B[30mtest/community_garden_test.exs:18\u001B[0m\n \u001B[31mmatch (=) failed\u001B[0m\n \u001B[36mcode: \u001B[0massert %Plot{} = CommunityGarden.register(pid, \"Johnny Appleseed\")\n \u001B[36mleft: \u001B[0m\u001B[31m%Plot{\n \n}\u001B[0m\n \u001B[36mright: \u001B[0m\u001B[32mnil\u001B[0m\n \u001B[36mstacktrace:\u001B[0m\n test/community_garden_test.exs:21: (test)\n","name":"test can register a new plot","output":"","status":"fail","task_id":3,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert %Plot{} = CommunityGarden.register(pid, \"Johnny Appleseed\")"},{"message":" 3) test maintains a registry of plots (CommunityGardenTest)\n \u001B[1m\u001B[30mtest/community_garden_test.exs:25\u001B[0m\n \u001B[31mmatch (=) failed\u001B[0m\n \u001B[36mcode: \u001B[0massert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\n \u001B[36mleft: \u001B[0m\u001B[31m%Plot{} = plot\u001B[0m\n \u001B[36mright: \u001B[0m\u001B[32mnil\u001B[0m\n \u001B[36mstacktrace:\u001B[0m\n test/community_garden_test.exs:28: (test)\n","name":"test maintains a registry of plots","output":"","status":"fail","task_id":3,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\nassert [plot] == CommunityGarden.list_registrations(pid)"},{"message":" 4) test can release a plot (CommunityGardenTest)\n \u001B[1m\u001B[30mtest/community_garden_test.exs:33\u001B[0m\n \u001B[31mmatch (=) failed\u001B[0m\n \u001B[36mcode: \u001B[0massert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\n \u001B[36mleft: \u001B[0m\u001B[31m%Plot{} = plot\u001B[0m\n \u001B[36mright: \u001B[0m\u001B[32mnil\u001B[0m\n \u001B[36mstacktrace:\u001B[0m\n test/community_garden_test.exs:36: (test)\n","name":"test can release a plot","output":"","status":"fail","task_id":4,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\nassert :ok = CommunityGarden.release(pid, plot.plot_id)\nassert [] == CommunityGarden.list_registrations(pid)"},{"message":" 5) test can get registration of a registered plot (CommunityGardenTest)\n \u001B[1m\u001B[30mtest/community_garden_test.exs:42\u001B[0m\n \u001B[31mmatch (=) failed\u001B[0m\n \u001B[36mcode: \u001B[0massert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\n \u001B[36mleft: \u001B[0m\u001B[31m%Plot{} = plot\u001B[0m\n \u001B[36mright: \u001B[0m\u001B[32mnil\u001B[0m\n \u001B[36mstacktrace:\u001B[0m\n test/community_garden_test.exs:45: (test)\n","name":"test can get registration of a registered plot","output":"","status":"fail","task_id":5,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert %Plot{} = plot = CommunityGarden.register(pid, \"Johnny Appleseed\")\nassert %Plot{} = registered_plot = CommunityGarden.get_registration(pid, plot.plot_id)\nassert registered_plot.plot_id == plot.plot_id\nassert registered_plot.registered_to == \"Johnny Appleseed\""},{"message":" 6) test return not_found when attempt to get registration of an unregistered plot (CommunityGardenTest)\n \u001B[1m\u001B[30mtest/community_garden_test.exs:52\u001B[0m\n \u001B[31mmatch (=) failed\u001B[0m\n \u001B[36mcode: \u001B[0massert {:not_found, \"plot is unregistered\"} = CommunityGarden.get_registration(pid, 1)\n \u001B[36mleft: \u001B[0m\u001B[31m{\n :not_found,\n \"plot is unregistered\"\n}\u001B[0m\n \u001B[36mright: \u001B[0m\u001B[32mnil\u001B[0m\n \u001B[36mstacktrace:\u001B[0m\n test/community_garden_test.exs:59: (test)\n","name":"test return not_found when attempt to get registration of an unregistered plot","output":"","status":"fail","task_id":5,"test_code":"assert {:ok, pid} = CommunityGarden.start()\nassert {:not_found, \"plot is unregistered\"} = CommunityGarden.get_registration(pid, 1)"}],"version":3}

0 commit comments

Comments
 (0)