Files
athens/e2etests/filesystem.go
Federico Paolinelli 27f3683416 Replace the current e2e script with a test suite running e2e tests. (#1514)
* Replace the current e2e script with a test suite running e2e tests.

* Add a build tag to skip e2e while running unit tests.
We want e2e tests to be skipped while running normal unit tests.
2020-02-19 15:38:08 -08:00

40 lines
693 B
Go

// +build e2etests
package e2etests
import (
"fmt"
"os"
"os/exec"
"path/filepath"
)
func setupTestRepo(repoPath, repoURL string) {
os.RemoveAll(repoPath)
cmd := exec.Command("git",
"clone",
repoURL,
repoPath)
cmd.Run()
}
func chmodR(path string, mode os.FileMode) error {
return filepath.Walk(path, func(name string, info os.FileInfo, err error) error {
if err == nil {
os.Chmod(name, mode)
}
return err
})
}
func cleanGoCache(env []string) error {
cmd := exec.Command("go", "clean", "--modcache")
cmd.Env = env
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("Failed to clear go cache: %v - %s", err, string(output))
}
return nil
}