Separate runner working state from returned results
This commit is contained in:
@@ -248,7 +248,7 @@ func TestRunnerExecutesOrderedStepsWithHardBarriers(t *testing.T) {
|
||||
return erasedTypedResult{Value: codecScore{Value: 2}}, nil
|
||||
}
|
||||
|
||||
output, err := New().Run(context.Background(), RunInput{Prepared: prepared, RawInput: []byte("input"), Workers: 2})
|
||||
output, err := New().run(context.Background(), RunInput{Prepared: prepared, RawInput: []byte("input"), Workers: 2})
|
||||
if err != nil {
|
||||
t.Fatalf("Run() error = %v", err)
|
||||
}
|
||||
@@ -286,7 +286,7 @@ func TestRunnerStopsLaterOrderedStepsAfterFailure(t *testing.T) {
|
||||
encoder := &countingOrderedOutput{}
|
||||
prepared.output = encoder
|
||||
|
||||
output, err := New().Run(context.Background(), RunInput{Prepared: prepared, RawInput: []byte("input"), Workers: 2})
|
||||
output, err := New().run(context.Background(), RunInput{Prepared: prepared, RawInput: []byte("input"), Workers: 2})
|
||||
if err == nil || !strings.Contains(err.Error(), `execute pipeline step "step-2"`) {
|
||||
t.Fatalf("Run() error = %v, want step-scoped failure", err)
|
||||
}
|
||||
@@ -486,7 +486,7 @@ func TestRunnerBoundsConcurrentLaneContinuations(t *testing.T) {
|
||||
prepared.Steps[0].ArtifactLanes = publicLanes
|
||||
|
||||
type outcome struct {
|
||||
output RunOutput
|
||||
output runState
|
||||
err error
|
||||
}
|
||||
done := make(chan outcome, 1)
|
||||
@@ -504,7 +504,7 @@ func TestRunnerBoundsConcurrentLaneContinuations(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
go func() {
|
||||
output, err := New().Run(ctx, RunInput{Prepared: prepared, RawInput: []byte("input"), Workers: 2})
|
||||
output, err := New().run(ctx, RunInput{Prepared: prepared, RawInput: []byte("input"), Workers: 2})
|
||||
done <- outcome{output, err}
|
||||
}()
|
||||
for i := 0; i < 2; i++ {
|
||||
|
||||
Reference in New Issue
Block a user