File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ package runner
22
33import (
44 "errors"
5+ "io/fs"
56 "os"
7+ "path/filepath"
8+ "strings"
69
710 "github.com/go-rivet/e2e/internal/extensions"
811 "github.com/rogpeppe/go-internal/testscript"
@@ -13,11 +16,31 @@ func Run(testDir string) error {
1316 return err
1417 }
1518
16- t := & cliTest {}
19+ var testFiles []string
20+ err := filepath .WalkDir (testDir , func (path string , d fs.DirEntry , walkErr error ) error {
21+ if walkErr != nil {
22+ return walkErr
23+ }
24+
25+ if ! d .IsDir () {
26+ name := strings .ToLower (d .Name ())
27+ if strings .HasSuffix (name , ".txtar" ) {
28+ testFiles = append (testFiles , path )
29+ }
30+ }
31+ return nil
32+ })
33+ if err != nil {
34+ return err
35+ }
36+ if len (testFiles ) == 0 {
37+ return nil
38+ }
1739
40+ t := & cliTest {}
1841 testscript .RunT (t , testscript.Params {
19- Dir : testDir ,
20- Cmds : extensions .Commands (),
42+ Files : testFiles ,
43+ Cmds : extensions .Commands (),
2144 // Setup: func(e *testscript.Env) error {
2245 // var vars = []string{
2346 // fmt.Sprintf("VERSION=%s", os.Getenv("VERSION")),
@@ -26,7 +49,6 @@ func Run(testDir string) error {
2649 // return nil
2750 // },
2851 })
29-
3052 if t .failed {
3153 return errors .New ("one or more E2E test scripts failed" )
3254 }
You can’t perform that action at this time.
0 commit comments