Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--acceptance_test.go13
2 files changed, 11 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 96adaa04..1bee4e6a 100644
--- a/Makefile
+++ b/Makefile
@@ -40,10 +40,11 @@ complexity:
test:
go get golang.org/x/tools/cmd/cover
- go test ./... -cover -v -timeout 1m
+ go test ./... -short -cover -v -timeout 1m
acceptance: gitlab-pages
- go test ./... -run-acceptance-tests -v -timeout 1m
+ go get golang.org/x/tools/cmd/cover
+ go test ./... -cover -v -timeout 1m
docker:
docker run --rm -it -v ${PWD}:/go/src/pages -w /go/src/pages golang:1.5 /bin/bash
diff --git a/acceptance_test.go b/acceptance_test.go
index 1cfd133a..e1a7167a 100644
--- a/acceptance_test.go
+++ b/acceptance_test.go
@@ -4,12 +4,12 @@ import (
"flag"
"io/ioutil"
"net/http"
+ "os"
"testing"
"github.com/stretchr/testify/assert"
)
-var shouldRun = flag.Bool("run-acceptance-tests", false, "Run the acceptance tests?")
var pagesBinary = flag.String("gitlab-pages-binary", "./gitlab-pages", "Path to the gitlab-pages binary")
// TODO: Use TCP port 0 everywhere to avoid conflicts. The binary could output
@@ -25,12 +25,15 @@ var listeners = []ListenSpec{
}
func skipUnlessEnabled(t *testing.T) {
- if *shouldRun {
- return
+ if testing.Short() {
+ t.Log("Acceptance tests disabled")
+ t.SkipNow()
}
- t.Log("Acceptance tests disabled")
- t.SkipNow()
+ if _, err := os.Stat(*pagesBinary); os.IsNotExist(err) {
+ t.Errorf("Couldn't find gitlab-pages binary at %s", *pagesBinary)
+ t.FailNow()
+ }
}
func TestUnknownHostReturnsNotFound(t *testing.T) {