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

Function copyExportToLocalFs

dgraph/cmd/live/load-uids/load_test.go:280–296  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

278}
279
280func copyExportToLocalFs(t *testing.T) (string, string) {
281 require.NoError(t, os.RemoveAll(localExportPath), "Error removing directory")
282 require.NoError(t, testutil.DockerCp(alphaExportPath, localExportPath),
283 "Error copying files from docker container")
284
285 childDirs, err := os.ReadDir(localExportPath)
286 require.NoError(t, err, "Couldn't read local export copy directory")
287 require.True(t, len(childDirs) > 0, "Local export copy directory is empty!!!")
288
289 exportFiles, err := os.ReadDir(localExportPath + "/" + childDirs[0].Name())
290 require.NoError(t, err, "Couldn't read child of local export copy directory")
291 require.True(t, len(exportFiles) > 0, "no exported files found!!!")
292
293 groupId := strings.Split(exportFiles[0].Name(), ".")[0]
294
295 return childDirs[0].Name(), groupId
296}
297
298func extractErrLine(output string) string {
299 m := regexp.MustCompile(`Error while processing(.)*(rdf|json):`)

Callers 1

Calls 3

DockerCpFunction · 0.92
RemoveAllMethod · 0.80
NameMethod · 0.65

Tested by

no test coverage detected