Skip to content
Snippets Groups Projects
Commit 275cafa0 authored by Nick Thomas's avatar Nick Thomas
Browse files

Rework the acceptance tests to use go test -short as a qualifier

parent 114d0f40
No related branches found
No related tags found
1 merge request!20Resolve "Gitlab daemon crashing. Omnibus installation (Ubuntu 14.04)"
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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) {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment