github.com/prebid/prebid-server/v2@v2.18.0/docs/developers/automated-tests.md (about) 1 # Automated Tests 2 3 This project uses GitHub Actions to make sure that every PR passes automated tests. 4 To reproduce these tests locally, use: 5 6 ``` 7 ./validate --nofmt --cov 8 ``` 9 10 ## Writing Tests 11 12 Tests for `some-file.go` should be placed in the file `some-file_test.go` in the same package. 13 For more info on how to write tests in Go, see [the Go docs](https://golang.org/pkg/testing/). 14 15 ## Adapter Tests 16 17 If your adapter makes HTTP calls using standard JSON, you should use the 18 [RunJSONBidderTest](https://github.com/prebid/prebid-server/blob/master/adapters/adapterstest/test_json.go#L50) function. 19 20 This will be much more thorough, convenient, maintainable, and reusable than writing standard Go tests 21 for your adapter. 22 23 ## Concurrency Tests 24 25 Code which creates new goroutines should include tests which thoroughly exercise its concurrent behavior. 26 The names of functions which test concurrency should start with `TestRace`. For example `TestRaceAuction` or `TestRaceCurrency`. 27 28 The `./validate.sh` script will run these using the [Race Detector](https://golang.org/doc/articles/race_detector.html).