MCPcopy
hub / github.com/dgraph-io/dgraph / appendTestCoverageFile

Function appendTestCoverageFile

t/t.go:1374–1395  ·  view source on GitHub ↗
(src, des string)

Source from the content-addressed store, hash-verified

1372}
1373
1374func appendTestCoverageFile(src, des string) error {
1375 if !fileExists(src) {
1376 fmt.Printf("src: %s does not exist, skipping file\n", src)
1377 return nil
1378 }
1379
1380 isEmpty, err := isTestCoverageEmpty(src)
1381 if err != nil {
1382 return err
1383 }
1384 if isEmpty {
1385 fmt.Printf("no test files or no test coverage statement generated for %s, skipping file\n", src)
1386 return nil
1387 }
1388
1389 cmd := command("bash", "-c", fmt.Sprintf("cat %s | grep -v \"%s\" >> %s", src, coverageFileHeader, des))
1390 if err := cmd.Run(); err != nil {
1391 return err
1392 }
1393
1394 return nil
1395}
1396
1397func executePreRunSteps() error {
1398 testutil.GeneratePlugins(*race)

Callers 2

stopClusterFunction · 0.85
runTestsForFunction · 0.85

Calls 4

isTestCoverageEmptyFunction · 0.85
fileExistsFunction · 0.70
commandFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected