Skip to content

Commit 4a6fbc3

Browse files
committed
[CR] Use "bencher --build-time" to report time to run tests
- It _is_ a time to run a build-ish step. - Better integration in bencher, shorter more understandable shell script. - bencher will include a nice name in the report.
1 parent c92ffff commit 4a6fbc3

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

.github/workflows/test.yaml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,19 @@ jobs:
5050
uses: actions/setup-go@v4
5151
with:
5252
go-version: "1.24"
53-
- name: Run Go tests
54-
run: |
55-
mkdir ./webui/dist
56-
touch ./webui/dist/index.html
57-
time_out=$(mktemp)
58-
bench_report=$(mktemp)
59-
/usr/bin/time -p -o "$time_out" make test-go
60-
jq -n -R < "$time_out" 'reduce (inputs | split(" ")) as $kv ({}; .[$kv[0]] = {value: ($kv[1] | tonumber)}) | {"test-go-runtime": .}' > "$bench_report"
61-
echo bench_report=$(echo "$bench_report") >> $GITHUB_ENV
6253
- name: Install Bencher
6354
uses: bencherdev/bencher@61e6a2c2e0b4c8f61c87bef598ba9dbafa51c689 # Stable digest for v0.5.8
6455
continue-on-error: true
65-
- name: Report times to Bencher
66-
# OK to fail here, it's just a bencher report
67-
continue-on-error: true
56+
- name: Run Go tests
6857
run: |
69-
ref=${{github.ref_name}}
58+
mkdir ./webui/dist
59+
touch ./webui/dist/index.html
60+
ref=${{ github.ref_name }}
7061
release_slug=$(uname -s -m | tr '[:upper:]' '[:lower:]' | sed 's/[ _]/-/g')
71-
bencher run --adapter json \
72-
--file="${bench_report}" \
73-
--project lakefs \
74-
--branch "$ref" \
75-
--testbed "github-${release_slug}"
76-
- name: What we reported
77-
continue-on-error: true
78-
run: |
79-
cat "${bench_report}"
62+
bencher run --build-time \
63+
--adapter json \
64+
--file="${bench_report}" \
65+
--project lakefs \
66+
--branch "$ref" \
67+
--testbed "github-${release_slug}" \
68+
make test-go

0 commit comments

Comments
 (0)