Skip to content
Merged
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
22 changes: 18 additions & 4 deletions .github/actions/create_workflow_report/create_workflow_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,18 @@ def get_prs_in_release_dataframe(

def _checks_latest_test_status_cte(commit_sha: str, branch_name: str) -> str:
"""
Shared filtering for gh-data.checks: anchor time excludes stateless teardown checks
(Stateless% + test_name not matching ^[0-9]{5}); keep rows with check_start_time
>= anchor so main + teardown phases are included.
Shared filtering for gh-data.checks: anchor time selects the latest result batch
per check_name.

Rows that must not set the anchor (but are still kept if their time is >= anchor):
- Stateless teardown: check_name LIKE 'Stateless%' AND test_name not matching ^[0-9]{5}
- Empty test_name: CIDB job-level parent rows
- Pre/Post Hooks: praktika phases with their own stopwatches; Post Hooks always runs
after tests and would otherwise become the sole surviving batch, hiding all FAILs

Keep rows with check_start_time >= anchor so the latest main batch and any later
teardown/hook rows are included. Earlier batches (failed attempts before a rerun
uploaded a newer uniform timestamp) are dropped.
"""
return f"""WITH checks_with_anchor AS (
SELECT
Expand All @@ -396,7 +405,12 @@ def _checks_latest_test_status_cte(commit_sha: str, branch_name: str) -> str:
check_start_time,
maxIf(
check_start_time,
NOT (check_name LIKE 'Stateless%' AND NOT match(test_name, '^[0-9]{{5}}'))
test_name != ''
AND test_name NOT IN ('Pre Hooks', 'Post Hooks')
AND NOT (
check_name LIKE 'Stateless%'
AND NOT match(test_name, '^[0-9]{{5}}')
)
) OVER (PARTITION BY check_name) AS latest_check_start_time
FROM `gh-data`.checks
WHERE commit_sha = '{commit_sha}' AND head_ref = '{branch_name}'
Expand Down
35 changes: 34 additions & 1 deletion .github/actions/create_workflow_report/test_report_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@

Set ``CHECKS_DATABASE_HOST``, ``CLICKHOUSE_TEST_STAT_LOGIN``,
``CLICKHOUSE_TEST_STAT_PASSWORD``.

To capture ``expect`` for a commit:

python3 -c "
import os
from clickhouse_driver import Client
from create_workflow_report import get_checks_fails
c = Client(host=os.environ['CHECKS_DATABASE_HOST'],
user=os.environ['CLICKHOUSE_TEST_STAT_LOGIN'],
password=os.environ['CLICKHOUSE_TEST_STAT_PASSWORD'],
port=9440, secure='y', verify=False, settings={'use_numpy': True})
df = get_checks_fails(c, 'COMMIT_SHA', 'HEAD_REF')
print(repr(tuple(sorted(df['test_name'].tolist()))))
"
"""

import os
Expand All @@ -30,7 +44,7 @@ def check_result_matches_expect(df: pd.DataFrame, expect: list[str]) -> None:
actual = set(df["test_name"].tolist()) if not df.empty else set()
required = set(expect)
if actual != required:
fail(f"test_name mismatch: got {sorted(actual)}; required {sorted(required)}")
fail(f"test results mismatch: got {sorted(actual)}; expected {sorted(required)}")


@TestOutline(Scenario)
Expand Down Expand Up @@ -84,6 +98,25 @@ def check_result_matches_expect(df: pd.DataFrame, expect: list[str]) -> None:
"antalya-25.8",
(),
),
# Post Hooks (later stopwatch) used to set the check_start_time anchor and hide
# Integration FAILs, e.g. AzureQueue on https://github.com/Altinity/ClickHouse/pull/2107.
(
"integration_fail_hidden_by_post_hooks_anchor",
"6185add695010b15869b3dc1bcb9c417621b36bc",
"bump/antalya-26.6/26.6.2.81",
(
"00071_merge_tree_optimize_aio",
"01167_isolation_hermitage",
"01509_parallel_quorum_insert_no_replicas_long",
"03752_attach_as_replicated_transaction_metadata",
"04033_tpc_ds_q20",
"04033_tpc_ds_q39",
"04033_tpc_ds_q58",
"04033_tpc_ds_q71",
"Unknown error",
"test_storage_s3_queue/test_0.py::test_move_after_processing[another_bucket-AzureQueue]",
),
),
],
)
def test_checks_fails_query(self, case_id, commit_sha, head_ref, expect):
Expand Down
Loading