MCPcopy Index your code
hub / github.com/devspace-sh/devspace / TestLoad

Function TestLoad

pkg/devspace/compose/manager_test.go:16–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestLoad(t *testing.T) {
17 dirs, err := os.ReadDir("testdata")
18 if err != nil {
19 t.Error(err)
20 }
21
22 if len(dirs) == 0 {
23 t.Error("No test cases found. Add some!")
24 }
25
26 focused := []string{}
27 for _, dir := range dirs {
28 if strings.HasPrefix(dir.Name(), "f_") {
29 focused = append(focused, dir.Name())
30 }
31 }
32
33 if len(focused) > 0 {
34 for _, focus := range focused {
35 testLoad(focus, t)
36 }
37 } else {
38 for _, dir := range dirs {
39 if !strings.HasPrefix(dir.Name(), "x_") {
40 testLoad(dir.Name(), t)
41 }
42 }
43 }
44
45}
46
47func testLoad(dir string, t *testing.T) {
48 wd, err := os.Getwd()

Callers

nothing calls this directly

Calls 3

testLoadFunction · 0.70
NameMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected