Skip to content
Open
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
2 changes: 1 addition & 1 deletion macros/edr/materializations/test/test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% endmaterialization %}

{% macro materialize_test(materialization_macro) %}
{% if not elementary.is_elementary_enabled() %}
{% if not elementary.should_collect_test_results() %}
{% do return(materialization_macro()) %}
{% endif %}

Expand Down
16 changes: 16 additions & 0 deletions macros/edr/system/configuration/should_collect_test_results.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% macro should_collect_test_results() %}
{#
Determine if Elementary should collect and cache test results.
We skip collection if:
1. We are NOT in the execution phase (compilation/parsing).
2. Elementary infrastructure is not configured.
3. Test results collection is explicitly disabled via config.
4. This is an EDR CLI run (initialization is skipped in on_run_start).
#}
{% set is_enabled = elementary.is_elementary_enabled() %}
{% set tests_results_enabled = not elementary.get_config_var('disable_tests_results') %}
{% set edr_cli_run = elementary.get_config_var('edr_cli_run') %}

{% set should_collect = execute and is_enabled and tests_results_enabled and not edr_cli_run %}
{% do return(should_collect) %}
{% endmacro %}