Skip to content
Snippets Groups Projects
Commit 66b9c833 authored by Alessio Caiazza's avatar Alessio Caiazza
Browse files

Refactor TestSingleRunner

parent 16d0bd1c
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,6 @@ func TestSingleRunnerMaxBuilds(t *testing.T) { ...@@ -42,7 +42,6 @@ func TestSingleRunnerMaxBuilds(t *testing.T) {
single, cleanup := mockingExecutionStack(t, "test-max-build", maxBuilds, nil) single, cleanup := mockingExecutionStack(t, "test-max-build", maxBuilds, nil)
defer cleanup() defer cleanup()
single.MaxBuilds = maxBuilds
single.Execute(nil) single.Execute(nil)
} }
...@@ -93,10 +92,14 @@ func mockingExecutionStack(t *testing.T, executorName string, maxBuilds int, job ...@@ -93,10 +92,14 @@ func mockingExecutionStack(t *testing.T, executorName string, maxBuilds int, job
common.RegisterExecutor(executorName, &p) common.RegisterExecutor(executorName, &p)
return newRunSingleCommand(executorName, &mockNetwork), func() { single := newRunSingleCommand(executorName, &mockNetwork)
single.MaxBuilds = maxBuilds
cleanup := func() {
e.AssertExpectations(t) e.AssertExpectations(t)
p.AssertExpectations(t) p.AssertExpectations(t)
mockNetwork.AssertExpectations(t) mockNetwork.AssertExpectations(t)
cancel() cancel()
} }
return single, cleanup
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment