ci: Run tests using PostgreSQL database and mock (#49)

* ci: Run tests using PostgreSQL database and mock

This allows us to use the mock database for quick iterative testing,
and have confidence from CI using a real PostgreSQL database.

PostgreSQL tests are only ran on Linux. They are *really* slow on MacOS
and Windows runners, and don't provide much additional confidence.

* Only run PostgreSQL tests once for speed

* Fix race condition of log after close

Not all resources were cleaned up immediately after a peer connection was
closed. DataChannels could have a goroutine exit after Close() prior to this.

* Fix comment
This commit is contained in:
Kyle Carberry
2022-01-22 21:58:26 +00:00
committed by GitHub
parent dfddaf10a2
commit 50d8151995
6 changed files with 43 additions and 8 deletions
+9 -1
View File
@@ -149,11 +149,19 @@ jobs:
- run: go install gotest.tools/gotestsum@latest
- run:
- name: Test with Mock Database
run:
gotestsum --jsonfile="gotests.json" --packages="./..." --
-covermode=atomic -coverprofile="gotests.coverage" -timeout=3m
-count=3 -race -parallel=2
- name: Test with PostgreSQL Database
if: runner.os == 'Linux'
run:
DB=true gotestsum --jsonfile="gotests.json" --packages="./..." --
-covermode=atomic -coverprofile="gotests.coverage" -timeout=3m
-count=1 -race -parallel=2
- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}