Skip to content

Commit

Permalink
[e2e][refactoring] 🚚 move provisioners to dedicated package (#32403)
Browse files Browse the repository at this point in the history
  • Loading branch information
pducolin authored Dec 20, 2024
1 parent bc6a047 commit c60d01f
Show file tree
Hide file tree
Showing 168 changed files with 392 additions and 315 deletions.
7 changes: 4 additions & 3 deletions test/new-e2e/examples/agentenv_checkruns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import (
"testing"
"time"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"
)

type agentSuiteEx5 struct {
Expand Down
7 changes: 4 additions & 3 deletions test/new-e2e/examples/agentenv_copyfolder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import (
"path"
"testing"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
"github.com/DataDog/test-infra-definitions/components/datadog/agentparams"
"github.com/stretchr/testify/require"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"
)

type agentSuiteEx6 struct {
Expand Down
9 changes: 5 additions & 4 deletions test/new-e2e/examples/agentenv_file_permissions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ package examples
import (
"testing"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils"
"github.com/DataDog/test-infra-definitions/components/datadog/agentparams"
perms "github.com/DataDog/test-infra-definitions/components/datadog/agentparams/filepermissions"
"github.com/stretchr/testify/assert"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"
secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils"
)

type filePermissionsTestSuite struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"
secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils"
)

Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/agentenv_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
fi "github.com/DataDog/datadog-agent/test/fakeintake/client"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"

"github.com/DataDog/test-infra-definitions/components/datadog/agentparams"

Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/agentenv_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/DataDog/datadog-agent/test/fakeintake/client"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"

"github.com/stretchr/testify/assert"
)
Expand Down
5 changes: 3 additions & 2 deletions test/new-e2e/examples/agentenv_updateenv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ package examples
import (
"testing"

"github.com/DataDog/test-infra-definitions/components/datadog/agentparams"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
"github.com/DataDog/test-infra-definitions/components/datadog/agentparams"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/aks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
azurekubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/azure/kubernetes"
azurekubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/azure/kubernetes"
)

type aksSuite struct {
Expand Down
3 changes: 2 additions & 1 deletion test/new-e2e/examples/azure_vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
package examples

import (
azurehost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/azure/host/windows"
"testing"

azurehost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/azure/host/windows"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
)
Expand Down
8 changes: 5 additions & 3 deletions test/new-e2e/examples/customenv_with_docker_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import (
"testing"
"time"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/components"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/components"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners"

"github.com/DataDog/test-infra-definitions/components/docker"
"github.com/DataDog/test-infra-definitions/components/os"
"github.com/DataDog/test-infra-definitions/resources/aws"
Expand Down Expand Up @@ -47,7 +49,7 @@ var lighttpdConfigContent string
//go:embed testfixtures/lighttpd_integration.conf.yaml
var lighttpdIntegrationConfigContent string

func vmPlusDockerEnvProvisioner() e2e.PulumiEnvRunFunc[vmPlusDockerEnv] {
func vmPlusDockerEnvProvisioner() provisioners.PulumiEnvRunFunc[vmPlusDockerEnv] {
return func(ctx *pulumi.Context, env *vmPlusDockerEnv) error {
awsEnv, err := aws.NewEnvironment(ctx)
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions test/new-e2e/examples/customenv_with_filemanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import (
"path"
"testing"

"github.com/stretchr/testify/require"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
"github.com/stretchr/testify/require"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners"

osComp "github.com/DataDog/test-infra-definitions/components/os"
"github.com/DataDog/test-infra-definitions/resources/aws"
Expand All @@ -25,7 +27,7 @@ type fileManagerSuiteEx7 struct {
e2e.BaseSuite[environments.Host]
}

func customProvisionerFileManager(localFolderPath string, remoteFolderPath string) e2e.PulumiEnvRunFunc[environments.Host] {
func customProvisionerFileManager(localFolderPath string, remoteFolderPath string) provisioners.PulumiEnvRunFunc[environments.Host] {
return func(ctx *pulumi.Context, env *environments.Host) error {
awsEnv, err := aws.NewEnvironment(ctx)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion test/new-e2e/examples/customenv_with_two_vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/components"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners"

"github.com/DataDog/test-infra-definitions/components/os"
"github.com/DataDog/test-infra-definitions/resources/aws"
Expand All @@ -23,7 +24,7 @@ type multiVMEnv struct {
AppVM *components.RemoteHost
}

func multiVMEnvProvisioner() e2e.PulumiEnvRunFunc[multiVMEnv] {
func multiVMEnvProvisioner() provisioners.PulumiEnvRunFunc[multiVMEnv] {
return func(ctx *pulumi.Context, env *multiVMEnv) error {
awsEnv, err := aws.NewEnvironment(ctx)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/dockerenv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker"
awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient"
)

Expand Down
7 changes: 4 additions & 3 deletions test/new-e2e/examples/dockerenv_with_extra_compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (
"strings"
"testing"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker"
"github.com/DataDog/test-infra-definitions/components/datadog/dockeragentparams"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker"
)

type dockerSuiteWithExtraCompose struct {
Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/ecs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/ecs"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/ecs"

tifEcs "github.com/DataDog/test-infra-definitions/scenarios/aws/ecs"
awsecs "github.com/aws/aws-sdk-go-v2/service/ecs"
Expand Down
3 changes: 2 additions & 1 deletion test/new-e2e/examples/gcp_vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
package examples

import (
gcphost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/gcp/host/linux"
"testing"

gcphost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/gcp/host/linux"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
)
Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/gke_autopilot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

gcpkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/gcp/kubernetes"
gcpkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/gcp/kubernetes"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
Expand Down
8 changes: 5 additions & 3 deletions test/new-e2e/examples/gke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ package examples

import (
"context"
gcpkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/gcp/kubernetes"
"strings"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"strings"
"testing"

gcpkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/gcp/kubernetes"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/kind_local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
localkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/local/kubernetes"
localkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/local/kubernetes"
)

type myLocalKindSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/kind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes"
awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes"

"github.com/DataDog/test-infra-definitions/common/config"
"github.com/DataDog/test-infra-definitions/components/datadog/apps/dogstatsd"
Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/vm_localpodman_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/DataDog/datadog-agent/test/fakeintake/client"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
localhost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/local/host"
localhost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/local/host"
)

type vmLocalPodmanSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"
)

type vmSuite struct {
Expand Down
7 changes: 4 additions & 3 deletions test/new-e2e/examples/vm_with_file_operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import (

"golang.org/x/crypto/ssh"

"github.com/DataDog/test-infra-definitions/components/os"
"github.com/DataDog/test-infra-definitions/scenarios/aws/ec2"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client"
"github.com/DataDog/test-infra-definitions/components/os"
"github.com/DataDog/test-infra-definitions/scenarios/aws/ec2"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion test/new-e2e/examples/vmenv_withami_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client"

"github.com/DataDog/test-infra-definitions/components/os"
Expand Down
7 changes: 4 additions & 3 deletions test/new-e2e/examples/vmenv_withos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ package examples
import (
"testing"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host"
"github.com/DataDog/test-infra-definitions/components/os"
"github.com/DataDog/test-infra-definitions/scenarios/aws/ec2"

"github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e"
"github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments"
awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host"

"github.com/stretchr/testify/assert"
)

Expand Down
Loading

0 comments on commit c60d01f

Please sign in to comment.