mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user