MCPcopy
hub / github.com/hashicorp/packer / testHCLOnlyExceptFlags

Function testHCLOnlyExceptFlags

command/build_test.go:805–830  ·  view source on GitHub ↗
(t *testing.T, args, present, notPresent []string, expectReturn int)

Source from the content-addressed store, hash-verified

803}
804
805func testHCLOnlyExceptFlags(t *testing.T, args, present, notPresent []string, expectReturn int) {
806 c := &BuildCommand{
807 Meta: TestMetaFile(t),
808 }
809
810 defer cleanup()
811
812 finalArgs := []string{"-parallel-builds=1"}
813 finalArgs = append(finalArgs, args...)
814 finalArgs = append(finalArgs, testFixture("hcl-only-except"))
815
816 if code := c.Run(finalArgs); code != expectReturn {
817 fatalCommand(t, c.Meta)
818 }
819
820 for _, f := range notPresent {
821 if fileExists(f) {
822 t.Errorf("Expected NOT to find %s", f)
823 }
824 }
825 for _, f := range present {
826 if !fileExists(f) {
827 t.Errorf("Expected to find %s", f)
828 }
829 }
830}
831
832func TestHCL2PostProcessorForceFlag(t *testing.T) {
833 t.Helper()

Callers 1

Calls 7

RunMethod · 0.95
TestMetaFileFunction · 0.85
cleanupFunction · 0.85
testFixtureFunction · 0.85
fatalCommandFunction · 0.85
fileExistsFunction · 0.70
ErrorfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…