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

Function runCustomClusterTest

t/t.go:826–849  ·  view source on GitHub ↗

for tests that require custom docker-compose file (located in test directory)

(ctx context.Context, pkg string, wg *sync.WaitGroup, xmlFile string)

Source from the content-addressed store, hash-verified

824
825// for tests that require custom docker-compose file (located in test directory)
826func runCustomClusterTest(ctx context.Context, pkg string, wg *sync.WaitGroup, xmlFile string) error {
827 fmt.Printf("Bringing up cluster for package: %s\n", pkg)
828 var err error
829 compose := composeFileFor(pkg)
830 prefix := getClusterPrefix()
831 err = startCluster(compose, prefix)
832 if err != nil {
833 return err
834 }
835 if !*keepCluster {
836 wg.Add(1)
837 // Wrap in a closure so the `err` read by stopCluster is the
838 // value AT DEFER RUN TIME (i.e. after runTestsFor returns).
839 // The original form `defer stopCluster(..., err)` captured err
840 // at defer-STATEMENT time, which is always nil here, so
841 // stopCluster never dumped container logs on test failure.
842 defer func() {
843 stopCluster(compose, prefix, wg, err)
844 }()
845 }
846
847 err = runTestsFor(ctx, pkg, prefix, xmlFile)
848 return err
849}
850
851func findPackagesFor(testName string) []string {
852 if len(testName) == 0 {

Callers 1

runTestsFunction · 0.85

Calls 6

composeFileForFunction · 0.85
getClusterPrefixFunction · 0.85
startClusterFunction · 0.85
stopClusterFunction · 0.85
runTestsForFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected