Skip to content

Commit 2bdc235

Browse files
committed
test: filter out expired test builds in bisect_builds.py
1 parent f9852b3 commit 2bdc235

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/bisect_builds.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def get_test_builds(releases: List[Revision]):
136136
continue
137137

138138
artifacts = get_workflow_run_artifact_names(run.id)
139-
if not artifacts:
139+
if not artifacts or any(a for a in artifacts if a.expired):
140140
continue
141141

142142
revisions.append(
@@ -184,10 +184,10 @@ def get_release_package_url(tag):
184184
def download_release(tag: str):
185185
url = get_release_package_url(tag)
186186
dest = releases_dir / tag
187-
if dest.exists():
187+
if dest.exists() and list(dest.glob('*')):
188188
return dest
189189

190-
dest.mkdir(parents=True)
190+
dest.mkdir(parents=True, exist_ok=True)
191191
print(f'downloading release {tag}')
192192

193193
r = requests.get(url)
@@ -233,10 +233,10 @@ def download_artifact(gh, repo, artifact, dest):
233233

234234
def download_test_build(workflow_run: WorkflowRun):
235235
dest: Path = test_builds_dir / workflow_run.head_sha
236-
if dest.exists():
236+
if dest.exists() and list(dest.glob('*')):
237237
return dest
238238

239-
dest.mkdir(parents=True)
239+
dest.mkdir(parents=True, exist_ok=True)
240240
print(f'downloading test build {workflow_run.head_sha}')
241241

242242
found_artifact = None
@@ -257,7 +257,7 @@ def download_test_build(workflow_run: WorkflowRun):
257257

258258
download_dir = tempfile.TemporaryDirectory()
259259
download_artifact(gh, 'ZQuestClassic/ZQuestClassic',
260-
artifact, download_dir.name)
260+
found_artifact, download_dir.name)
261261
# Build artifacts have a single file, which is an archive.
262262
archive_path = next(Path(download_dir.name).glob('*'))
263263

0 commit comments

Comments
 (0)