Skip to content

Commit

Permalink
docs: add unit test tags flag
Browse files Browse the repository at this point in the history
As we use tags for the unit test files, they don't run if one does not provide the tags=unit flag to the test execution command. This change adds the description of how one is to do this when running the tests in a shell, as well as how to add it to the VS Code extension.
  • Loading branch information
o-liver authored Jun 4, 2024
1 parent 683ca35 commit 046c56b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ httpClient.SetOptions(clientOptions)
1. [Global function pointers](#global-function-pointers)
1. [Test Parallelization](#test-parallelization)

Unit tests are done using basic `golang` means.
Unit tests are done using basic `golang` means. As the test files are tagged add the corresponding tag to the run command, as for example `go test -run ^TestRunAbapAddonAssemblyKitCheck$ github.com/SAP/jenkins-library/cmd -tags=unit`. In VSCode this can be done by adding the flag `"-tags=unit"` to the list of `"go.testFlags"` in the `settings.json` of the go extension.

Additionally, we encourage you to use [github.com/stretchr/testify/assert](https://github.com/stretchr/testify/assert)
in order to have slimmer assertions if you like. A good pattern to follow is this:
Expand Down

0 comments on commit 046c56b

Please sign in to comment.