Skip to content

Commit 620eb66

Browse files
Rodrigo ÁlvarezPapipo
Rodrigo Álvarez
authored andcommitted
Exclude gleam tests if gleam is missing
1 parent 5c28e1e commit 620eb66

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/mix/test/mix/gleam_test.exs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Code.require_file("../test_helper.exs", __DIR__)
66

77
defmodule Mix.GleamTest do
88
use MixTest.Case
9+
@moduletag :gleam
910

1011
@compile {:no_warn_undefined, [:gleam_dep, :gleam@int]}
1112

lib/mix/test/test_helper.exs

+10-1
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,18 @@ cover_exclude =
4646
[]
4747
end
4848

49+
gleam_exclude =
50+
try do
51+
Mix.Gleam.require!()
52+
[]
53+
rescue
54+
Mix.Error -> [gleam: true]
55+
end
56+
4957
ExUnit.start(
5058
trace: !!System.get_env("TRACE"),
51-
exclude: epmd_exclude ++ os_exclude ++ git_exclude ++ line_exclude ++ cover_exclude,
59+
exclude:
60+
epmd_exclude ++ os_exclude ++ git_exclude ++ line_exclude ++ cover_exclude ++ gleam_exclude,
5261
include: line_include,
5362
# Many mix tests spawns separate processes which leads to failures on Windows CI
5463
max_cases: if(match?({:win32, _}, :os.type()), do: 1, else: System.schedulers_online() * 2)

0 commit comments

Comments
 (0)