Commit c8d6a6eb authored by Tomasz Maczukin's avatar Tomasz Maczukin

Switch from external gitlab.com/gitlab-org/gitlab-test repo to a local one

parent 5d239078
......@@ -10,3 +10,4 @@ dockerfiles/ubuntu/gitlab-ci-multi-runner_amd64.deb
.idea/
tests/ubuntu/.vagrant
artifacts
tmp/gitlab-test
\ No newline at end of file
......@@ -36,6 +36,18 @@ bindata:
- executors/docker/bindata.go
expire_in: 7d
clone test repo:
stage: prebuild
script:
- mkdir tmp
- succeed=0
- for i in {1..3}; do git clone https://gitlab.com/gitlab-org/gitlab-test.git tmp/gitlab-test && succeed=1 && break; echo "retrying"; done
- '[[ "$succeed" -eq 1 ]]'
artifacts:
paths:
- tmp/gitlab-test
expire_in: 7d
code style:
stage: test
script:
......
......@@ -38,15 +38,17 @@ func TestBuildRun(t *testing.T) {
RegisterExecutor("build-run-test", &p)
successfulBuild, err := GetSuccessfulBuild()
assert.NoError(t, err)
build := &Build{
GetBuildResponse: SuccessfulBuild,
GetBuildResponse: successfulBuild,
Runner: &RunnerConfig{
RunnerSettings: RunnerSettings{
Executor: "build-run-test",
},
},
}
err := build.Run(&Config{}, &Trace{Writer: os.Stdout})
err = build.Run(&Config{}, &Trace{Writer: os.Stdout})
assert.NoError(t, err)
}
......@@ -76,15 +78,17 @@ func TestRetryPrepare(t *testing.T) {
RegisterExecutor("build-run-retry-prepare", &p)
successfulBuild, err := GetSuccessfulBuild()
assert.NoError(t, err)
build := &Build{
GetBuildResponse: SuccessfulBuild,
GetBuildResponse: successfulBuild,
Runner: &RunnerConfig{
RunnerSettings: RunnerSettings{
Executor: "build-run-retry-prepare",
},
},
}
err := build.Run(&Config{}, &Trace{Writer: os.Stdout})
err = build.Run(&Config{}, &Trace{Writer: os.Stdout})
assert.NoError(t, err)
}
......@@ -107,15 +111,17 @@ func TestPrepareFailure(t *testing.T) {
RegisterExecutor("build-run-prepare-failure", &p)
successfulBuild, err := GetSuccessfulBuild()
assert.NoError(t, err)
build := &Build{
GetBuildResponse: SuccessfulBuild,
GetBuildResponse: successfulBuild,
Runner: &RunnerConfig{
RunnerSettings: RunnerSettings{
Executor: "build-run-prepare-failure",
},
},
}
err := build.Run(&Config{}, &Trace{Writer: os.Stdout})
err = build.Run(&Config{}, &Trace{Writer: os.Stdout})
assert.EqualError(t, err, "prepare failed")
}
......@@ -136,15 +142,17 @@ func TestPrepareFailureOnBuildError(t *testing.T) {
RegisterExecutor("build-run-prepare-failure-on-build-error", &p)
successfulBuild, err := GetSuccessfulBuild()
assert.NoError(t, err)
build := &Build{
GetBuildResponse: SuccessfulBuild,
GetBuildResponse: successfulBuild,
Runner: &RunnerConfig{
RunnerSettings: RunnerSettings{
Executor: "build-run-prepare-failure-on-build-error",
},
},
}
err := build.Run(&Config{}, &Trace{Writer: os.Stdout})
err = build.Run(&Config{}, &Trace{Writer: os.Stdout})
assert.IsType(t, err, &BuildError{})
}
......@@ -169,14 +177,16 @@ func TestRunFailure(t *testing.T) {
RegisterExecutor("build-run-run-failure", &p)
successfulBuild, err := GetSuccessfulBuild()
assert.NoError(t, err)
build := &Build{
GetBuildResponse: SuccessfulBuild,
GetBuildResponse: successfulBuild,
Runner: &RunnerConfig{
RunnerSettings: RunnerSettings{
Executor: "build-run-run-failure",
},
},
}
err := build.Run(&Config{}, &Trace{Writer: os.Stdout})
err = build.Run(&Config{}, &Trace{Writer: os.Stdout})
assert.EqualError(t, err, "build fail")
}
package common
const repoURL = "https://gitlab.com/gitlab-org/gitlab-test.git"
import (
"os"
"path"
"runtime"
"strings"
)
const repoRemoteURL = "https://gitlab.com/gitlab-org/gitlab-test.git"
const repoSHA = "6907208d755b60ebeacb2e9dfea74c92c3449a1f"
const repoBeforeSHA = "c347ca2e140aa667b968e51ed0ffe055501fe4f4"
const repoRefName = "master"
var SuccessfulBuild = GetBuildResponse{
RepoURL: repoURL,
Commands: "echo Hello World",
Sha: repoSHA,
BeforeSha: repoBeforeSHA,
RefName: repoRefName,
func GetSuccessfulBuild() (GetBuildResponse, error) {
return getLocalBuildResponse("echo Hello World")
}
func GetRemoteSuccessfulBuild() (GetBuildResponse, error) {
return getRemoteBuildResponse("echo Hello World")
}
func GetFailedBuild() (GetBuildResponse, error) {
return getLocalBuildResponse("exit 1")
}
func GetRemoteFailedBuild() (GetBuildResponse, error) {
return getRemoteBuildResponse("exit 1")
}
func GetLongRunningBuild() (GetBuildResponse, error) {
return getLocalBuildResponse("sleep 3600")
}
func GetRemoteLongRunningBuild() (GetBuildResponse, error) {
return getRemoteBuildResponse("sleep 3600")
}
var FailedBuild = GetBuildResponse{
RepoURL: repoURL,
Commands: "exit 1",
Sha: repoSHA,
BeforeSha: repoBeforeSHA,
RefName: repoRefName,
func getRemoteBuildResponse(commands string) (response GetBuildResponse, err error) {
response = GetBuildResponse{
Commands: commands,
RepoURL: repoRemoteURL,
Sha: repoSHA,
BeforeSha: repoBeforeSHA,
RefName: repoRefName,
}
return
}
func getLocalBuildResponse(commands string) (response GetBuildResponse, err error) {
localRepoURL, err := getLocalRepoURL()
if err != nil {
return
}
response = GetBuildResponse{
Commands: commands,
RepoURL: localRepoURL,
Sha: repoSHA,
BeforeSha: repoBeforeSHA,
RefName: repoRefName,
}
return
}
var LongRunningBuild = GetBuildResponse{
RepoURL: repoURL,
Commands: "sleep 3600",
Sha: repoSHA,
BeforeSha: repoBeforeSHA,
RefName: repoRefName,
func getLocalRepoURL() (string, error) {
_, filename, _, _ := runtime.Caller(0)
directory := path.Dir(filename)
if strings.Contains(directory, "_test/_obj_test") {
pwd, err := os.Getwd()
if err != nil {
return "", err
}
directory = pwd
}
localRepoURL := path.Clean(directory + "/../tmp/gitlab-test/.git")
_, err := os.Stat(localRepoURL)
if err != nil {
return "", err
}
return localRepoURL, nil
}
......@@ -22,8 +22,10 @@ func TestDockerCommandSuccessRun(t *testing.T) {
return
}
successfulBuild, err := common.GetRemoteSuccessfulBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.SuccessfulBuild,
GetBuildResponse: successfulBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "docker",
......@@ -34,7 +36,7 @@ func TestDockerCommandSuccessRun(t *testing.T) {
},
}
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
assert.NoError(t, err)
}
......@@ -43,8 +45,10 @@ func TestDockerCommandBuildFail(t *testing.T) {
return
}
failedBuild, err := common.GetRemoteFailedBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.FailedBuild,
GetBuildResponse: failedBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "docker",
......@@ -55,7 +59,7 @@ func TestDockerCommandBuildFail(t *testing.T) {
},
}
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
require.Error(t, err, "error")
assert.IsType(t, err, &common.BuildError{})
assert.Contains(t, err.Error(), "exit code 1")
......@@ -110,8 +114,10 @@ func TestDockerCommandBuildAbort(t *testing.T) {
return
}
longRunningBuild, err := common.GetRemoteLongRunningBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.LongRunningBuild,
GetBuildResponse: longRunningBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "docker",
......@@ -135,7 +141,7 @@ func TestDockerCommandBuildAbort(t *testing.T) {
})
defer timeoutTimer.Stop()
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
assert.EqualError(t, err, "aborted: interrupt")
}
......@@ -144,8 +150,10 @@ func TestDockerCommandBuildCancel(t *testing.T) {
return
}
longRunningBuild, err := common.GetRemoteLongRunningBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.LongRunningBuild,
GetBuildResponse: longRunningBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "docker",
......@@ -170,7 +178,7 @@ func TestDockerCommandBuildCancel(t *testing.T) {
})
defer timeoutTimer.Stop()
err := build.Run(&common.Config{}, trace)
err = build.Run(&common.Config{}, trace)
assert.IsType(t, err, &common.BuildError{})
assert.EqualError(t, err, "canceled")
}
......@@ -193,8 +201,10 @@ func TestDockerPrivilegedServiceAccessingBuildsFolder(t *testing.T) {
for _, strategy := range strategies {
t.Log("Testing", strategy, "strategy...")
longRunningBuild, err := common.GetRemoteLongRunningBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.LongRunningBuild,
GetBuildResponse: longRunningBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "docker",
......@@ -216,7 +226,7 @@ func TestDockerPrivilegedServiceAccessingBuildsFolder(t *testing.T) {
Key: "GIT_STRATEGY", Value: strategy,
})
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
assert.NoError(t, err)
}
}
......@@ -295,8 +305,10 @@ func testDockerVersion(t *testing.T, version string) {
t.Log("Docker", version, "is running at", credentials.Host)
successfulBuild, err := common.GetRemoteSuccessfulBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.SuccessfulBuild,
GetBuildResponse: successfulBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "docker",
......
......@@ -278,12 +278,13 @@ func TestKubernetesSuccessRun(t *testing.T) {
return
}
buildResponse := common.SuccessfulBuild
buildResponse.Options = map[string]interface{}{
successfulBuild, err := common.GetRemoteSuccessfulBuild()
assert.NoError(t, err)
successfulBuild.Options = map[string]interface{}{
"image": "docker:git",
}
build := &common.Build{
GetBuildResponse: buildResponse,
GetBuildResponse: successfulBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "kubernetes",
......@@ -292,7 +293,7 @@ func TestKubernetesSuccessRun(t *testing.T) {
},
}
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
assert.NoError(t, err)
}
......@@ -301,8 +302,10 @@ func TestKubernetesBuildFail(t *testing.T) {
return
}
failedBuild, err := common.GetRemoteFailedBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.FailedBuild,
GetBuildResponse: failedBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "kubernetes",
......@@ -314,7 +317,7 @@ func TestKubernetesBuildFail(t *testing.T) {
"image": "docker:git",
}
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
require.Error(t, err, "error")
assert.IsType(t, err, &common.BuildError{})
assert.Contains(t, err.Error(), "Error executing in Docker Container: 1")
......@@ -325,8 +328,10 @@ func TestKubernetesMissingImage(t *testing.T) {
return
}
failedBuild, err := common.GetRemoteFailedBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.FailedBuild,
GetBuildResponse: failedBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "kubernetes",
......@@ -338,7 +343,7 @@ func TestKubernetesMissingImage(t *testing.T) {
"image": "some/non-existing/image",
}
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
require.Error(t, err)
assert.IsType(t, err, &common.BuildError{})
assert.Contains(t, err.Error(), "not found")
......@@ -349,8 +354,10 @@ func TestKubernetesMissingTag(t *testing.T) {
return
}
failedBuild, err := common.GetRemoteFailedBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.FailedBuild,
GetBuildResponse: failedBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "kubernetes",
......@@ -362,7 +369,7 @@ func TestKubernetesMissingTag(t *testing.T) {
"image": "docker:missing-tag",
}
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
require.Error(t, err)
assert.IsType(t, err, &common.BuildError{})
assert.Contains(t, err.Error(), "not found")
......@@ -373,8 +380,10 @@ func TestKubernetesBuildAbort(t *testing.T) {
return
}
failedBuild, err := common.GetRemoteFailedBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.FailedBuild,
GetBuildResponse: failedBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "kubernetes",
......@@ -399,7 +408,7 @@ func TestKubernetesBuildAbort(t *testing.T) {
})
defer timeoutTimer.Stop()
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
assert.EqualError(t, err, "aborted: interrupt")
}
......@@ -408,8 +417,10 @@ func TestKubernetesBuildCancel(t *testing.T) {
return
}
failedBuild, err := common.GetRemoteFailedBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.FailedBuild,
GetBuildResponse: failedBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "kubernetes",
......@@ -436,7 +447,7 @@ func TestKubernetesBuildCancel(t *testing.T) {
})
defer timeoutTimer.Stop()
err := build.Run(&common.Config{}, trace)
err = build.Run(&common.Config{}, trace)
assert.IsType(t, err, &common.BuildError{})
assert.EqualError(t, err, "canceled")
}
......
......@@ -36,8 +36,10 @@ func TestParallelsSuccessRun(t *testing.T) {
return
}
successfulBuild, err := common.GetRemoteSuccessfulBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.SuccessfulBuild,
GetBuildResponse: successfulBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "parallels",
......@@ -50,7 +52,7 @@ func TestParallelsSuccessRun(t *testing.T) {
},
}
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
assert.NoError(t, err, "Make sure that you have done 'make -C tests/ubuntu parallels'")
}
......@@ -59,8 +61,10 @@ func TestParallelsBuildFail(t *testing.T) {
return
}
failedBuild, err := common.GetRemoteFailedBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.FailedBuild,
GetBuildResponse: failedBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "parallels",
......@@ -73,7 +77,7 @@ func TestParallelsBuildFail(t *testing.T) {
},
}
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
require.Error(t, err, "error")
assert.IsType(t, err, &common.BuildError{})
assert.Contains(t, err.Error(), "Process exited with: 1")
......@@ -129,8 +133,10 @@ func TestParallelsBuildAbort(t *testing.T) {
return
}
longRunningBuild, err := common.GetRemoteLongRunningBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.LongRunningBuild,
GetBuildResponse: longRunningBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "parallels",
......@@ -156,7 +162,7 @@ func TestParallelsBuildAbort(t *testing.T) {
})
defer timeoutTimer.Stop()
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
assert.EqualError(t, err, "aborted: interrupt")
}
......@@ -165,8 +171,10 @@ func TestParallelsBuildCancel(t *testing.T) {
return
}
longRunningBuild, err := common.GetRemoteLongRunningBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.LongRunningBuild,
GetBuildResponse: longRunningBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "parallels",
......@@ -193,7 +201,7 @@ func TestParallelsBuildCancel(t *testing.T) {
})
defer timeoutTimer.Stop()
err := build.Run(&common.Config{}, trace)
err = build.Run(&common.Config{}, trace)
assert.IsType(t, err, &common.BuildError{})
assert.EqualError(t, err, "canceled")
}
......@@ -91,17 +91,21 @@ func newBuild(t *testing.T, getBuildResponse common.GetBuildResponse, shell stri
func TestBuildSuccess(t *testing.T) {
onEachShell(t, func(t *testing.T, shell string) {
build, cleanup := newBuild(t, common.SuccessfulBuild, shell)
successfulBuild, err := common.GetSuccessfulBuild()
assert.NoError(t, err)
build, cleanup := newBuild(t, successfulBuild, shell)
defer cleanup()
err := runBuild(t, build)
err = runBuild(t, build)
assert.NoError(t, err)
})
}
func TestBuildAbort(t *testing.T) {
onEachShell(t, func(t *testing.T, shell string) {
build, cleanup := newBuild(t, common.LongRunningBuild, shell)
longRunningBuild, err := common.GetLongRunningBuild()
assert.NoError(t, err)
build, cleanup := newBuild(t, longRunningBuild, shell)
defer cleanup()
abortTimer := time.AfterFunc(time.Second, func() {
......@@ -110,14 +114,16 @@ func TestBuildAbort(t *testing.T) {
})
defer abortTimer.Stop()
err := runBuild(t, build)
err = runBuild(t, build)
assert.EqualError(t, err, "aborted: interrupt")
})
}
func TestBuildCancel(t *testing.T) {
onEachShell(t, func(t *testing.T, shell string) {
build, cleanup := newBuild(t, common.LongRunningBuild, shell)
longRunningBuild, err := common.GetLongRunningBuild()
assert.NoError(t, err)
build, cleanup := newBuild(t, longRunningBuild, shell)
defer cleanup()
cancelChan := make(chan interface{}, 1)
......@@ -127,7 +133,7 @@ func TestBuildCancel(t *testing.T) {
})
defer cancelTimer.Stop()
err := runBuildWithTrace(t, build, &common.Trace{Writer: os.Stdout, Abort: cancelChan})
err = runBuildWithTrace(t, build, &common.Trace{Writer: os.Stdout, Abort: cancelChan})
assert.EqualError(t, err, "canceled")
assert.IsType(t, err, &common.BuildError{})
})
......@@ -135,10 +141,12 @@ func TestBuildCancel(t *testing.T) {
func TestBuildWithIndexLock(t *testing.T) {
onEachShell(t, func(t *testing.T, shell string) {
build, cleanup := newBuild(t, common.SuccessfulBuild, shell)
successfulBuild, err := common.GetSuccessfulBuild()
assert.NoError(t, err)
build, cleanup := newBuild(t, successfulBuild, shell)
defer cleanup()
err := runBuild(t, build)
err = runBuild(t, build)
assert.NoError(t, err)
build.GetBuildResponse.AllowGitFetch = true
......@@ -151,7 +159,9 @@ func TestBuildWithIndexLock(t *testing.T) {
func TestBuildWithGitStrategyNone(t *testing.T) {
onEachShell(t, func(t *testing.T, shell string) {
build, cleanup := newBuild(t, common.SuccessfulBuild, shell)
successfulBuild, err := common.GetSuccessfulBuild()
assert.NoError(t, err)
build, cleanup := newBuild(t, successfulBuild, shell)
defer cleanup()
build.Runner.PreCloneScript = "echo pre-clone-script"
......@@ -168,7 +178,9 @@ func TestBuildWithGitStrategyNone(t *testing.T) {
func TestBuildWithGitStrategyFetch(t *testing.T) {
onEachShell(t, func(t *testing.T, shell string) {
build, cleanup := newBuild(t, common.SuccessfulBuild, shell)
successfulBuild, err := common.GetSuccessfulBuild()
assert.NoError(t, err)
build, cleanup := newBuild(t, successfulBuild, shell)
defer cleanup()
build.Runner.PreCloneScript = "echo pre-clone-script"
......@@ -188,7 +200,9 @@ func TestBuildWithGitStrategyFetch(t *testing.T) {
func TestBuildWithGitStrategyClone(t *testing.T) {
onEachShell(t, func(t *testing.T, shell string) {
build, cleanup := newBuild(t, common.SuccessfulBuild, shell)
successfulBuild, err := common.GetSuccessfulBuild()
assert.NoError(t, err)
build, cleanup := newBuild(t, successfulBuild, shell)
defer cleanup()
build.Runner.PreCloneScript = "echo pre-clone-script"
......@@ -208,7 +222,9 @@ func TestBuildWithGitStrategyClone(t *testing.T) {
func TestBuildWithDebugTrace(t *testing.T) {
onEachShell(t, func(t *testing.T, shell string) {
build, cleanup := newBuild(t, common.SuccessfulBuild, shell)
successfulBuild, err := common.GetSuccessfulBuild()
assert.NoError(t, err)
build, cleanup := newBuild(t, successfulBuild, shell)
defer cleanup()
// The default build shouldn't have debug tracing enabled
......
......@@ -36,8 +36,10 @@ func TestVirtualBoxSuccessRun(t *testing.T) {
return
}
successfulBuild, err := common.GetRemoteSuccessfulBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.SuccessfulBuild,
GetBuildResponse: successfulBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "virtualbox",
......@@ -50,7 +52,7 @@ func TestVirtualBoxSuccessRun(t *testing.T) {
},
}
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
assert.NoError(t, err, "Make sure that you have done 'make -C tests/ubuntu virtualbox'")
}
......@@ -59,8 +61,10 @@ func TestVirtualBoxBuildFail(t *testing.T) {
return
}
failedBuild, err := common.GetRemoteFailedBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.FailedBuild,
GetBuildResponse: failedBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "virtualbox",
......@@ -73,7 +77,7 @@ func TestVirtualBoxBuildFail(t *testing.T) {
},
}
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
err = build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})
require.Error(t, err, "error")
assert.IsType(t, err, &common.BuildError{})
assert.Contains(t, err.Error(), "Process exited with: 1")
......@@ -129,8 +133,10 @@ func TestVirtualBoxBuildAbort(t *testing.T) {
return
}
longRunningBuild, err := common.GetRemoteLongRunningBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: common.LongRunningBuild,
GetBuildResponse: longRunningBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "virtualbox",
......@@ -156,7 +162,7 @@ func TestVirtualBoxBuildAbort(t *testing.T) {
})
defer timeoutTimer.Stop()
err := build.Run(&common.Config{}, &common.Trace{Writer: os.Stdout})