From 5a446130557a3fed43644b750bfa8dc126c7fb21 Mon Sep 17 00:00:00 2001 From: Alexandre Tuleu Date: Wed, 20 Jan 2016 16:04:58 +0100 Subject: [PATCH] Skips long test By default they will be skipped, `make LONG=1` will run them --- Makefile | 8 +++++++- album_description_getter_test.go | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7ed0748..7001ec4 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,13 @@ all: build check build : go build +ifdef LONG +short_option = +else +short_option = -short +endif + check : go vet - go test -coverprofile=cover.out -covermode=count + go test $(short_option) -coverprofile=cover.out -covermode=count golint diff --git a/album_description_getter_test.go b/album_description_getter_test.go index 2d775ba..2ff2297 100644 --- a/album_description_getter_test.go +++ b/album_description_getter_test.go @@ -2,6 +2,7 @@ package main import ( "log" + "testing" "time" . "gopkg.in/check.v1" @@ -18,6 +19,9 @@ func (s *AlbumDescriptionGetterSuite) SetUpTest(c *C) { } func (s *AlbumDescriptionGetterSuite) TestGet(c *C) { + if testing.Short() { + c.Skip("This test is really slow") + } start := time.Now() for _, a := range albumsDataTest { aStripped := StripNonCsvField(a)