Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-enable rc e2e #1606

Draft
wants to merge 1 commit into
base: fanny/refactor-kind-e2e
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ integration-tests-v2: $(ENVTEST) ## Run tests with reconciler V2
e2e-tests: manifests $(KUSTOMIZE) ## Run E2E tests and destroy environment stacks after tests complete. To run locally, complete pre-reqs (see docs/how-to-contribute.md) and prepend command with `aws-vault exec sso-agent-sandbox-account-admin --`. E.g. `aws-vault exec sso-agent-sandbox-account-admin -- make e2e-tests`.
cd test/e2e && go get github.com/DataDog/datadog-agent/test/new-e2e@9ebd4d1cebbe1c9141e3a6b54176fdea8a79dd91
cd $(ROOT)
KUBEBUILDER_ASSETS="$(ROOT)/bin/$(PLATFORM)/" go test -C test/e2e ./... -run TestAWSKindSuite -tags=!e2e -count=1 -v -timeout=0s -coverprofile cover_e2e.out
KUBEBUILDER_ASSETS="$(ROOT)/bin/$(PLATFORM)/" go test -C test/e2e ./... -count=1 -v -timeout=0s -coverprofile cover_e2e.out

.PHONY: e2e-tests-keep-stacks
e2e-tests-keep-stacks: manifests $(KUSTOMIZE) ## Run E2E tests and keep environment stacks running. To run locally, complete pre-reqs (see docs/how-to-contribute.md) and prepend command with `aws-vault exec sso-agent-sandbox-account-admin --`. E.g. `aws-vault exec sso-agent-sandbox-account-admin -- make e2e-tests-keep-stacks`.
Expand Down
40 changes: 5 additions & 35 deletions test/e2e/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

//go:build e2e
// +build e2e

package e2e

import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"regexp"
"testing"
"time"

Expand Down Expand Up @@ -56,24 +51,19 @@ alias kl="kubectl logs"
alias kx="kubectl exec"
' >> /home/ubuntu/.bashrc
`
defaultMgrImageName = "gcr.io/datadoghq/operator"
defaultMgrImgTag = "latest"
defaultMgrFileName = "e2e-manager.yaml"
nodeAgentSelector = "agent.datadoghq.com/component=agent"
clusterAgentSelector = "agent.datadoghq.com/component=cluster-agent"
clusterCheckRunnerSelector = "agent.datadoghq.com/component=cluster-checks-runner"
defaultMgrImageName = "gcr.io/datadoghq/operator"
defaultMgrImgTag = "latest"
nodeAgentSelector = "agent.datadoghq.com/component=agent"
)

var (
namespaceName = "system"
namespaceName = "e2e-operator"
k8sVersion = getEnv("K8S_VERSION", "1.26")
imgPullPassword = getEnv("IMAGE_PULL_PASSWORD", "")

kubeConfigPath string
kubectlOptions *k8s.KubectlOptions

tmpDir string
ddaMinimalPath = filepath.Join(manifestsPath, "datadog-agent-minimum.yaml")
tmpDir string
)

// getAbsPath Return absolute path for given path
Expand Down Expand Up @@ -211,23 +201,3 @@ func updateKustomization(kustomizeDirPath string, kustomizeResourcePaths []strin

return nil
}

func parseCollectorJson(collectorOutput string) map[string]interface{} {
var jsonString string
var jsonObject map[string]interface{}

re := regexp.MustCompile(`(\{.*\})`)
match := re.FindStringSubmatch(collectorOutput)
if len(match) > 0 {
jsonString = match[0]
} else {
return map[string]interface{}{}
}

// Parse collector JSON
err := json.Unmarshal([]byte(jsonString), &jsonObject)
if err != nil {
return map[string]interface{}{}
}
return jsonObject
}
Loading
Loading