Skip to content

Commit 4ee9c12

Browse files
authored
GODRIVER-3102: Perf comp PR comment pipeline (#2149)
1 parent 910eb26 commit 4ee9c12

File tree

8 files changed

+683
-410
lines changed

8 files changed

+683
-410
lines changed

.evergreen/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,11 @@ functions:
268268
type: test
269269
params:
270270
binary: bash
271+
add_expansions_to_env: true
271272
env:
272273
VERSION_ID: ${version_id}
274+
BASE_SHA: "${revision}"
275+
HEAD_SHA: "${github_commit}"
273276
include_expansions_in_env: [PERF_URI_PRIVATE_ENDPOINT]
274277
args: [*task-runner, perf-pr-comment]
275278

@@ -669,6 +672,7 @@ tasks:
669672
params:
670673
binary: bash
671674
args: [*task-runner, driver-benchmark]
675+
- func: assume-test-secrets-ec2-role
672676
- func: send-perf-data
673677
- func: send-perf-pr-comment
674678

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ go.work.sum
2525
.task
2626
env.sh
2727
expansion.yml
28+
bin
2829

2930
# AWS SAM-generated files
3031
internal/cmd/faas/awslambda/.aws-sam
@@ -38,6 +39,10 @@ internal/cmd/compilecheck/compilecheck.so
3839
api-report.md
3940
api-report.txt
4041

42+
# Ignore perf report files
43+
perf-report.md
44+
perf-report.txt
45+
4146
# Ignore secrets files
4247
secrets-expansion.yml
4348
secrets-export.sh

etc/perf-pr-comment.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,22 @@
55
set -eux
66

77
pushd ./internal/cmd/perfcomp >/dev/null || exist
8-
GOWORK=off go run main.go --project="mongo-go-driver" ${VERSION_ID}
8+
GOWORK=off go build -o ../../../bin/perfcomp .
99
popd >/dev/null
10+
11+
# Generate perf report.
12+
GOWORK=off ./bin/perfcomp compare --project="mongo-go-driver" ${VERSION_ID} > ./internal/cmd/perfcomp/perf-report.txt
13+
14+
if [[ -n "${BASE_SHA+set}" && -n "${HEAD_SHA+set}" && "$BASE_SHA" != "$HEAD_SHA" ]]; then
15+
# Parse and generate perf comparison comment.
16+
GOWORK=off ./bin/perfcomp mdreport
17+
# Make the PR comment.
18+
target=$DRIVERS_TOOLS/.evergreen/github_app/create_or_modify_comment.sh
19+
bash $target -m "## 🧪 Performance Results" -c "$(pwd)/perf-report.md" -h $HEAD_SHA -o "mongodb" -n "mongo-go-driver"
20+
rm ./perf-report.md
21+
else
22+
# Skip comment if it isn't a PR run.
23+
echo "Skipping Perf PR comment"
24+
fi
25+
26+
rm ./internal/cmd/perfcomp/perf-report.txt

0 commit comments

Comments
 (0)