Skip to content

Commit c457f35

Browse files
authored
Merge pull request #2492 from FabianKramm/main
fix: cyclic dependency detection
2 parents a13b5bd + 50ef355 commit c457f35

389 files changed

Lines changed: 28994 additions & 23605 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/run_pipeline.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ func runPipeline(ctx devspacecontext.Context, args []string, options *CommandOpt
460460
defer devPodManager.Close()
461461

462462
// create dependency registry
463-
dependencyRegistry := registry.NewDependencyRegistry(options.DeployOptions.Render)
463+
dependencyRegistry := registry.NewDependencyRegistry(ctx.Config().Config().Name, options.DeployOptions.Render)
464464

465465
// get deploy pipeline
466466
pipe := pipeline.NewPipeline(ctx.Config().Config().Name, devPodManager, dependencyRegistry, configPipeline, options.Options)

e2e/e2e_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package e2e
22

33
import (
4+
"github.com/onsi/ginkgo/v2"
45
"math/rand"
56
"testing"
67
"time"
78

8-
"github.com/onsi/ginkgo"
99
"github.com/onsi/gomega"
1010

1111
// Register tests

e2e/framework/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package framework
33
import (
44
"context"
55
"fmt"
6+
ginkgo "github.com/onsi/ginkgo/v2"
67
"os"
78
"path/filepath"
89
"sync"
@@ -15,7 +16,6 @@ import (
1516
"github.com/loft-sh/devspace/pkg/devspace/kubectl"
1617
"github.com/loft-sh/devspace/pkg/util/factory"
1718
"github.com/loft-sh/devspace/pkg/util/message"
18-
"github.com/onsi/ginkgo"
1919
"github.com/otiai10/copy"
2020
"github.com/pkg/errors"
2121
)

e2e/tests/build/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"context"
66
"errors"
77
"fmt"
8+
"github.com/onsi/ginkgo/v2"
89
"io"
910
"os"
1011
"os/exec"
@@ -19,7 +20,6 @@ import (
1920
"github.com/loft-sh/devspace/pkg/devspace/docker"
2021
"github.com/loft-sh/devspace/pkg/util/factory"
2122
"github.com/loft-sh/devspace/pkg/util/log"
22-
"github.com/onsi/ginkgo"
2323
)
2424

2525
var _ = DevSpaceDescribe("build", func() {

e2e/tests/build/framework.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package build
22

3-
import "github.com/onsi/ginkgo"
3+
import "github.com/onsi/ginkgo/v2"
44

55
// DevSpaceDescribe annotates the test with the label.
66
func DevSpaceDescribe(text string, body func()) bool {

e2e/tests/command/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package command
22

33
import (
44
"bytes"
5+
"github.com/onsi/ginkgo/v2"
56
"os"
67

78
"github.com/loft-sh/devspace/cmd"
89
"github.com/loft-sh/devspace/cmd/flags"
910
"github.com/loft-sh/devspace/e2e/framework"
10-
"github.com/onsi/ginkgo"
1111
)
1212

1313
var _ = DevSpaceDescribe("command", func() {

e2e/tests/command/framework.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package command
22

3-
import "github.com/onsi/ginkgo"
3+
import "github.com/onsi/ginkgo/v2"
44

55
// DevSpaceDescribe annotates the test with the label.
66
func DevSpaceDescribe(text string, body func()) bool {

e2e/tests/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package config
33
import (
44
"bytes"
55
"fmt"
6+
"github.com/onsi/ginkgo/v2"
67
"os"
78
"path/filepath"
89

@@ -20,7 +21,6 @@ import (
2021

2122
"github.com/loft-sh/devspace/e2e/framework"
2223
"github.com/loft-sh/devspace/e2e/kube"
23-
"github.com/onsi/ginkgo"
2424
"github.com/onsi/gomega"
2525
)
2626

e2e/tests/config/framework.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package config
22

3-
import "github.com/onsi/ginkgo"
3+
import "github.com/onsi/ginkgo/v2"
44

55
// DevSpaceDescribe annotates the test with the label.
66
func DevSpaceDescribe(text string, body func()) bool {

e2e/tests/dependencies/dependencies.go

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package dependencies
22

33
import (
44
"context"
5+
ginkgo "github.com/onsi/ginkgo/v2"
56
"os"
67
"path/filepath"
78
"time"
@@ -21,7 +22,6 @@ import (
2122
"github.com/loft-sh/devspace/pkg/devspace/config/loader"
2223
"github.com/loft-sh/devspace/pkg/util/log"
2324
"github.com/loft-sh/devspace/pkg/util/survey"
24-
"github.com/onsi/ginkgo"
2525
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626
)
2727

@@ -42,6 +42,31 @@ var _ = DevSpaceDescribe("dependencies", func() {
4242
kubeClient, err = kube.NewKubeHelper()
4343
})
4444

45+
ginkgo.It("should execute cyclic dependencies correctly", func() {
46+
tempDir, err := framework.CopyToTempDir("tests/dependencies/testdata/cyclic2")
47+
framework.ExpectNoError(err)
48+
defer framework.CleanupTempDir(initialDir, tempDir)
49+
50+
ns, err := kubeClient.CreateNamespace("dependencies")
51+
framework.ExpectNoError(err)
52+
defer func() {
53+
err := kubeClient.DeleteNamespace(ns)
54+
framework.ExpectNoError(err)
55+
}()
56+
57+
// create a new dev command and start it
58+
devCmd := &cmd.RunPipelineCmd{
59+
GlobalFlags: &flags.GlobalFlags{
60+
NoWarn: true,
61+
Namespace: ns,
62+
ConfigPath: "devspace.yaml",
63+
},
64+
Pipeline: "dev",
65+
}
66+
err = devCmd.RunDefault(f)
67+
framework.ExpectNoError(err)
68+
})
69+
4570
ginkgo.It("should wait for dependencies", func() {
4671
tempDir, err := framework.CopyToTempDir("tests/dependencies/testdata/wait")
4772
framework.ExpectNoError(err)

0 commit comments

Comments
 (0)