From af61cf1405100e9b7d641f5e28928604a1df1d0a Mon Sep 17 00:00:00 2001 From: Magnus Ottenklinger Date: Fri, 20 Oct 2023 22:30:14 +0200 Subject: [PATCH] tests: use LOG_LEVEL or default to info --- mix.exs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mix.exs b/mix.exs index bbf7386..d53c00c 100644 --- a/mix.exs +++ b/mix.exs @@ -29,7 +29,7 @@ defmodule PropCheck.Mixfile do aliases: aliases(), preferred_cli_env: [ tests: :test, - test_ext: :test, + external_tests: :test, parallel_test: :test, test_parallel: :test ], @@ -72,10 +72,10 @@ defmodule PropCheck.Mixfile do def aliases do [ clean: ["clean", "propcheck.clean"], - test_ext: &external_tests/1, + external_tests: &external_tests/1, parallel_test: ["test --include concurrency_test --only concurrency_test"], test_parallel: ["test --include concurrency_test --only concurrency_test"], - tests: ["test_ext", "test"], + tests: [&loglevel/1, "external_tests", "test"], lint: [ "credo --strict", "hex.audit" @@ -92,6 +92,11 @@ defmodule PropCheck.Mixfile do ] end + defp loglevel(_args) do + log_level = System.get_env("LOG_LEVEL", "info") |> String.to_atom() + Logger.configure(level: log_level) + end + defp external_tests(_args) do run = fn arg -> r = Mix.shell().cmd(arg)