From 701a2cc27709ef9d75dda40e95f62556aec83925 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 27 Feb 2025 22:01:59 -0500 Subject: [PATCH] tests/manual: trim saved state The statefile that tracks the progress of a bisect will today have all the builds from a given stream in it when really it only needs to keep track of the range of builds between the known good and known bad entries. Let's trim it to just that range of builds. --- tests/manual/coreos-builds-bisect.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/manual/coreos-builds-bisect.py b/tests/manual/coreos-builds-bisect.py index 49a27a9f00..20ac156e2b 100755 --- a/tests/manual/coreos-builds-bisect.py +++ b/tests/manual/coreos-builds-bisect.py @@ -76,6 +76,7 @@ # cosa kola run --build=$build ext.config.mynewtestiwrote import argparse +import copy import json import os import os.path @@ -146,6 +147,18 @@ def initialize_builds_info(buildsjson, arch, badbuild, goodbuild): info[badbuild]['heuristic'] = 'GIVEN' info[goodbuild]['status'] = 'GOOD' info[goodbuild]['heuristic'] = 'GIVEN' + + # Trim the builds we're operating on in the info dict to just the + # range between the bad and good builds + in_range = False + for key, _ in copy.deepcopy(info).items(): + if key == badbuild: + in_range = True + if not in_range: + info.pop(key) + if key == goodbuild: + in_range = False + return info