Skip to content

Commit db9bb73

Browse files
author
ci bot
committed
Merge branch 'fix-test' into 'enterprise'
fix(tests): bugs related to testing See merge request dkinternal/testgen/dataops-testgen!217
2 parents 093eb68 + 92d4456 commit db9bb73

3 files changed

Lines changed: 24 additions & 13 deletions

File tree

testgen/commands/run_execute_cat_tests.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,20 @@ def FinalizeTestRun(clsCATExecute: CCATExecutionSQL):
7171
])
7272
end_time = datetime.now(UTC)
7373

74-
RunActionQueryList(("DKTG"), [
75-
clsCATExecute.CalcPrevalenceTestResultsSQL(),
76-
clsCATExecute.TestScoringRollupRunSQL(),
77-
clsCATExecute.TestScoringRollupTableGroupSQL(),
78-
])
79-
run_refresh_score_cards_results(
80-
project_code=clsCATExecute.project_code,
81-
add_history_entry=True,
82-
refresh_date=date_service.parse_now(clsCATExecute.run_date),
83-
)
74+
try:
75+
RunActionQueryList(("DKTG"), [
76+
clsCATExecute.CalcPrevalenceTestResultsSQL(),
77+
clsCATExecute.TestScoringRollupRunSQL(),
78+
clsCATExecute.TestScoringRollupTableGroupSQL(),
79+
])
80+
run_refresh_score_cards_results(
81+
project_code=clsCATExecute.project_code,
82+
add_history_entry=True,
83+
refresh_date=date_service.parse_now(clsCATExecute.run_date),
84+
)
85+
except Exception:
86+
LOG.exception("Error refreshing scores after test run")
87+
pass
8488

8589
MixpanelService().send_event(
8690
"run-tests",

testgen/template/validate_tests/ex_get_test_column_list_tg.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
WHERE test_suite_id = '{TEST_SUITE_ID}'
2525
AND COALESCE(test_active, 'Y') = 'Y'
2626
AND t.test_scope = 'referential'
27+
AND t.test_type NOT LIKE 'Aggregate_%'
2728
UNION
2829
-- FROM: groupby_names (should be referential)
2930
SELECT cat_test_id,
@@ -60,6 +61,7 @@
6061
WHERE test_suite_id = '{TEST_SUITE_ID}'
6162
AND COALESCE(test_active, 'Y') = 'Y'
6263
AND t.test_scope = 'referential'
64+
AND t.test_type NOT LIKE 'Aggregate_%'
6365
UNION
6466
-- FROM: match_groupby_names (referential)
6567
SELECT cat_test_id,

testgen/ui/views/test_results.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ def get_test_result_history(selected_row):
381381

382382

383383
def show_test_def_detail(str_test_def_id):
384+
if not str_test_def_id:
385+
st.warning("Test definition no longer exists.")
386+
return
387+
384388
df = get_test_definition(str_test_def_id)
385389

386390
specs = []
@@ -758,9 +762,10 @@ def source_data_dialog(selected_row):
758762

759763

760764
def view_edit_test(button_container, test_definition_id):
761-
with button_container:
762-
if st.button(":material/edit: Edit Test", help="Edit the Test Definition", use_container_width=True):
763-
show_test_form_by_id(test_definition_id)
765+
if test_definition_id:
766+
with button_container:
767+
if st.button(":material/edit: Edit Test", help="Edit the Test Definition", use_container_width=True):
768+
show_test_form_by_id(test_definition_id)
764769

765770

766771
def get_report_file_data(update_progress, tr_data) -> FILE_DATA_TYPE:

0 commit comments

Comments
 (0)