Skip to content

Commit

Permalink
Add make command to run a specific e2e test (#1547)
Browse files Browse the repository at this point in the history
* make command for a specific e2e test

* update command to use env var

* updated e2e specific test

* remove parentheses from test headers

* update e2e-tests

* nit
  • Loading branch information
swang392 authored Jan 6, 2025
1 parent a408715 commit 8ad0c66
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,15 @@ integration-tests-v2: $(ENVTEST) ## Run tests with reconciler V2
KUBEBUILDER_ASSETS="$(ROOT)/bin/$(PLATFORM)/" go test --tags=integration_v2 github.com/DataDog/datadog-operator/internal/controller -coverprofile cover_integration_v2.out

.PHONY: e2e-tests
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`.
e2e-tests: ## 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
@if [ -z "$(E2E_RUN_REGEX)" ]; then \
KUBEBUILDER_ASSETS="$(ROOT)/bin/$(PLATFORM)/" go test -C test/e2e/ ./... -count=1 --tags=e2e -v -run TestAWSKindSuite -timeout 0s -coverprofile cover_e2e.out; \
else \
echo "Running e2e test: $(E2E_RUN_REGEX)"; \
KUBEBUILDER_ASSETS="$(ROOT)/bin/$(PLATFORM)/" go test -C test/e2e/ ./... -count=1 --tags=e2e -v -run $(E2E_RUN_REGEX) -timeout 0s -coverprofile cover_e2e.out; \
fi

.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
3 changes: 2 additions & 1 deletion test/e2e/tests/k8s_suite/k8s_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package k8ssuite
import (
"context"
"fmt"

"github.com/DataDog/datadog-agent/test/fakeintake/aggregator"
"github.com/DataDog/datadog-agent/test/fakeintake/client"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
Expand Down Expand Up @@ -128,7 +129,7 @@ func (s *k8sSuite) TestGenericK8s() {

})

s.T().Run("KSM check works (cluster check runner)", func(t *testing.T) {
s.T().Run("KSM check works cluster check runner", func(t *testing.T) {
ddaConfigPath, err := common.GetAbsPath(filepath.Join(common.ManifestsPath, "datadog-agent-ccr-enabled.yaml"))
assert.NoError(s.T(), err)

Expand Down

0 comments on commit 8ad0c66

Please sign in to comment.