Skip to content

Commit

Permalink
Small refacto and add agent 6
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinFairise2 committed Nov 22, 2023
1 parent 40990ef commit df98304
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 27 deletions.
8 changes: 8 additions & 0 deletions .gitlab/new-e2e_common/testing.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.new-e2e_agent_a6:
rules:
!reference [.on_kitchen_tests_a6] #TODO: Change when migration is complete to another name without 'kitchen'
variables:
AGENT_MAJOR_VERSION: 6



.new-e2e_agent_a7:
rules:
!reference [.on_kitchen_tests_a7] #TODO: Change when migration is complete to another name without 'kitchen'
Expand Down
90 changes: 68 additions & 22 deletions .gitlab/new-e2e_testing/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,131 @@
variables:
E2E_PLATFORM: debian

.new-e2e_debian_a7_x64:
.new-e2e_install_script:
variables:
TARGET: ./tests/install-script
TEAM: agent-platform
EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --major-version $AGENT_MAJOR_VERSION --arch $E2E_ARCH --flavor $FLAVOR

.new-e2e_debian_a6_x86_64:
variables:
E2E_ARCH: x86_64
E2E_OSVERS: "debian-9,debian-10,debian-11,debian-12"
E2E_CWS_SUPPORTED_OSVERS: "debian-10,debian-11"
E2E_BRANCH_OSVERS: "debian-11"
E2E_MAJOR_VERSION: 6
needs: ["deploy_deb_testing-a6_x64"]

.new-e2e_debian_a6_arm64:
variables:
E2E_ARCH: arm64
E2E_OSVERS: "debian-10"
E2E_CWS_SUPPORTED_OSVERS: "debian-10"
E2E_BRANCH_OSVERS: "debian-10"
E2E_MAJOR_VERSION: 6
needs: ["deploy_deb_testing-a6_arm64"]

.new-e2e_debian_a7_x86_64:
variables:
E2E_ARCH: x86_64
E2E_OSVERS: "debian-9,debian-10,debian-11,debian-12"
E2E_CWS_SUPPORTED_OSVERS: "debian-10,debian-11"
E2E_BRANCH_OSVERS: "debian-11"
E2E_MAJOR_VERSION: 7
needs: ["deploy_deb_testing-a7_x64"]

.new-e2e_debian_a7_arm64:
variables:
E2E_ARCH: arm64
E2E_OSVERS: "debian-10"
E2E_CWS_SUPPORTED_OSVERS: "debian-10"
E2E_BRANCH_OSVERS: "debian-10"
E2E_MAJOR_VERSION: 7
needs: ["deploy_deb_testing-a7_arm64"]

new-e2e-agent-platform-install-script-debian-a6-x86_64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_install_script
- .new-e2e_os_debian
- .new-e2e_debian_a6_x86_64
- .new-e2e_agent_a6

new-e2e-agent-platform-install-script-debian-a6-arm64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_install_script
- .new-e2e_os_debian
- .new-e2e_debian_a6_arm64
- .new-e2e_agent_a6

new-e2e-agent-platform-install-script-debian-a7-x64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_install_script
- .new-e2e_os_debian
- .new-e2e_debian_a7_x64
- .new-e2e_debian_a7_x86_64
- .new-e2e_agent_a7
rules:
!reference [.on_default_new-e2e_tests_a7]
variables:
TARGETS: ./tests/agent-platform/install-script
TEAM: agent-platform
EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch x86_64

new-e2e-agent-platform-install-script-debian-a7-arm64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_install_script
- .new-e2e_os_debian
- .new-e2e_debian_a7_arm64
- .new-e2e_agent_a7
rules:
!reference [.on_all_new-e2e_tests_a7]
variables:
TARGETS: ./tests/agent-platform/install-script
TEAM: agent-platform
EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch arm64

new-e2e-agent-platform-install-script-debian-iot-agent-a7-x86_64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_install_script
- .new-e2e_os_debian
- .new-e2e_debian_a7_x64
- .new-e2e_debian_a7_x86_64
- .new-e2e_agent_a7
rules:
!reference [.on_default_new-e2e_tests_a7]
variables:
TARGETS: ./tests/agent-platform/install-script
TEAM: agent-platform
EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch x86_64 --flavor datadog-iot-agent
FLAVOR: datadog-iot-agent

