Skip to content

Commit 4ddccfc

Browse files
committed
workbench: fix run iteration
1 parent 1b7a906 commit 4ddccfc

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ERA ?= bage
1212

1313
PROFILE ?= default-${ERA}
1414
REV ?= master
15+
ITER ?=
1516
ARGS ?=
1617
CMD ?=
1718
RUN ?=

lib.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ ifeq ($(7),true)
1212
$(1): ARGS += --arg 'profiled' true
1313
endif
1414
ifeq ($(5)$(6),truetrue)
15-
$(1): CMD := start-cluster; return
15+
$(1): CMD := start-cluster $(if ${ITER},--iterations ${ITER}); return
1616
endif
1717
ifeq ($(5)$(6),truefalse)
18-
$(1): RUN := start-cluster
18+
$(1): RUN := start-cluster $(if ${ITER},--iterations ${ITER})
1919
endif
2020
ifeq ($(3)$(4)$(5)$(6),falsetruefalsefalse)
2121
define EXTRA_HELP +=

nix.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ membench-5-at: ## Membench: 5 iterations, set commit by: make membench-5-at RE
1515

1616
workbench-ci-test smoke: ## Workbench: test a-la Hydra, the ci-test profile, full Nix engaged
1717
nix build --out-link result-ci-test '.#hydraJobsPr.linux.native.workbench-ci-test' --cores 0
18-
mv result-ci-test run/`jq -r .meta.tag result-ci-test/meta.json`/
18+
ID=`jq -r .meta.tag result-ci-test/meta.json`; test -e "run/$$ID" || mv result-ci-test "run/$$ID"

nix/workbench/wb

+6-4
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ start()
155155
profile_name=${profile_name:-$(jq '.name' -r $profile/profile.json)}
156156
analysis_type=$(jq '.analysis.type' -r $profile/profile.json)
157157

158-
progress "top-level" "iterations of profile $(with_color 'yellow' $profile_name): $(with_color 'white' $iterations)"
159-
for ((i=0; i<$iterations; i++))
160-
do local args=(
158+
local top_i
159+
for ((top_i=0; top_i<$iterations; top_i++))
160+
do progress "top-level" "profile $(with_color 'yellow' $profile_name), iteration $(with_color 'white' $((top_i+1))) of $(with_color 'yellow' $iterations)"
161+
local args=(
161162
${run_allocate_args[@]}
162163
--manifest "$(manifest collect-from-checkout "$node_source" $node_rev)"
163164
)
@@ -172,7 +173,8 @@ start()
172173
if test -n "$no_analysis" -o $analysis_type = null; then continue; fi
173174

174175
progress "top-level | analysis" "analysis type $(with_color yellow $analysis_type) on $(with_color white $tag)"
175-
analyse ${analyse_args[@]} $analysis_type $tag ||
176+
analyse ${analyse_args[@]} $analysis_type $tag &&
177+
progress "run | analysis" "done" ||
176178
if test -n "$analysis_can_fail" -a -z "$no_retry_failed_runs"
177179
then progress "run | analysis" "log processing failed, but --analysis-can-fail prevents failure: $(with_color red $tag)"
178180
iterations=$((iterations + 1))

0 commit comments

Comments
 (0)