mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-07 12:38:05 +00:00
CI: Better mutual exclusivity of unit and integration tests
This commit is contained in:
parent
783dfe7ba6
commit
77d6067340
|
@ -24,10 +24,12 @@
|
||||||
"unit_test": {
|
"unit_test": {
|
||||||
"stage": "test",
|
"stage": "test",
|
||||||
"timeout": "2m", # 2 minutes
|
"timeout": "2m", # 2 minutes
|
||||||
|
# Don't run the test if we have a $BOT_TOKEN, because
|
||||||
|
# integration_test will run instead.
|
||||||
|
"exclude": {
|
||||||
|
"variables": [ "$BOT_TOKEN" ]
|
||||||
|
},
|
||||||
"script": [
|
"script": [
|
||||||
# Don't run the test if we have a $BOT_TOKEN, because
|
|
||||||
# integration_test will run instead.
|
|
||||||
"[ $BOT_TOKEN ] && exit",
|
|
||||||
"go test -v -coverprofile $COV ./...",
|
"go test -v -coverprofile $COV ./...",
|
||||||
"go tool cover -func $COV"
|
"go tool cover -func $COV"
|
||||||
]
|
]
|
||||||
|
@ -35,10 +37,12 @@
|
||||||
"integration_test": {
|
"integration_test": {
|
||||||
"stage": "test",
|
"stage": "test",
|
||||||
"timeout": "2m", # 2 minutes
|
"timeout": "2m", # 2 minutes
|
||||||
|
# Run the test only if we have $BOT_TOKEN, else fallback to unit
|
||||||
|
# tests.
|
||||||
|
"only": {
|
||||||
|
"variables": [ "$BOT_TOKEN" ]
|
||||||
|
},
|
||||||
"script": [
|
"script": [
|
||||||
# Run the test only if we have $BOT_TOKEN, else fallback to unit
|
|
||||||
# tests.
|
|
||||||
"[ ! $BOT_TOKEN ] && exit",
|
|
||||||
"go get ./...",
|
"go get ./...",
|
||||||
# Test this package along with dismock.
|
# Test this package along with dismock.
|
||||||
"go test -coverpkg $tested -coverprofile $COV -tags integration -v ./... $dismock",
|
"go test -coverpkg $tested -coverprofile $COV -tags integration -v ./... $dismock",
|
||||||
|
|
Loading…
Reference in a new issue