From 3e21f0685dde639d7535473b15796f9827fe39fa Mon Sep 17 00:00:00 2001 From: Paolo Patierno Date: Fri, 27 Aug 2021 19:02:13 +0200 Subject: [PATCH] Added build tag for unit tests and GitHub action (#77) * Added build tag for unit tests Signed-off-by: Paolo Patierno * Added unit tests GitHub action workflow Signed-off-by: Paolo Patierno * Moved unit tests run in the acceptance workflow Deleted unit tests GitHub action workflow Signed-off-by: Paolo Patierno --- .github/workflows/acceptance.yml | 6 +++++- internal/config/canary_config_test.go | 2 ++ internal/security/auth_test.go | 2 ++ internal/services/backoff_test.go | 2 ++ internal/services/canary_message_test.go | 2 ++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index 67a1cf8..6746714 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -23,7 +23,11 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.16 + + - name: Unit tests + run: | + go test ./internal/... --tags=unit_test - - name: Test + - name: E2E tests run: | go test ./test/... --tags=e2e diff --git a/internal/config/canary_config_test.go b/internal/config/canary_config_test.go index 302e845..6aae82d 100644 --- a/internal/config/canary_config_test.go +++ b/internal/config/canary_config_test.go @@ -3,6 +3,8 @@ // License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). // +// +build unit_test + // Package config defining the canary configuration parameters package config diff --git a/internal/security/auth_test.go b/internal/security/auth_test.go index cc82495..5994b86 100644 --- a/internal/security/auth_test.go +++ b/internal/security/auth_test.go @@ -3,6 +3,8 @@ // License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). // +// +build unit_test + // Package security defining some security related tools package security diff --git a/internal/services/backoff_test.go b/internal/services/backoff_test.go index fd5ae78..48e2c41 100644 --- a/internal/services/backoff_test.go +++ b/internal/services/backoff_test.go @@ -3,6 +3,8 @@ // License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). // +// +build unit_test + // Package services defines an interface for canary services and related implementations package services diff --git a/internal/services/canary_message_test.go b/internal/services/canary_message_test.go index cf9903e..54a6898 100644 --- a/internal/services/canary_message_test.go +++ b/internal/services/canary_message_test.go @@ -3,6 +3,8 @@ // License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). // +// +build unit_test + // Package services defines an interface for canary services and related implementations package services