Skip to content

Commit f90c235

Browse files
committed
Fix the pipeline printed actions in tests
Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
1 parent c199aae commit f90c235

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

internal/core/forks.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const (
8989

9090
// planPrintFunc is used to print the execution plan in prepareRunPlan().
9191
var planPrintFunc = func(args ...interface{}) {
92+
fmt.Fprintln(os.Stderr)
9293
fmt.Fprintln(os.Stderr, args...)
9394
}
9495

internal/core/pipeline.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,6 @@ func (pipeline *Pipeline) Run(commits []*object.Commit) (map[LeafPipelineItem]in
757757
continue
758758
}
759759
if pipeline.PrintActions {
760-
fmt.Fprintln(os.Stderr)
761760
printAction(step)
762761
}
763762
if index > 0 && index%100 == 0 && pipeline.HibernationDistance > 0 {

internal/core/pipeline_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,13 @@ func TestPipelineDumpPlanConfigure(t *testing.T) {
537537
pipeline.Initialize(map[string]interface{}{ConfigPipelineDumpPlan: true})
538538
assert.True(t, pipeline.DumpPlan)
539539
stream := &bytes.Buffer{}
540+
backupPlanPrintFunc := planPrintFunc
540541
planPrintFunc = func(args ...interface{}) {
541542
fmt.Fprintln(stream, args...)
542543
}
544+
defer func() {
545+
planPrintFunc = backupPlanPrintFunc
546+
}()
543547
commits := make([]*object.Commit, 1)
544548
commits[0], _ = test.Repository.CommitObject(plumbing.NewHash(
545549
"af9ddc0db70f09f3f27b4b98e415592a7485171c"))

0 commit comments

Comments
 (0)