+ appdir := runner.src
+ if super.ClusterType == "test" {
+ // In the multi-cluster test setup, if we run multiple
+ // Rails instances directly from the source tree, they
+ // step on one another's files in {source}/tmp, log,
+ // etc. So instead we copy the source directory into a
+ // temp dir and run the Rails app from there.
+ appdir = filepath.Join(super.tempdir, runner.varlibdir)
+ err = super.RunProgram(ctx, super.tempdir, runOptions{}, "mkdir", "-p", appdir)
+ if err != nil {
+ return err
+ }
+ err = super.RunProgram(ctx, filepath.Join(super.SourcePath, runner.src), runOptions{}, "rsync",
+ "-a", "--no-owner", "--no-group", "--delete-after", "--delete-excluded",
+ "--exclude", "/coverage",
+ "--exclude", "/log",
+ "--exclude", "/node_modules",
+ "--exclude", "/tmp",
+ "--exclude", "/public/assets",
+ "--exclude", "/vendor",
+ "--exclude", "/config/environments",
+ "./",
+ appdir+"/")
+ if err != nil {
+ return err
+ }
+ }
+