Skip to content

Commit 605d700

Browse files
authored
chore: fix dev-utils/ci-tav-slow-jobs.sh (elastic#3319)
- The util accidentally had debugging code that locked it to an old dev/test branch instead of "main" - Improve the util to skip over incomplete tav runs
1 parent e36f003 commit 605d700

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

dev-utils/ci-tav-slow-jobs.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ set -o errexit
2020
set -o pipefail
2121

2222
branch=main
23-
branch=test/action-tav
24-
latestTavRun=$(gh run list -R elastic/apm-agent-nodejs -b "$branch" -w TAV -L 1 --json databaseId --jq '.[].databaseId')
25-
gh api --paginate repos/elastic/apm-agent-nodejs/actions/runs/$latestTavRun/jobs \
23+
latestCompletedTavRun=$(gh run list -R elastic/apm-agent-nodejs -b "$branch" -w TAV -L5 --json status,databaseId | json -c 'this.status==="completed"' | json 0.databaseId)
24+
gh api --paginate repos/elastic/apm-agent-nodejs/actions/runs/$latestCompletedTavRun/jobs \
2625
| json -ga jobs \
2726
| json -ga -e '
28-
this.s = (new Date(this.completed_at) - new Date(this.started_at)) / 1000;
29-
this.minSec = Math.floor(this.s/60) + "m" + (this.s%60).toString().padStart(2,"0") + "s"
27+
this.s = (new Date(this.completed_at || Date.now()) - new Date(this.started_at)) / 1000;
28+
this.minSec = Math.floor(this.s/60) + "m" + (this.s%60).toString().padStart(2,"0").slice(0,2) + "s"
3029
' s minSec name \
3130
| sort -n

0 commit comments

Comments
 (0)