Skip to content

Commit

Permalink
[PROCS-4589] Split K8s e2e test (DataDog#31985)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-taf authored Dec 10, 2024
1 parent 8a450cc commit 706fa94
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions test/new-e2e/tests/process/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,32 @@ func (s *K8sSuite) TestProcessDiscoveryCheck() {
assertProcessDiscoveryCollected(t, payloads, "stress-ng-cpu [run]")
}

func (s *K8sSuite) TestProcessCheckInCoreAgent() {
t := s.T()
type K8sCoreAgentSuite struct {
e2e.BaseSuite[environments.Kubernetes]
}

func TestK8sCoreAgentTestSuite(t *testing.T) {
t.Parallel()
helmValues, err := createHelmValues(helmConfig{
ProcessCollection: true,
RunInCoreAgent: true,
})
require.NoError(t, err)

s.UpdateEnv(awskubernetes.KindProvisioner(
awskubernetes.WithWorkloadApp(func(e config.Env, kubeProvider *kubernetes.Provider) (*kubeComp.Workload, error) {
return cpustress.K8sAppDefinition(e, kubeProvider, "workload-stress")
}),
awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(helmValues)),
))
options := []e2e.SuiteOption{
e2e.WithProvisioner(awskubernetes.KindProvisioner(
awskubernetes.WithWorkloadApp(func(e config.Env, kubeProvider *kubernetes.Provider) (*kubeComp.Workload, error) {
return cpustress.K8sAppDefinition(e, kubeProvider, "workload-stress")
}),
awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(helmValues)),
)),
}

e2e.Run(t, &K8sCoreAgentSuite{}, options...)
}

func (s *K8sCoreAgentSuite) TestProcessCheckInCoreAgent() {
t := s.T()

var status AgentStatus
defer func() {
Expand Down Expand Up @@ -207,7 +218,7 @@ func (s *K8sSuite) TestProcessCheckInCoreAgent() {
assertContainersNotCollected(t, payloads, []string{"process-agent"})
}

func (s *K8sSuite) TestProcessCheckInCoreAgentWithNPM() {
func (s *K8sCoreAgentSuite) TestProcessCheckInCoreAgentWithNPM() {
t := s.T()

helmValues, err := createHelmValues(helmConfig{
Expand Down

0 comments on commit 706fa94

Please sign in to comment.