functional tests: Simplify running the test server

This commit is contained in:
Krzesimir Nowak
2015-04-22 10:40:49 +02:00
parent caff9edf7a
commit c3c4da3619
+1 -17
View File
@@ -18,7 +18,6 @@ import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
@@ -135,9 +134,7 @@ func testAuthIgnoreSubdirectories(t *testing.T, server *taas.Server) {
}
func runServer(t *testing.T, auth taas.Type) *taas.Server {
goTool := getAbs(t, "go")
acTool := getAbs(t, "../bin/actool")
server, err := taas.NewServerWithPaths(auth, 20, acTool, goTool)
server, err := taas.NewServerWithPaths(auth, 20, "../bin/actool", "go")
if err != nil {
t.Fatalf("Could not start server: %v", err)
}
@@ -145,19 +142,6 @@ func runServer(t *testing.T, auth taas.Type) *taas.Server {
return server
}
func getAbs(t *testing.T, tool string) string {
baseTool := filepath.Base(tool)
pathTool, err := exec.LookPath(tool)
if err != nil {
t.Fatalf("Could not find %s, required to run server: %v", baseTool, err)
}
absTool, err := filepath.Abs(pathTool)
if err != nil {
t.Fatalf("Could not get absolute path of %s, required to run server: %v", baseTool, err)
}
return absTool
}
func serverHandler(t *testing.T, server *taas.Server) {
for {
select {