From 6f35d7198d15f1f464dbfac393f7271d6662e913 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Fri, 24 Mar 2023 12:25:49 +0300 Subject: [PATCH] [#24] Use build tags to run integration tests Signed-off-by: Denis Kirillov --- CHANGELOG.md | 1 + Makefile | 5 +++++ downloader/reader_test.go | 2 ++ integration_test.go | 2 ++ tokens/bearer-token_test.go | 2 ++ uploader/filter_test.go | 2 ++ uploader/multipart_test.go | 2 ++ utils/attributes_test.go | 2 ++ 8 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3c86db..1dcd456 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This document outlines major changes between releases. - Update viper to v1.15.0 (#8) - Errors have become more detailed (#18) - Update system attribute names (#22) +- Separate integration tests with build tags (#24) ### Updating from v0.26.0 diff --git a/Makefile b/Makefile index 0fccc4e..a4bdb1e 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,11 @@ docker/%: test: @go test ./... -cover +# Run integration tests +.PHONY: integration-test +integration-test: + @go test ./... -cover --tags=integration + # Run tests with race detection and produce coverage output cover: @go test -v -race ./... -coverprofile=coverage.txt -covermode=atomic diff --git a/downloader/reader_test.go b/downloader/reader_test.go index 8d58185..09c990a 100644 --- a/downloader/reader_test.go +++ b/downloader/reader_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package downloader import ( diff --git a/integration_test.go b/integration_test.go index 40d908b..7a170a3 100644 --- a/integration_test.go +++ b/integration_test.go @@ -1,3 +1,5 @@ +//go:build integration + package main import ( diff --git a/tokens/bearer-token_test.go b/tokens/bearer-token_test.go index b03147c..d5706cc 100644 --- a/tokens/bearer-token_test.go +++ b/tokens/bearer-token_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package tokens import ( diff --git a/uploader/filter_test.go b/uploader/filter_test.go index 1190001..9d32b84 100644 --- a/uploader/filter_test.go +++ b/uploader/filter_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package uploader import ( diff --git a/uploader/multipart_test.go b/uploader/multipart_test.go index 9763f88..aad2b66 100644 --- a/uploader/multipart_test.go +++ b/uploader/multipart_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package uploader import ( diff --git a/utils/attributes_test.go b/utils/attributes_test.go index a903b60..251113b 100644 --- a/utils/attributes_test.go +++ b/utils/attributes_test.go @@ -1,3 +1,5 @@ +//go:build !integration + package utils import (