From fe741894404fadc05365dec6d44ce7a30d8221db Mon Sep 17 00:00:00 2001 From: Daniel Tafoya Date: Tue, 10 Dec 2024 14:49:28 -0500 Subject: [PATCH 1/2] Split K8s e2e test --- test/new-e2e/tests/process/k8s_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/new-e2e/tests/process/k8s_test.go b/test/new-e2e/tests/process/k8s_test.go index 1533bea01cb360..fa3925ed3e10b1 100644 --- a/test/new-e2e/tests/process/k8s_test.go +++ b/test/new-e2e/tests/process/k8s_test.go @@ -156,7 +156,11 @@ func (s *K8sSuite) TestProcessDiscoveryCheck() { assertProcessDiscoveryCollected(t, payloads, "stress-ng-cpu [run]") } -func (s *K8sSuite) TestProcessCheckInCoreAgent() { +type K8sCoreAgentSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +func (s *K8sCoreAgentSuite) TestProcessCheckInCoreAgent() { t := s.T() helmValues, err := createHelmValues(helmConfig{ @@ -207,7 +211,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{ From ce9a1b6968269a9c1018ed67c90329b9c75c72ee Mon Sep 17 00:00:00 2001 From: Daniel Tafoya Date: Tue, 10 Dec 2024 15:27:22 -0500 Subject: [PATCH 2/2] Split K8s e2e test --- test/new-e2e/tests/process/k8s_test.go | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/test/new-e2e/tests/process/k8s_test.go b/test/new-e2e/tests/process/k8s_test.go index fa3925ed3e10b1..7ec7ccff168887 100644 --- a/test/new-e2e/tests/process/k8s_test.go +++ b/test/new-e2e/tests/process/k8s_test.go @@ -160,21 +160,28 @@ type K8sCoreAgentSuite struct { e2e.BaseSuite[environments.Kubernetes] } -func (s *K8sCoreAgentSuite) TestProcessCheckInCoreAgent() { - t := s.T() - +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() {