ci: identify overdue Rust tests and last running target by hash

This commit is contained in:
Kevin Yue committed 2026-11-01 23:35:57 +08:00
1 parent 6f2f8e1265
commit 92943e0a9d
2 files changed
+43

No files matched your search

+11
View File
@@ -34,6 +34,17 @@ def report_tests(output):
for name, line, column in panics}
for fingerprint, line, column in sorted(locations):
print(f'::error::Rust test panic location: {fingerprint} {line}:{column}')
overdue = set(re.findall(r'^test (.+?) has been running for over 60 seconds\r?$',
output, re.MULTILINE))
for fingerprint in sorted(hashlib.sha256(name.encode()).hexdigest() for name in overdue):
print(f'::error::Rust overdue test fingerprint: {fingerprint}')
running = re.findall(r'^\s+Running (.+?) \(([^\r\n]+)\)\r?$', output, re.MULTILINE)
if running:
source, executable = running[-1]
basename = re.sub(r'-[0-9a-f]{16}$', '', Path(executable).name)
identity = f'{" ".join(source.split())} ({basename})'
fingerprint = hashlib.sha256(identity.encode()).hexdigest()
print(f'::error::Rust last running target fingerprint: {fingerprint}')
def main():