diff --git a/.gitlab/e2e_install_packages/windows.yml b/.gitlab/e2e_install_packages/windows.yml index 40fb862e2397b..aaf2f4d361b46 100644 --- a/.gitlab/e2e_install_packages/windows.yml +++ b/.gitlab/e2e_install_packages/windows.yml @@ -58,8 +58,6 @@ - E2E_MSI_TEST: TestNPMInstallWithAddLocal - E2E_MSI_TEST: TestNPMUpgradeFromBeta - E2E_MSI_TEST: TestUpgradeFromV6 - - E2E_MSI_TEST: TestFIPSAgentDoesNotInstallOverAgent - - E2E_MSI_TEST: TestAgentDoesNotInstallOverFIPSAgent new-e2e_windows_powershell_module_test: extends: .new_e2e_template @@ -116,7 +114,13 @@ new-e2e-windows-agent-a7-x86_64-fips: - .new-e2e_agent_a7 needs: - !reference [.needs_new_e2e_template] + - deploy_windows_testing-a7 - deploy_windows_testing-a7-fips + parallel: + matrix: + - EXTRA_PARAMS: --run "TestFIPSAgent$" + - EXTRA_PARAMS: --run "TestFIPSAgentDoesNotInstallOverAgent$" + - EXTRA_PARAMS: --run "TestAgentDoesNotInstallOverFIPSAgent$" rules: - !reference [.on_deploy] - !reference [.on_e2e_or_windows_installer_changes] diff --git a/test/new-e2e/tests/windows/install-test/mutually_exclusive_product_test.go b/test/new-e2e/tests/windows/fips-test/mutually_exclusive_product_test.go similarity index 94% rename from test/new-e2e/tests/windows/install-test/mutually_exclusive_product_test.go rename to test/new-e2e/tests/windows/fips-test/mutually_exclusive_product_test.go index 1e4c084400d4d..a844f68ed1b4a 100644 --- a/test/new-e2e/tests/windows/install-test/mutually_exclusive_product_test.go +++ b/test/new-e2e/tests/windows/fips-test/mutually_exclusive_product_test.go @@ -3,14 +3,15 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package installtest +package fipstest import ( "os" "path/filepath" "strings" - "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" + installtest "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/install-test" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows" windowsCommon "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common" @@ -37,7 +38,7 @@ func TestFIPSAgentDoesNotInstallOverAgent(t *testing.T) { require.NoError(t, err, "should get last stable agent package from env") s.previousAgentPackage = previousAgentPackage os.Setenv(windowsAgent.PackageFlavorEnvVar, "fips") - run(t, s) + installtest.Run[environments.WindowsHost](t, s) } // TestAgentDoesNotInstallOverFIPSAgent tests that the base Agent cannot be installed over the FIPS agent @@ -51,7 +52,7 @@ func TestAgentDoesNotInstallOverFIPSAgent(t *testing.T) { require.NoError(t, err, "should get Agent package from env") s.previousAgentPackage = previousAgentPackage os.Setenv(windowsAgent.PackageFlavorEnvVar, "base") - run(t, s) + installtest.Run[environments.WindowsHost](t, s) } func (s *mutuallyExclusiveInstallSuite) SetupSuite() { @@ -68,7 +69,6 @@ func (s *mutuallyExclusiveInstallSuite) SetupSuite() { } func (s *mutuallyExclusiveInstallSuite) TestMutuallyExclusivePackage() { - flake.Mark(s.T()) host := s.Env().RemoteHost // Install second Agent diff --git a/test/new-e2e/tests/windows/install-test/agent_user_test.go b/test/new-e2e/tests/windows/install-test/agent_user_test.go index 225da860010c3..dc58e05ea776e 100644 --- a/test/new-e2e/tests/windows/install-test/agent_user_test.go +++ b/test/new-e2e/tests/windows/install-test/agent_user_test.go @@ -142,7 +142,7 @@ func TestAgentUser(t *testing.T) { tc: tc, } t.Run(tc.TC().name, func(t *testing.T) { - run(t, s) + Run(t, s) }) } } diff --git a/test/new-e2e/tests/windows/install-test/base.go b/test/new-e2e/tests/windows/install-test/base.go index 5646e7d8a20af..ba4f68158f05c 100644 --- a/test/new-e2e/tests/windows/install-test/base.go +++ b/test/new-e2e/tests/windows/install-test/base.go @@ -260,7 +260,8 @@ func isCI() bool { return os.Getenv("CI") != "" } -func run[Env any](t *testing.T, s e2e.Suite[Env]) { +// Run sets some options and runs an install test. +func Run[Env any](t *testing.T, s e2e.Suite[Env]) { opts := []e2e.SuiteOption{e2e.WithProvisioner(awsHostWindows.ProvisionerNoAgentNoFakeIntake())} agentPackage, err := windowsAgent.GetPackageFromEnv() diff --git a/test/new-e2e/tests/windows/install-test/install_subservices_test.go b/test/new-e2e/tests/windows/install-test/install_subservices_test.go index 6a281bca8a322..8aea1a9c5acdd 100644 --- a/test/new-e2e/tests/windows/install-test/install_subservices_test.go +++ b/test/new-e2e/tests/windows/install-test/install_subservices_test.go @@ -42,7 +42,7 @@ func TestSubServicesOpts(t *testing.T) { tc: tc, } t.Run(tc.name, func(t *testing.T) { - run(t, s) + Run(t, s) }) // clean the host between test runs s.cleanupOnSuccessInDevMode() diff --git a/test/new-e2e/tests/windows/install-test/install_test.go b/test/new-e2e/tests/windows/install-test/install_test.go index 9ca039c19bf52..95823f0a8ca8d 100644 --- a/test/new-e2e/tests/windows/install-test/install_test.go +++ b/test/new-e2e/tests/windows/install-test/install_test.go @@ -26,7 +26,7 @@ import ( func TestInstall(t *testing.T) { s := &testInstallSuite{} - run(t, s) + Run(t, s) } type testInstallSuite struct { @@ -127,7 +127,7 @@ func (s *testInstallSuite) testCodeSignatures(t *Tester, remoteMSIPath string) { // checks that the files are not removed func TestInstallExistingAltDir(t *testing.T) { s := &testInstallExistingAltDirSuite{} - run(t, s) + Run(t, s) } type testInstallExistingAltDirSuite struct { @@ -189,7 +189,7 @@ func (s *testInstallExistingAltDirSuite) TestInstallExistingAltDir() { func TestInstallAltDir(t *testing.T) { s := &testInstallAltDirSuite{} - run(t, s) + Run(t, s) } type testInstallAltDirSuite struct { @@ -224,7 +224,7 @@ func (s *testInstallAltDirSuite) TestInstallAltDir() { func TestInstallAltDirAndCorruptForUninstall(t *testing.T) { s := &testInstallAltDirAndCorruptForUninstallSuite{} - run(t, s) + Run(t, s) } type testInstallAltDirAndCorruptForUninstallSuite struct { @@ -261,7 +261,7 @@ func (s *testInstallAltDirAndCorruptForUninstallSuite) TestInstallAltDirAndCorru func TestRepair(t *testing.T) { s := &testRepairSuite{} - run(t, s) + Run(t, s) } type testRepairSuite struct { @@ -313,7 +313,7 @@ func (s *testRepairSuite) TestRepair() { func TestInstallOpts(t *testing.T) { s := &testInstallOptsSuite{} - run(t, s) + Run(t, s) } type testInstallOptsSuite struct { @@ -420,7 +420,7 @@ func (s *testInstallOptsSuite) TestInstallOpts() { func TestInstallFail(t *testing.T) { s := &testInstallFailSuite{} - run(t, s) + Run(t, s) } type testInstallFailSuite struct { diff --git a/test/new-e2e/tests/windows/install-test/npm_test.go b/test/new-e2e/tests/windows/install-test/npm_test.go index e6a70d4140aca..b674713aafa65 100644 --- a/test/new-e2e/tests/windows/install-test/npm_test.go +++ b/test/new-e2e/tests/windows/install-test/npm_test.go @@ -28,7 +28,7 @@ import ( func TestNPMUpgradeToNPM(t *testing.T) { s := &testNPMUpgradeToNPMSuite{} s.previousVersion = "7.42.0-1" - run(t, s) + Run(t, s) } type testNPMUpgradeToNPMSuite struct { @@ -55,7 +55,7 @@ func (s *testNPMUpgradeToNPMSuite) TestNPMUgpradeToNPM() { func TestNPMUpgradeNPMToNPM(t *testing.T) { s := &testNPMUpgradeNPMToNPMSuite{} s.previousVersion = "7.42.0-1" - run(t, s) + Run(t, s) } type testNPMUpgradeNPMToNPMSuite struct { @@ -84,7 +84,7 @@ func (s *testNPMUpgradeNPMToNPMSuite) TestNPMUpgradeNPMToNPM() { // Old name: Scenario 9 func TestNPMInstallWithAddLocal(t *testing.T) { s := &testNPMInstallWithAddLocalSuite{} - run(t, s) + Run(t, s) } type testNPMInstallWithAddLocalSuite struct { @@ -113,7 +113,7 @@ func TestNPMUpgradeFromBeta(t *testing.T) { s := &testNPMUpgradeFromBeta{} s.previousVersion = "7.23.2-beta1-1" s.url = "https://ddagent-windows-unstable.s3.amazonaws.com/datadog-agent-7.23.2-beta1-1-x86_64.msi" - run(t, s) + Run(t, s) } type testNPMUpgradeFromBeta struct { diff --git a/test/new-e2e/tests/windows/install-test/upgrade_test.go b/test/new-e2e/tests/windows/install-test/upgrade_test.go index 6bd74a2b08924..f6cdd349f029e 100644 --- a/test/new-e2e/tests/windows/install-test/upgrade_test.go +++ b/test/new-e2e/tests/windows/install-test/upgrade_test.go @@ -29,7 +29,7 @@ func TestUpgrade(t *testing.T) { previousAgentPackage, err := windowsAgent.GetLastStablePackageFromEnv() require.NoError(t, err, "should get last stable agent package from env") s.previousAgentPackge = previousAgentPackage - run(t, s) + Run(t, s) } type testUpgradeSuite struct { @@ -79,7 +79,7 @@ func TestUpgradeFromLatest(t *testing.T) { upgradeAgentPackge, err := windowsAgent.GetUpgradeTestPackageFromEnv() require.NoError(t, err, "should get last stable agent package from env") s.upgradeAgentPackge = upgradeAgentPackge - run(t, s) + Run(t, s) } type testUpgradeFromLatestSuite struct { @@ -140,7 +140,7 @@ func (s *testUpgradeFromLatestSuite) TestUpgradeFromLatest() { func TestUpgradeRollback(t *testing.T) { s := &testUpgradeRollbackSuite{} - run(t, s) + Run(t, s) } type testUpgradeRollbackSuite struct { @@ -186,7 +186,7 @@ func (s *testUpgradeRollbackSuite) TestUpgradeRollback() { // rolls back, that the ddprocmon service is not installed. func TestUpgradeRollbackWithoutCWS(t *testing.T) { s := &testUpgradeRollbackWithoutCWSSuite{} - run(t, s) + Run(t, s) } type testUpgradeRollbackWithoutCWSSuite struct { @@ -259,7 +259,7 @@ func (s *testUpgradeRollbackWithoutCWSSuite) TestUpgradeRollbackWithoutCWS() { func TestUpgradeChangeUser(t *testing.T) { s := &testUpgradeChangeUserSuite{} - run(t, s) + Run(t, s) } type testUpgradeChangeUserSuite struct { @@ -349,7 +349,7 @@ func TestUpgradeFromV5(t *testing.T) { } s.agent5Package.URL, err = windowsAgent.GetStableMSIURL(s.agent5Package.Version, "x86_64", "") require.NoError(t, err) - run(t, s) + Run(t, s) } type testUpgradeFromV5Suite struct { @@ -442,5 +442,5 @@ func TestUpgradeFromV6(t *testing.T) { } s.previousAgentPackge.URL, err = windowsAgent.GetStableMSIURL(s.previousAgentPackge.Version, s.previousAgentPackge.Arch, "") require.NoError(t, err) - run(t, s) + Run(t, s) }