github.com/flanksource/konfigadm@v0.12.0/pkg/phases/commands_test.go (about)

     1  package phases_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	. "github.com/flanksource/konfigadm/pkg/types"
     7  	"github.com/onsi/gomega"
     8  )
     9  
    10  func init() {
    11  	// log.SetLevel(log.TraceLevel)
    12  }
    13  
    14  func TestCommandRuntimeFlag(t *testing.T) {
    15  }
    16  
    17  func setupCommandFixture(t *testing.T, flag Flag) ([]Command, *gomega.WithT) {
    18  	cfg, g := NewFixture("commands.yml", t).WithFlags(flag).Build()
    19  	_, commands, _ := cfg.ApplyPhases()
    20  	return commands, g
    21  }
    22  
    23  func TestCommand(t *testing.T) {
    24  	commands, g := setupCommandFixture(t, DEBIAN)
    25  	g.Expect(commands).To(MatchCommand("echo command"))
    26  }
    27  
    28  func TestPreCommand(t *testing.T) {
    29  	commands, g := setupCommandFixture(t, DEBIAN)
    30  	g.Expect(commands).To(MatchCommand("echo pre"))
    31  }
    32  func TestPostCommand(t *testing.T) {
    33  	commands, g := setupCommandFixture(t, DEBIAN)
    34  	g.Expect(commands).To(MatchCommand("echo post"))
    35  }
    36  func TestCommandInterpolation(t *testing.T) {
    37  }