Skip to content

Commit 8073340

Browse files
authored
Small edits to the Soak Tests (#32)
* Delete oldest snapshots by commit SHA and by run ID * Use upstream create-an-issue because maintainer plans to release fix for repo values
1 parent 8370241 commit 8073340

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.github/scripts/performance-tests/produce_metric_widget_images.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -366,17 +366,21 @@ def parse_args():
366366
f"Will create a snapshot at URL: https://github.com/{args.github_repository}/blob/gh-pages/{snapshot_location}",
367367
)
368368

369-
# Delete oldest snapshots
370-
371-
snapshot_dirs_length = len(os.listdir(SOAK_TESTS_SNAPSHOTS_COMMITS_DIR))
372-
373-
if snapshot_dirs_length > args.max_benchmarks_to_keep:
374-
oldest_snapshot_dirs = nsmallest(
375-
snapshot_dirs_length - args.max_benchmarks_to_keep,
376-
Path(SOAK_TESTS_SNAPSHOTS_COMMITS_DIR).iterdir(),
377-
key=os.path.getmtime,
378-
)
379-
for old_snapshots_dir in oldest_snapshot_dirs:
380-
shutil.rmtree(old_snapshots_dir, ignore_errors=True)
369+
# Delete oldest run folders in most recent commit and oldest commit folders
370+
371+
for snapshots_dir in [
372+
SOAK_TESTS_SNAPSHOTS_COMMITS_DIR,
373+
f"{SOAK_TESTS_SNAPSHOTS_COMMITS_DIR}/{ args.target_sha }/runs",
374+
]:
375+
snapshot_dirs_length = len(os.listdir(snapshots_dir))
376+
377+
if snapshot_dirs_length > args.max_benchmarks_to_keep:
378+
oldest_snapshot_dirs = nsmallest(
379+
snapshot_dirs_length - args.max_benchmarks_to_keep,
380+
Path(snapshots_dir).iterdir(),
381+
key=os.path.getmtime,
382+
)
383+
for old_snapshots_dir in oldest_snapshot_dirs:
384+
shutil.rmtree(old_snapshots_dir, ignore_errors=True)
381385

382386
logger.info("Done creating metric widget images.")

.github/workflows/soak-testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ jobs:
245245
with:
246246
filename: .github/auto-issue-templates/failure-during-soak_tests.md
247247
- name: Publish Issue if failed AFTER Performance Tests
248-
uses: NathanielRN/create-an-issue@v2.5.1-alpha2
248+
uses: JasonEtco/create-an-issue@v2
249249
if: ${{ github.event_name == 'schedule' &&
250250
steps.check-failure-after-performance-tests.outcome == 'failure' }}
251251
env:

0 commit comments

Comments
 (0)