]> Kevux Git Server - rit/commit
t0213: add trace2 cmd_ancestry tests
authorMatthew John Cheetham <mjcheetham@outlook.com>
Fri, 13 Feb 2026 19:55:00 +0000 (19:55 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Feb 2026 20:18:32 +0000 (12:18 -0800)
commit3c8c638df66d6a77d280a04321aeb18b2ad61338
tree9663986c3f0bafa9d32c7af80a247d197ea2eb6c
parentb6a125b936bfb05de704243e1fa568d4a9ad9a11
t0213: add trace2 cmd_ancestry tests

Add a new test script t0213-trace2-ancestry.sh that verifies
cmd_ancestry events across all three trace2 output formats (normal,
perf, and event).

The tests use the "400ancestry" test helper to spawn child processes
with controlled trace2 environments. Git alias resolution (which
spawns a child git process) creates a predictable multi-level process
tree. Filter functions extract cmd_ancestry events from each format,
truncating the ancestor list at the outermost "test-tool" so that only
the controlled portion of the tree is verified, regardless of the test
runner environment.

A runtime prerequisite (TRACE2_ANCESTRY) is used to detect whether the
platform has a real procinfo implementation; platforms with only the
stub are skipped.

We must pay attention to an extra ancestor on Windows (MINGW) when
running without the bin-wrappers (such as we do in CI). In this
situation we see an extra "sh.exe" ancestor after "test-tool.exe".

Also update the comment in t0210-trace2-normal.sh to reflect that
ancestry testing now has its own dedicated test script.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/meson.build
t/t0210-trace2-normal.sh
t/t0213-trace2-ancestry.sh [new file with mode: 0755]