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

Function TestBuildWithCleanupScript

command/build_cleanup_script_test.go:11–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestBuildWithCleanupScript(t *testing.T) {
12 c := &BuildCommand{
13 Meta: TestMetaFile(t),
14 }
15
16 args := []string{
17 "-parallel-builds=1",
18 filepath.Join(testFixture("cleanup-script"), "template.json"),
19 }
20
21 defer cleanup()
22
23 // build should exit with error code!
24 if code := c.Run(args); code == 0 {
25 fatalCommand(t, c.Meta)
26 }
27
28 if !fileExists("ducky.txt") {
29 t.Errorf("Expected to find ducky.txt")
30 }
31
32}

Callers

nothing calls this directly

Calls 7

RunMethod · 0.95
TestMetaFileFunction · 0.85
testFixtureFunction · 0.85
cleanupFunction · 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…