Skip to content

Commit

Permalink
test runner with parse-only
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwren committed Mar 9, 2022
1 parent 23d5343 commit 7443cf7
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions manager/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,41 @@ func TestRunner_Start(t *testing.T) {
t.Fatal("timeout")
}
})

t.Run("parse_only", func(t *testing.T) {

out, err := ioutil.TempFile("", "")
if err != nil {
t.Fatal(err)
}
defer os.Remove(out.Name())

c := config.DefaultConfig().Merge(&config.Config{
Templates: &config.TemplateConfigs{
&config.TemplateConfig{
Contents: config.String(`test`),
Destination: config.String(out.Name()),
},
},
ParseOnly: true,
})
c.Finalize()

r, err := NewRunner(c, false)
if err != nil {
t.Fatal(err)
}

r.Start()
defer r.Stop()

select {
case err := <-r.ErrCh:
t.Fatal(err)
case <-time.After(2 * time.Second):
t.Fatal("timeout")
}
})
}

func TestRunner_quiescence(t *testing.T) {
Expand Down

0 comments on commit 7443cf7

Please sign in to comment.