1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-09-30 06:01:17 +00:00

CI: Better mutual exclusivity of unit and integration tests

This commit is contained in:
diamondburned (Forefront) 2020-05-30 15:19:51 -07:00
parent 783dfe7ba6
commit 77d6067340

View file

@ -24,10 +24,12 @@
"unit_test": { "unit_test": {
"stage": "test", "stage": "test",
"timeout": "2m", # 2 minutes "timeout": "2m", # 2 minutes
"script": [
# Don't run the test if we have a $BOT_TOKEN, because # Don't run the test if we have a $BOT_TOKEN, because
# integration_test will run instead. # integration_test will run instead.
"[ $BOT_TOKEN ] && exit", "exclude": {
"variables": [ "$BOT_TOKEN" ]
},
"script": [
"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
"script": [
# Run the test only if we have $BOT_TOKEN, else fallback to unit # Run the test only if we have $BOT_TOKEN, else fallback to unit
# tests. # tests.
"[ ! $BOT_TOKEN ] && exit", "only": {
"variables": [ "$BOT_TOKEN" ]
},
"script": [
"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",