From b615257c26869a22f15716bb402557fb6b3a21ed Mon Sep 17 00:00:00 2001 From: Mayel de Borniol Date: Tue, 13 Feb 2024 19:30:57 +0000 Subject: [PATCH] configurable logging in test env --- .github/workflows/test.yaml | 6 ++++-- flavours/classic/config/test.exs | 12 +++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 49b11897e29..19e44b47c94 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,6 +19,8 @@ jobs: POSTGRES_HOST: postgres POSTGRES_PASSWORD: postgres CI: true + TEST_LOG_TRUNCATE: 340 + TEST_LOG_LEVEL: error SECRET_KEY_BASE: "kSNSvYkWk14onNdbYzhEqFyG5TzpOO9+FFlk5sIrhTk0RV6+FeL/nM8DWQffDah4woepgQdrP6J8cjWGyehcWcRWvIIWXsghp0yY9/fEjgfUekD15P9LGRCmu6exIQ6g" SIGNING_SALT: "NPkqpeTx/q9xGQRWwRpqBWI7bCxeHMAF4L2PHntfjVtd8GZD2BQKe9KLnkIR5WbLVdZt24FWuR+Hy5WoXaZM4APydGvC2+w2enJmskOckX5VY1Bpvm7JGKu+QymgIgK/" ENCRYPTION_SALT: "l+QT/gkdX722f57qSAUc+bZcqm5ZduXY4D0hp0glEiKdR267JsZ1/CZlrlhADcD8kzuaZGFWvJ2dlr6sujbzGQV5e04lKVIsZh3gfd8eqQBckIqH6L8TDRRz4M07YE+F" @@ -84,8 +86,8 @@ jobs: run: mix bonfire.deps.update - name: Fetch any differences in nested deps (+ run post-install setup) run: just deps-get && just pre-init - - name: Clean-build Bonfire data extensions - run: mix bonfire.deps.clean.data + # - name: Clean-build Bonfire data extensions + # run: mix bonfire.deps.clean.data - name: Compile deps & app run: mix compile - name: Set up database diff --git a/flavours/classic/config/test.exs b/flavours/classic/config/test.exs index ce12a3315f8..bf910de3d8e 100755 --- a/flavours/classic/config/test.exs +++ b/flavours/classic/config/test.exs @@ -21,16 +21,22 @@ config :bonfire_search, ## Other general test config +truncate = case System.get_env("TEST_LOG_TRUNCATE", "1000") do + "0" -> :infinity + truncate -> String.to_integer(truncate) +end + config :logger, - level: :error, - truncate: :infinity + level: String.to_existing_atom(System.get_env("TEST_LOG_LEVEL", "info")), + truncate: truncate + +config :logger, :console, truncate: truncate if !test_instance? do # to supress non-captured logs in tests (eg. in setup_all) config :logger, backends: [] end -config :logger, :console, truncate: :infinity # Configure your database # db = "bonfire_test#{System.get_env("MIX_TEST_PARTITION")}"