From af33839de188e12812aaf62c5f231f6a2fd81ae7 Mon Sep 17 00:00:00 2001 From: Remington Campbell Date: Wed, 22 May 2019 11:29:59 -0700 Subject: [PATCH] Add notion of integration vs unit tests --- Makefile | 6 +++--- skeleton/pipeline.mk | 4 ++++ xport_kafka_test.go | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a2ddc816..7cf49e3e 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ BINARY=pipeline include skeleton/pipeline.mk # Setup pretest as a prerequisite of tests. -test: pretest -pretest: - @echo Setting up zookeeper, kafka. Docker required. +testall: pretestinfra +pretestinfra: + @echo Setting up Zookeeper and Kafka. Docker required. tools/test/run.sh diff --git a/skeleton/pipeline.mk b/skeleton/pipeline.mk index a9c9597f..6c9ab228 100644 --- a/skeleton/pipeline.mk +++ b/skeleton/pipeline.mk @@ -38,6 +38,10 @@ bin/$(BINARY): $(SOURCES) generated_source: go generate -x +.PHONY: testall +testall: + go test -v -tags=integration -run=. -bench=. $(PROFILE) + .PHONY: test test: go test -v -run=. -bench=. $(PROFILE) diff --git a/xport_kafka_test.go b/xport_kafka_test.go index 25e7503e..217491b1 100644 --- a/xport_kafka_test.go +++ b/xport_kafka_test.go @@ -5,16 +5,18 @@ // All rights reserved. // // +// +build integration package main import ( "encoding/json" "fmt" - "github.com/dlintw/goconf" "strings" "testing" "time" + + "github.com/dlintw/goconf" ) var kmod kafkaOutputModule