Skip to content

Commit

Permalink
[devtools/test-oils] Fix typo bug
Browse files Browse the repository at this point in the history
Add --dry-run flag

[benchmarks/osh-runtime] Ad hoc test
  • Loading branch information
Andy Chu committed May 9, 2024
1 parent 2a93467 commit 6f0f279
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
14 changes: 13 additions & 1 deletion benchmarks/osh-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,17 @@ print-tasks-xshar() {
done
}

test-print-tasks-xshar() {
print-tasks-xshar $(hostname) osh 1 1 1
echo
print-tasks-xshar $(hostname) osh 1 2 1
echo
print-tasks-xshar $(hostname) osh 1 2 2
echo
print-tasks-xshar $(hostname) osh 1 2 3
echo
}

run-tasks-wrapper() {
### reads tasks from stdin

Expand Down Expand Up @@ -458,7 +469,8 @@ test-oils-run() {
mkdir -p $raw_out_dir

# Similar to 'measure', for soil-run and release
print-tasks-xshar $host_name $osh $num_iters $num_shells $num_workloads \
print-tasks-xshar $host_name $osh \
$num_iters $num_shells $num_workloads \
| tee $BASE_DIR/tasks.txt

run-tasks-wrapper $host_name $raw_out_dir < $BASE_DIR/tasks.txt
Expand Down
23 changes: 22 additions & 1 deletion devtools/test-oils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ FLAG_num_workloads=1
FLAG_upload=''
FLAG_subdir=''
FLAG_url=http://travis-ci.oilshell.org/wwup.cgi
FLAG_dry_run=''

readonly XSHAR_NAME=test-oils.xshar # hard-coded for now

Expand Down Expand Up @@ -79,6 +80,8 @@ Actions:
--url Upload to this URL
default: $FLAG_url
--dry-run Print out tasks, but don't execute them
Workloads:
EOF
benchmarks/osh-runtime.sh print-workloads
Expand Down Expand Up @@ -145,7 +148,7 @@ parse-flags-osh-runtime() {
die "-w / --num-workloads requires an argument"
fi
shift
FLAG_num_shells=$1
FLAG_num_workloads=$1
;;

-u|--upload)
Expand All @@ -168,6 +171,10 @@ parse-flags-osh-runtime() {
FLAG_url=$1
;;

--dry-run)
FLAG_dry_run=T
;;

*)
die "Invalid flag '$1'"
;;
Expand Down Expand Up @@ -212,6 +219,20 @@ osh-runtime() {
job_id=$(print-job-id) # benchmarks/id.sh
host_name=$(hostname)


if test -n "$FLAG_dry_run"; then
echo
echo '--- Tasks that would be run ---'
echo

benchmarks/osh-runtime.sh print-tasks-xshar $host_name $osh \
$FLAG_num_iters $FLAG_num_shells $FLAG_num_workloads

echo

return
fi

benchmarks/osh-runtime.sh test-oils-run $osh $job_id $host_name \
$FLAG_num_iters $FLAG_num_shells $FLAG_num_workloads

Expand Down

0 comments on commit 6f0f279

Please sign in to comment.