Blacklist long-running tests in Github Actions
Tests take 1+ hour right now for very little purpose.
This commit is contained in:
parent
2f6cbe69cb
commit
306429dcb2
1 changed files with 19 additions and 1 deletions
20
tests/run.go
20
tests/run.go
|
@ -62,6 +62,15 @@ func runProcess(prefix string, command string, args ...string) error {
|
||||||
return cmd.Wait()
|
return cmd.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func contains(haystack []string, needle string) bool {
|
||||||
|
for _, s := range haystack {
|
||||||
|
if s == needle {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func runTest(testDir string) error {
|
func runTest(testDir string) error {
|
||||||
rootDir := filepath.Join(cwd, "..")
|
rootDir := filepath.Join(cwd, "..")
|
||||||
|
|
||||||
|
@ -82,6 +91,15 @@ func runTest(testDir string) error {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
// Takes too long for Github Actions
|
||||||
|
var blacklist []string
|
||||||
|
if os.Getenv("GITHUB_ACTIONS") == "true" {
|
||||||
|
blacklist = []string{
|
||||||
|
"helm",
|
||||||
|
"minikube",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
files, err := os.ReadDir(".")
|
files, err := os.ReadDir(".")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -89,7 +107,7 @@ func main() {
|
||||||
|
|
||||||
testDirs := []string{}
|
testDirs := []string{}
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
if f.IsDir() {
|
if f.IsDir() && !contains(blacklist, f.Name()) {
|
||||||
testDirs = append(testDirs, f.Name())
|
testDirs = append(testDirs, f.Name())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue