MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / findPackagesFor

Function findPackagesFor

t/t.go:851–875  ·  view source on GitHub ↗
(testName string)

Source from the content-addressed store, hash-verified

849}
850
851func findPackagesFor(testName string) []string {
852 if len(testName) == 0 {
853 return []string{}
854 }
855
856 cmd := command("ack", testName, *baseDir, "-l")
857 var b bytes.Buffer
858 cmd.Stdout = &b
859 if err := cmd.Run(); err != nil {
860 fmt.Printf("Unable to find %s: %v\n", *runTest, err)
861 return []string{}
862 }
863
864 var dirs []string
865 scan := bufio.NewScanner(&b)
866 for scan.Scan() {
867 fname := scan.Text()
868 if strings.HasSuffix(fname, "_test.go") {
869 dir := strings.Replace(filepath.Dir(fname), *baseDir, "", 1)
870 dirs = append(dirs, dir)
871 }
872 }
873 fmt.Printf("dirs: %+v\n", dirs)
874 return dirs
875}
876
877type pkgDuration struct {
878 threadId int32

Callers 1

getPackagesFunction · 0.85

Calls 2

commandFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…