new-e2e-agent-platform-install-script-debian-dogstatsd-a7-x86_64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_install_script
- .new-e2e_os_debian
- .new-e2e_debian_a7_x64
- .new-e2e_debian_a7_x86_64
- .new-e2e_agent_a7
variables:
TARGETS: ./tests/agent-platform/install-script
TEAM: agent-platform
EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch x86_64 --flavor datadog-dogstatsd
FLAVOR: datadog-dogstatsd

new-e2e-agent-platform-install-script-debian-heroku-agent-a6-x86_64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_os_debian
- .new-e2e_debian_a6_x86_64
- .new-e2e_agent_a6
variables:
FLAVOR: datadog-heroku-agent

new-e2e-agent-platform-install-script-debian-heroku-agent-a7-x86_64:
stage: kitchen_testing
extends:
- .new_e2e_template
- .new-e2e_os_debian
- .new-e2e_debian_a7_x64
- .new-e2e_debian_a7_x86_64
- .new-e2e_agent_a7
variables:
TARGETS: ./tests/agent-platform/install-script
TEAM: agent-platform
EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch x86_64 --flavor datadog-heroku-agent
FLAVOR: datadog-heroku-agent



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import (
var osVersion = flag.String("osversion", "", "os version to test")
var platform = flag.String("platform", "", "platform to test")
var cwsSupportedOsVersion = flag.String("cws-supported-osversion", "", "list of os where CWS is supported")
var architecture = flag.String("arch", "", "architecture to test (x86_64, arm64))")
var flavor = flag.String("flavor", "", "flavor to test (datadog-agent, datadog-iot-agent, datadog-dogstatsd, datadog-fips-proxy, datadog-heroku-agent)")
var architecture = flag.String("arch", "x86_64", "architecture to test (x86_64, arm64))")
var flavor = flag.String("flavor", "datadog-agent", "flavor to test (datadog-agent, datadog-iot-agent, datadog-dogstatsd, datadog-fips-proxy, datadog-heroku-agent)")
var majorVersion = flag.String("major-version", "7", "major version to test (6, 7)")

type installScriptSuite struct {
e2e.Suite[e2e.VMEnv]
Expand Down Expand Up @@ -75,10 +76,10 @@ func TestInstallScript(t *testing.T) {
}
}

t.Run(fmt.Sprintf("test install script on %s %s %s", osVers, *architecture, *flavor), func(tt *testing.T) {
t.Run(fmt.Sprintf("test install script on %s %s %s agent %s", osVers, *architecture, *flavor, *majorVersion), func(tt *testing.T) {
tt.Parallel()
fmt.Printf("Testing %s", osVers)
e2e.Run(tt, &installScriptSuite{cwsSupported: cwsSupported}, e2e.EC2VMStackDef(ec2params.WithImageName(platformJSON[*platform][*architecture][osVers], archMapping[*architecture], osMapping[*platform])), params.WithStackName(fmt.Sprintf("install-script-test-%v-%v-%s-%s", os.Getenv("CI_PIPELINE_ID"), osVers, *architecture, *flavor)))
e2e.Run(tt, &installScriptSuite{cwsSupported: cwsSupported}, e2e.EC2VMStackDef(ec2params.WithImageName(platformJSON[*platform][*architecture][osVers], archMapping[*architecture], osMapping[*platform])), params.WithStackName(fmt.Sprintf("install-script-test-%v-%v-%s-%s-%v", os.Getenv("CI_PIPELINE_ID"), osVers, *architecture, *flavor, *majorVersion)))
})
}
}
Expand All @@ -95,13 +96,16 @@ func (is *installScriptSuite) TestInstallAgent() {
unixHelper := helpers.NewUnixHelper()
client := common.NewTestClient(is.Env().VM, agentClient, fileManager, unixHelper)

install.Unix(is.T(), client, installparams.WithArch(*architecture), installparams.WithFlavor(*flavor))
install.Unix(is.T(), client, installparams.WithArch(*architecture), installparams.WithFlavor(*flavor), installparams.WithMajorVersion(*majorVersion))

common.CheckInstallation(is.T(), client)
common.CheckAgentBehaviour(is.T(), client)
common.CheckAgentStops(is.T(), client)
common.CheckAgentRestarts(is.T(), client)
common.CheckIntegrationInstall(is.T(), client)
if *majorVersion == "6" {
common.CheckAgentPython(is.T(), client, "2")
}
common.CheckAgentPython(is.T(), client, "3")
common.CheckApmEnabled(is.T(), client)
common.CheckApmDisabled(is.T(), client)
Expand Down

0 comments on commit df98304

Please sign in to comment.