Skip to content

Faster campaigns tests, part 2: determine plan without a database.

Warren Gifford requested to merge mrn/faster-tests-2 into main

Created by: mrnugget

Stacked on top of https://github.com/sourcegraph/sourcegraph/pull/16441/files.

We don't need the database since everything is passed in.

on main

$ for i in $(seq 0 5); do time go test ./enterprise/internal/campaigns -count=1; done
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        15.346s
go test ./enterprise/internal/campaigns -count=1  5.63s user 2.71s system 46% cpu 17.913 total
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        15.995s
go test ./enterprise/internal/campaigns -count=1  5.64s user 2.54s system 44% cpu 18.545 total
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        16.017s
go test ./enterprise/internal/campaigns -count=1  5.47s user 2.68s system 43% cpu 18.555 total
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        15.430s
go test ./enterprise/internal/campaigns -count=1  5.47s user 2.61s system 44% cpu 18.008 total
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        15.261s
go test ./enterprise/internal/campaigns -count=1  5.65s user 2.57s system 46% cpu 17.814 total
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        15.367s
go test ./enterprise/internal/campaigns -count=1  5.58s user 2.50s system 45% cpu 17.834 total

after the changes in part 1 and part 2

$ for i in $(seq 0 5); do time go test ./enterprise/internal/campaigns -count=1; done
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        11.493s
go test ./enterprise/internal/campaigns -count=1  5.44s user 2.52s system 56% cpu 14.052 total
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        11.253s
go test ./enterprise/internal/campaigns -count=1  5.58s user 2.55s system 59% cpu 13.735 total
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        10.968s
go test ./enterprise/internal/campaigns -count=1  5.49s user 2.61s system 60% cpu 13.479 total
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        10.464s
go test ./enterprise/internal/campaigns -count=1  5.55s user 2.57s system 62% cpu 13.041 total
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        9.160s
go test ./enterprise/internal/campaigns -count=1  5.48s user 2.63s system 68% cpu 11.818 total
ok      github.com/sourcegraph/sourcegraph/enterprise/internal/campaigns        10.835s

Merge request reports

Loading