Skip to content

Commit

Permalink
test(e2e): remove references to kind
Browse files Browse the repository at this point in the history
While [kind](https://kind.sigs.k8s.io/) might be nice as a basis for
cross platform e2e tests, it currently makes network access from the
host machine to deployed pods harder than they should be, so for now we
do not run the e2e tests on kind.
  • Loading branch information
basti1302 committed May 21, 2024
1 parent b4ce15d commit f495768
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
25 changes: 1 addition & 24 deletions test/e2e/e2e_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,8 @@ func UninstallCollector() error {

func InstallNodeJsDeployment() error {
imageName := "dash0-operator-nodejs-20-express-test-app"
//cluster := getKindCluster()
//kindLoadAppImage := loadImageToKindClusterWithNameCommand(imageName, cluster)
//kindLoadInstrumentationImage := loadImageToKindClusterWithNameCommand("dash0-instrumentation:1.0.0", cluster)
err := RunMultipleFromStrings([][]string{
{"docker", "build", "test-resources/node.js/express", "-t", imageName},
//kindLoadAppImage,
//kindLoadInstrumentationImage, // TODO actually do this in BeforeAll, and also do a fresh docker build
{"kubectl", "apply", "-f", "test-resources/node.js/express/deploy.yaml"},
})
if err != nil {
Expand All @@ -226,27 +221,9 @@ func UninstallNodeJsDeployment() error {
return RunAndIgnoreOutput(exec.Command("kubectl", "delete", "-f", "test-resources/node.js/express/deploy.yaml"))
}

// LoadImageToKindCluster loads a local docker image to the kind cluster
func LoadImageToKindClusterWithName(imageName string) error {
cluster := getKindCluster()
kindLoadImage := loadImageToKindClusterWithNameCommand(imageName, cluster)
return RunAndIgnoreOutput(exec.Command(kindLoadImage[0], kindLoadImage[1:]...))
}

func getKindCluster() string {
cluster := "kind"
if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
cluster = v
}
return cluster
}

func loadImageToKindClusterWithNameCommand(imageName string, cluster string) []string {
return []string{"kind", "load", "docker-image", imageName, "--name", cluster}
}

func SendRequestAndVerifySpansHaveBeenProduced() {
timestampLowerBound := time.Now()

By("verify that the resource has been instrumented and is sending telemetry", func() {
Eventually(func(g Gomega) {
output, err := Run(exec.Command("curl", "http://localhost:1207/ohai"), false)
Expand Down
4 changes: 0 additions & 4 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ var _ = Describe("controller", Ordered, func() {
_, err = Run(cmd)
ExpectWithOffset(1, err).NotTo(HaveOccurred())

// By("loading the the manager(Operator) image on Kind")
// err = LoadImageToKindClusterWithName(projectimage)
// ExpectWithOffset(1, err).NotTo(HaveOccurred())

By("installing CRDs")
cmd = exec.Command("make", "install")
_, err = Run(cmd)
Expand Down

0 comments on commit f495768

Please sign in to comment.