sourcegraph/dev/gitserverintegration/BUILD.bazel
Erik Seliger 1287243cae
gitserver: Framework to support integration testing against gitserver (#62801)
This PR tinkers a bit with building a test helper to run integration
tests that are still ~lightweight against a real gitserver.
The caller can either clone a real repo to disk / embed it in the git
repo, or can create a small repo on the fly, and then get a running
gitserver gRPC server that returns all the data required.

These tests should only exist outside of cmd/ and internal/, as there is
a big potential to do cross-cmd imports from here, which can cause bad
coupling. But for just these tests, that should be fine.

The most trivial rockskip indexing job that I put in here to POC this
runs in 6.3s, including all setup and teardown. That seems very
reasonable to me.

Test plan:

The POC test passes.
2024-06-07 17:01:12 +02:00

23 lines
725 B
Python

load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "gitserverintegration",
srcs = ["testtools.go"],
importpath = "github.com/sourcegraph/sourcegraph/dev/gitserverintegration",
visibility = ["//visibility:public"],
deps = [
"//cmd/gitserver/shared",
"//internal/api",
"//internal/database/dbmocks",
"//internal/gitserver",
"//internal/gitserver/v1:gitserver",
"//internal/grpc/defaults",
"//internal/observation",
"//internal/types",
"//lib/errors",
"@com_github_sourcegraph_log//logtest",
"@com_github_stretchr_testify//require",
"@org_golang_google_grpc//:go_default_library",
],
)