From f072ea38f1aac3af000bf857a8d906b430f52f22 Mon Sep 17 00:00:00 2001 From: Jay Wren Date: Wed, 9 Mar 2022 10:36:36 -0500 Subject: [PATCH] test runner with parse-only --- manager/runner_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/manager/runner_test.go b/manager/runner_test.go index f5b61e280..588028017 100644 --- a/manager/runner_test.go +++ b/manager/runner_test.go @@ -974,6 +974,37 @@ 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() + + if !r.stopped { + t.Fatal("expected parse only to stop runner") + } + }) } func TestRunner_quiescence(t *testing.T) {