Skip to content

Commit f5c062d

Browse files
authored
Ele 5191 fix for the logic updating test result rows (#908)
* remove unique key for test_result_rows, as it is not really unique * test_result_rows: add row_index and test_type * remove accidentally committed symlink
1 parent a45c384 commit f5c062d

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

macros/edr/tests/on_run_end/handle_tests_results.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@
202202
{% do result_rows.append({
203203
"elementary_test_results_id": test_result.id,
204204
"detected_at": test_result.detected_at,
205-
"result_row": result_row
205+
"result_row": result_row,
206+
"row_index": loop.index,
207+
"test_type": test_result.test_type
206208
}) %}
207209
{% endfor %}
208210
{% endif %}

models/edr/run_results/test_result_rows.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{{
33
config(
44
materialized = 'incremental',
5-
unique_key = 'elementary_test_results_id',
65
on_schema_change = 'append_new_columns',
76
indexes=[{'columns': ['created_at']}, {'columns': ['elementary_test_results_id']}, {'columns': ['detected_at']}] if target.type == "postgres" else [],
87
full_refresh=elementary.get_config_var('elementary_full_refresh'),
@@ -21,4 +20,6 @@
2120
('result_row', 'long_string'),
2221
('detected_at','timestamp'),
2322
('created_at','timestamp'),
23+
('row_index','int'),
24+
('test_type','string'),
2425
]) }}

0 commit comments

Comments
 (0)