Skip to content

test(integration): add GetChangedTargets benchmarks#204

Open
yushan8 wants to merge 2 commits into
mainfrom
add-getchangedtargets-benchmarks
Open

test(integration): add GetChangedTargets benchmarks#204
yushan8 wants to merge 2 commits into
mainfrom
add-getchangedtargets-benchmarks

Conversation

@yushan8

@yushan8 yushan8 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a make benchmark target that measures GetChangedTargets latency against three fixed, checked-in commit pairs of increasing diff size (small/medium/large).
  • Measurement only — no pass/fail thresholds, not part of make test / make test-integration, and never invoked from CI.
  • Widens repoRemote/startServer/newClient/getChangedTargets in integration_test.go from *testing.T to testing.TB so the existing integration harness can be reused from Benchmark* functions.

Test plan

  • make gazelleintegration/BUILD.bazel picked up the new benchmark_test.go
  • make test-integration — existing integration tests still pass unchanged
  • make benchmark — all three benchmarks run and report ns/op, exits 0

Add a `make benchmark` target that measures GetChangedTargets latency
against three fixed, checked-in commit pairs of increasing diff size
(small/medium/large). This is measurement-only: it has no pass/fail
thresholds, is not part of `make test` / `make test-integration`, and
is never invoked from CI, so a slow run can never fail the build.

- Widen repoRemote/startServer/newClient/getChangedTargets in
  integration_test.go from *testing.T to testing.TB so the existing
  integration test harness can be reused from Benchmark* functions.
- Add integration/benchmark_test.go with three benchmarks pinned to
  fixed commit SHAs in this repo's own history.
- Add benchmark_test.go to the integration_test BUILD.bazel target via
  `make gazelle`.
- Add the `make benchmark` target, which runs the same bazel go_test
  binary with -test.run=^$ -test.bench=. so only benchmarks execute.

Test Plan:
- make gazelle (confirmed BUILD.bazel picked up the new file)
- make test-integration (existing tests still pass unchanged)
- make benchmark (all three benchmarks run and report ns/op, exits 0)
@yushan8 yushan8 marked this pull request as ready for review July 15, 2026 16:47
@yushan8 yushan8 requested review from a team as code owners July 15, 2026 16:47
ns/op is hard to eyeball at these durations (calls take seconds, not
nanoseconds). Add a sec/op custom metric via b.ReportMetric alongside
the built-in ns/op, computed from b.Elapsed() so it reflects the same
timer window (post-ResetTimer).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant