Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 59c5ba9

Browse files
committed
e2e: Simplify examples tester
- Run validate on all files/folders that end in .dockerapp - Remove examples_test.go in the root directory Signed-off-by: Christopher Crone <[email protected]>
1 parent ba09d49 commit 59c5ba9

File tree

2 files changed

+4
-63
lines changed

2 files changed

+4
-63
lines changed

e2e/example_test.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package e2e
33
import (
44
"os"
55
"path/filepath"
6-
"strings"
76
"testing"
87

98
"gotest.tools/assert"
@@ -15,22 +14,12 @@ func TestExamplesAreValid(t *testing.T) {
1514
defer cleanup()
1615

1716
err := filepath.Walk("../examples", func(p string, info os.FileInfo, err error) error {
18-
appPath := filepath.Join(p, filepath.Base(p)+".dockerapp")
19-
_, statErr := os.Stat(appPath)
20-
switch {
21-
case strings.HasSuffix(p, "examples"):
22-
return nil
23-
case strings.HasSuffix(p, ".resources"):
24-
return filepath.SkipDir
25-
case !info.IsDir():
26-
return nil
27-
case os.IsNotExist(statErr):
28-
return nil
29-
default:
30-
cmd.Command = dockerCli.Command("app", "validate", appPath)
17+
if filepath.Ext(p) == ".dockerapp" {
18+
t.Log("Validate example: " + p)
19+
cmd.Command = dockerCli.Command("app", "validate", p)
3120
icmd.RunCmd(cmd).Assert(t, icmd.Success)
32-
return filepath.SkipDir
3321
}
22+
return nil
3423
})
3524
assert.NilError(t, err)
3625
}

examples_test.go

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)