Skip to content

Add OTP 28 to CI #14510

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

Merged
merged 6 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ jobs:
fail-fast: false
matrix:
include:
- otp_version: "27.1"
- otp_version: "28.0"
deterministic: true
- otp_version: "27.1"
- otp_version: "28.0"
erlc_opts: "warnings_as_errors"
coverage: true
- otp_version: "27.1"
- otp_version: "28.0"
otp_latest: true
erlc_opts: "warnings_as_errors"
- otp_version: "27.3"
erlc_opts: "warnings_as_errors"
- otp_version: "27.0"
erlc_opts: "warnings_as_errors"
- otp_version: "26.0"
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ jobs:
otp_version: "26.0"
- otp: 27
otp_version: "27.0"
- otp: 28
otp_version: "28.0"
build_docs: build_docs

runs-on: ubuntu-22.04
Expand Down Expand Up @@ -114,7 +116,7 @@ jobs:
strategy:
fail-fast: true
matrix:
otp: [26, 27]
otp: [26, 27, 28]
flavor: [windows, linux]

env:
Expand Down Expand Up @@ -194,19 +196,19 @@ jobs:
id: git-config
shell: bash
run: git config --global url.https://github.com/.insteadOf ssh://git@github.com/

- name: Checkout project
id: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: "Download Build Artifacts"
id: download-build-artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: "{sign-*-elixir-otp-*,Docs}"
merge-multiple: true
path: /tmp/build-artifacts/

- name: "Run OSS Review Toolkit"
id: ort
uses: ./.github/workflows/ort
Expand Down
28 changes: 14 additions & 14 deletions lib/ex_unit/test/ex_unit/capture_io_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -182,38 +182,38 @@ defmodule ExUnit.CaptureIOTest do

test "with get password" do
capture_io(fn ->
assert :io.get_password() == :eof
assert :io.get_password(Process.group_leader()) == :eof
end)

capture_io("", fn ->
assert :io.get_password() == :eof
assert :io.get_password(Process.group_leader()) == :eof
end)

capture_io("abc", fn ->
assert :io.get_password() == "abc"
assert :io.get_password() == :eof
assert :io.get_password(Process.group_leader()) == "abc"
assert :io.get_password(Process.group_leader()) == :eof
end)

capture_io("abc\n", fn ->
assert :io.get_password() == "abc\n"
assert :io.get_password() == :eof
assert :io.get_password(Process.group_leader()) == "abc\n"
assert :io.get_password(Process.group_leader()) == :eof
end)

capture_io("\n", fn ->
assert :io.get_password() == "\n"
assert :io.get_password() == :eof
assert :io.get_password(Process.group_leader()) == "\n"
assert :io.get_password(Process.group_leader()) == :eof
end)

capture_io("a\nb", fn ->
assert :io.get_password() == "a\n"
assert :io.get_password() == "b"
assert :io.get_password() == :eof
assert :io.get_password(Process.group_leader()) == "a\n"
assert :io.get_password(Process.group_leader()) == "b"
assert :io.get_password(Process.group_leader()) == :eof
end)

capture_io("あい\nう", fn ->
assert :io.get_password() == "あい\n"
assert :io.get_password() == "う"
assert :io.get_password() == :eof
assert :io.get_password(Process.group_leader()) == "あい\n"
assert :io.get_password(Process.group_leader()) == "う"
assert :io.get_password(Process.group_leader()) == :eof
end)
end

Expand Down
Binary file modified lib/mix/test/fixtures/rebar3
Binary file not shown.
22 changes: 14 additions & 8 deletions lib/mix/test/mix/rebar_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ defmodule Mix.RebarTest do
end

test "parses Rebar dependencies" do
assert parse_dep(:git_rebar) == {:git_rebar, override: true}

assert parse_dep({:git_rebar, ~c"~> 1.0"}) == {:git_rebar, "~> 1.0", override: true}

assert parse_dep({:git_rebar, ~c"~> 1.0", {:pkg, :rebar_fork}}) ==
Expand All @@ -86,19 +88,23 @@ defmodule Mix.RebarTest do
assert parse_dep({:git_rebar, {:pkg, :rebar_fork}}) ==
{:git_rebar, override: true, hex: :rebar_fork}

assert parse_dep({:git_rebar, ~c"0.1..*", {:git, @git_rebar_charlist, :main}}) ==
{:git_rebar, ~r"0.1..*", override: true, git: @git_rebar_string, ref: "main"}

assert parse_dep({:git_rebar, {:git, @git_rebar_charlist, :main}}) ==
{:git_rebar, override: true, git: @git_rebar_string, ref: "main"}

assert parse_dep({:git_rebar, ~c"0.1..*", {:git, @git_rebar_charlist}, [:raw]}) ==
{:git_rebar, ~r"0.1..*", override: true, git: @git_rebar_string, compile: false}
assert {:git_rebar, regex, override: true, git: @git_rebar_string, compile: false} =
parse_dep({:git_rebar, ~c"0.1..*", {:git, @git_rebar_charlist}, [:raw]})

assert parse_dep({:git_rebar, ~c"", {:git, @git_rebar_charlist, {:ref, ~c"64691eb"}}}) ==
{:git_rebar, ~r"", override: true, git: @git_rebar_string, ref: "64691eb"}
assert Regex.source(regex) == "0.1..*"

assert parse_dep(:git_rebar) == {:git_rebar, override: true}
assert {:git_rebar, regex, override: true, git: @git_rebar_string, ref: "main"} =
parse_dep({:git_rebar, ~c"0.1..*", {:git, @git_rebar_charlist, :main}})

assert Regex.source(regex) == "0.1..*"

assert {:git_rebar, regex, override: true, git: @git_rebar_string, ref: "64691eb"} =
parse_dep({:git_rebar, ~c"", {:git, @git_rebar_charlist, {:ref, ~c"64691eb"}}})

assert Regex.source(regex) == ""
end
end

Expand Down
56 changes: 1 addition & 55 deletions lib/mix/test/mix/tasks/test_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -286,61 +286,7 @@ defmodule Mix.Tasks.TestTest do

Port.command(port, "\n")

assert receive_until_match(port, "No stale tests", "") =~ "Restarting..."
end)
end

@tag :unix
test "does not exit on compilation failure" do
in_fixture("test_stale", fn ->
File.write!("lib/b.ex", """
defmodule B do
def f, do: error_not_a_var
end
""")

port = mix_port(~w[test --listen-on-stdin])

assert receive_until_match(port, "error", "") =~ "lib/b.ex"

File.write!("lib/b.ex", """
defmodule B do
def f, do: A.f
end
""")

Port.command(port, "\n")

assert receive_until_match(port, "0 failures", "") =~ "2 tests"

File.write!("test/b_test_stale.exs", """
defmodule BTest do
use ExUnit.Case

test "f" do
assert B.f() == error_not_a_var
end
end
""")

Port.command(port, "\n")

message = "undefined variable \"error_not_a_var\""
assert receive_until_match(port, message, "") =~ "test/b_test_stale.exs"

File.write!("test/b_test_stale.exs", """
defmodule BTest do
use ExUnit.Case

test "f" do
assert B.f() == :ok
end
end
""")

Port.command(port, "\n")

assert receive_until_match(port, "0 failures", "") =~ "2 tests"
assert receive_until_match(port, "Restarting...", "") =~ "Restarting..."
end)
end
end
Expand Down