-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitserver: Framework to support integration testing against gitserver #62801
gitserver: Framework to support integration testing against gitserver #62801
Conversation
// universal-ctags installed with brew is called ctags, this probably needs work | ||
// in CI. | ||
ctagsConfig.UniversalCommand = "ctags" | ||
svc, err := rockskip.NewService( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the internal code for this, but it would be nice if the integration test could also spawn a symbols server like we do for gitserver here, and solely test via the external facing APIs.
69bb081
to
99dfa7d
Compare
7f51c08
to
858cb3d
Compare
99dfa7d
to
c58423b
Compare
858cb3d
to
44b9087
Compare
c58423b
to
ce3329a
Compare
ce3329a
to
fe0553d
Compare
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.
fe0553d
to
6b84f32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rad!
❯ go test -count=1 ./dev/rockskipintegration/
ok github.com/sourcegraph/sourcegraph/dev/rockskipintegration 0.865s
My desktop linux machine likely has a much better FS without our soc2 monitoring :P
0.8s vs 6s....thanks jamf... |
still quite good for an integration test, but man 😢 |
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.