forked from gomods/athens
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring more clarity on how to run unit tests (gomods#449)
* The commit brings more clarity on how to run unut tests. The commit chages behaivour of `make test-unit` by adding sourcing of env vars. Documentation is updated to provide more clarity on how to run unit tests. * changed list of commands to run before unit tests * moved env vars to .env * removed dduplicated env var * returned conventional file name in script * link to DEVELOPMENT.md * fixed typo * moved env var export to script * removed export of tmp folder
- Loading branch information
Showing
4 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
ATHENS_MONGO_STORAGE_URL=mongodb://127.0.0.1:27017 | ||
GO_ENV=test_postgres | ||
POP_PATH=$PWD/cmd/proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# test_unit.sh | ||
|
||
source cmd/proxy/.env | ||
|
||
# Run the unit tests with the race detector and code coverage enabled | ||
set -xeuo pipefail | ||
|
||
go test -race -coverprofile cover.out -covermode atomic ./... |