Skip to content

Commit

Permalink
separate unit and integration tests by build tag
Browse files Browse the repository at this point in the history
  • Loading branch information
andersfylling committed Feb 16, 2020
1 parent cdf7e4e commit 4f1f22a
Show file tree
Hide file tree
Showing 34 changed files with 67 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
- name: Integration tests
env:
DISGORD_TOKEN_INTEGRATION_TEST: ${{ secrets.DISGORD_TOKEN_INTEGRATION_TEST }}
run: go test -v -race -tags=integration -coverprofile=coverage.txt -covermode=atomic ./test
run: go test -v -race -tags=integration -coverprofile=coverage-integration.txt -covermode=atomic ./...
- name: Codecov
run: bash <(curl -s https://codecov.io/bash) -t ${{secrets.CODECOV_TOKEN}} -B develop -c -F integration -f "./coverage.txt" -Z
run: bash <(curl -s https://codecov.io/bash) -t ${{secrets.CODECOV_TOKEN}} -B develop -c -F integration -f "./coverage-integration.txt" -Z
unit-tests:
name: unit tests & code coverage
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions auditlog_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions cache_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import "testing"
Expand Down
2 changes: 2 additions & 0 deletions channel_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions client_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions disgord_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions events_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions guild_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/crs/benchmarks_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package crs

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/crs/lfu_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package crs

import "testing"
Expand Down
2 changes: 2 additions & 0 deletions internal/gateway/eventclient_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package gateway

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/gateway/metric_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package gateway

import (
Expand Down
2 changes: 1 addition & 1 deletion internal/gateway/packets_disgordperf_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build disgordperf
// +build disgordperf,!integration

package gateway

Expand Down
2 changes: 2 additions & 0 deletions internal/gateway/packets_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package gateway

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/gateway/queue_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package gateway

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/gateway/ratelimit_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package gateway

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/gateway/sharding_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package gateway

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/gateway/util_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package gateway

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/httd/bucket_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package httd

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/httd/client_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package httd

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/httd/ratelimit_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package httd

// import (
Expand Down
2 changes: 2 additions & 0 deletions internal/httd/request_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package httd

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/util/queue_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package util

import (
Expand Down
2 changes: 2 additions & 0 deletions message_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions reactor_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions rest_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions sort_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions std/msgfilter_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package std

import (
Expand Down
2 changes: 2 additions & 0 deletions struct_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions test/setup.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build integration

package test

import (
Expand Down
2 changes: 2 additions & 0 deletions user_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions utils_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions voice_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !integration

package disgord

import (
Expand Down
2 changes: 2 additions & 0 deletions webhook_test.go
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// +build !integration

package disgord

0 comments on commit 4f1f22a

Please sign in to comment.