From ee6ed7558fc2fb71b6a219bbc7a3609786da6a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81=C4=99picki?= Date: Thu, 17 Feb 2022 10:06:26 +0100 Subject: Update Mix.TasksTestTest for Erlang/OTP 25 (#11637) The order in which tests get executed can be different depending on Erlang/OTP version The test failure was: 1) test logs and errors umbrella with file path (Mix.Tasks.TestTest) test/mix/tasks/test_test.exs:432 Assertion with =~ failed code: assert mix(["test", "apps/unknown_app/test"]) =~ "==> bar\nPaths given to \"mix test\" did not match any directory/file: apps/unknown_app/test\n==> foo\nPaths given to \"mix test\" did not match any directory/file: apps/unknown_app/test\n" left: "==> foo\nCompiling 1 file (.ex)\nGenerated foo app\n==> bar\nCompiling 1 file (.ex)\nGenerated bar app\n==> foo\nPaths given to \"mix test\" did not match any directory/file: apps/unknown_app/test\n==> bar\nPaths given to \"mix test\" did not match any directory/file: apps/unknown_app/test\n" right: "==> bar\nPaths given to \"mix test\" did not match any directory/file: apps/unknown_app/test\n==> foo\nPaths given to \"mix test\" did not match any directory/file: apps/unknown_app/test\n" stacktrace: test/mix/tasks/test_test.exs:436: anonymous fn/0 in Mix.Tasks.TestTest."test logs and errors umbrella with file path"/1 (elixir 1.14.0-dev) lib/file.ex:1555: File.cd!/2 test/test_helper.exs:127: MixTest.Case.in_fixture/3 test/mix/tasks/test_test.exs:433: (test) --- lib/mix/test/mix/tasks/test_test.exs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/mix/test/mix/tasks/test_test.exs b/lib/mix/test/mix/tasks/test_test.exs index ada8e45ba..3da900a71 100644 --- a/lib/mix/test/mix/tasks/test_test.exs +++ b/lib/mix/test/mix/tasks/test_test.exs @@ -433,9 +433,14 @@ defmodule Mix.Tasks.TestTest do in_fixture("umbrella_test", fn -> # Run false positive test first so at least the code is compiled # and we can perform more aggressive assertions later - assert mix(["test", "apps/unknown_app/test"]) =~ """ + output = mix(["test", "apps/unknown_app/test"]) + + assert output =~ """ ==> bar Paths given to "mix test" did not match any directory/file: apps/unknown_app/test + """ + + assert output =~ """ ==> foo Paths given to "mix test" did not match any directory/file: apps/unknown_app/test """ -- cgit v1.2.1