-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
40 lines (33 loc) · 853 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/i5heu/TestDreadnought/internal/orchestrator"
)
func main() {
fmt.Println("TestDreadnought", "v1.0.0")
if len(os.Args) < 2 {
fmt.Println("Usage: go run main.go <test-root-directory> <optional: subset path relative to config-directory>")
return
}
// Get the config directory path and optional subset path
configDir := os.Args[1]
var subSet string
if len(os.Args) >= 3 {
subSet = os.Args[2]
}
// Check if subSet exists inside configDir
if subSet != "" {
subSetPath := filepath.Join(configDir, subSet)
if _, err := os.Stat(subSetPath); os.IsNotExist(err) {
fmt.Printf("Subset directory %s does not exist inside %s\n", subSet, configDir)
return
}
}
// Run the tests
err := orchestrator.RunTests(configDir, subSet)
if err != nil {
fmt.Println(err)
}
}