diff options
author | Will Chandler <wchandler@gitlab.com> | 2022-06-23 06:04:50 +0300 |
---|---|---|
committer | Will Chandler <wchandler@gitlab.com> | 2022-06-23 16:37:16 +0300 |
commit | c1ec6f9c3f19c97c94a62e926e84a491beb74441 (patch) | |
tree | 5a08ade1543093a832ce678bb834953aff2c28c6 | |
parent | 996b5f1a27d22114aafe82eff505ef306f3d9a1d (diff) |
doc: Document how to use debugger with testswc-debug-makefile
Add a section to the beginner's guide on how to use `dlv` to debug
tests via the Makefile.
-rw-r--r-- | doc/beginners_guide.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/beginners_guide.md b/doc/beginners_guide.md index a610aa2db..ab81e1c80 100644 --- a/doc/beginners_guide.md +++ b/doc/beginners_guide.md @@ -228,6 +228,17 @@ called on `testing.T`. [require]: https://github.com/stretchr/testify/tree/master/require [assert]: https://github.com/stretchr/testify/tree/master/assert +##### Using Delve to debug a test + +The process to debug a test in your terminal using +[Delve](https://github.com/go-delve/delve) is almost the same as +[running a single test](#running-a-specific-test), just change the +target to `debug-test-go`: + +``` +TEST_PACKAGES=./internal/gitaly/service/repository TEST_OPTIONS="-count=1 -run=TestRepositoryExists" make debug-test-go +``` + ##### Useful snippets for creating a test ###### testhelper package |