MCPcopy
hub / github.com/vmware-tanzu/sonobuoy / ensureExists

Function ensureExists

pkg/worker/worker_test.go:190–197  ·  view source on GitHub ↗
(t *testing.T, checkPath string)

Source from the content-addressed store, hash-verified

188}
189
190func ensureExists(t *testing.T, checkPath string) {
191 if _, err := os.Stat(checkPath); err != nil && os.IsNotExist(err) {
192 t.Logf("Plugin agent ran, but couldn't find expected results at %v:", checkPath)
193 output, _ := exec.Command("ls", "-l", filepath.Dir(checkPath)).CombinedOutput()
194 t.Log(string(output))
195 t.Fail()
196 }
197}
198
199func withTempDir(t *testing.T, callback func(tmpdir string)) {
200 // Create a temporary directory for results gathering

Callers 3

TestRunFunction · 0.85
TestRunGlobalFunction · 0.85

Calls 1

CommandMethod · 0.65

Tested by

no test coverage detected