Documentation
¶
Overview ¶
Package installer contains code for the E2E tests for the Datadog installer on Windows
Package installer contains code for the E2E tests for the Datadog installer on Windows
Index ¶
- type BaseSuite
- func (s *BaseSuite) AssertSuccessfulAgentPromoteExperiment(version string)
- func (s *BaseSuite) AssertSuccessfulAgentStartExperiment(version string)
- func (s *BaseSuite) BeforeTest(suiteName, testName string)
- func (s *BaseSuite) CurrentAgentVersion() *agentVersion.Version
- func (s *BaseSuite) InstallScript() *DatadogInstallScript
- func (s *BaseSuite) Installer() *DatadogInstaller
- func (s *BaseSuite) MustStartExperimentCurrentVersion()
- func (s *BaseSuite) MustStartExperimentPreviousVersion()
- func (s *BaseSuite) Require() *suiteasserts.SuiteAssertions
- func (s *BaseSuite) SetupSuite()
- func (s *BaseSuite) StableAgentVersion() PackageVersion
- func (s *BaseSuite) StartExperimentCurrentVersion() (string, error)
- func (s *BaseSuite) WaitForInstallerService(state string) error
- type Catalog
- type DatadogInstallScript
- type DatadogInstaller
- func (d *DatadogInstaller) GarbageCollect() (string, error)
- func (d *DatadogInstaller) Install(opts ...MsiOption) error
- func (d *DatadogInstaller) InstallExperiment(packageName string, opts ...installer.PackageOption) (string, error)
- func (d *DatadogInstaller) InstallPackage(packageName string, opts ...installer.PackageOption) (string, error)
- func (d *DatadogInstaller) PromoteExperiment(packageName string) (string, error)
- func (d *DatadogInstaller) Purge() (string, error)
- func (d *DatadogInstaller) RemoveExperiment(packageName string) (string, error)
- func (d *DatadogInstaller) RemovePackage(packageName string) (string, error)
- func (d *DatadogInstaller) SetCatalog(newCatalog Catalog) (string, error)
- func (d *DatadogInstaller) StartExperiment(packageName string, packageVersion string) (string, error)
- func (d *DatadogInstaller) StartInstallerExperiment(packageName string, packageVersion string) (string, error)
- func (d *DatadogInstaller) Status() (string, error)
- func (d *DatadogInstaller) StopExperiment(packageName string) (string, error)
- func (d *DatadogInstaller) Uninstall(opts ...MsiOption) error
- func (d *DatadogInstaller) Version() (string, error)
- type MsiOption
- type MsiParams
- type Option
- func WithAgentUser(user string) Option
- func WithExtraEnvVars(envVars map[string]string) Option
- func WithInstallerScript(installerScript string) Option
- func WithInstallerURL(installerURL string) Option
- func WithURLFromInstallersJSON(jsonURL, version string) Option
- func WithURLFromPipeline(pipelineID string) Option
- type PackageEntry
- type PackageOption
- func WithAlias(alias string) PackageOption
- func WithAuthentication(auth string) PackageOption
- func WithDevEnvOverrides(prefix string) PackageOption
- func WithName(name string) PackageOption
- func WithPipeline(pipeline string) PackageOption
- func WithRegistry(registryURL string) PackageOption
- func WithURLOverride(url string) PackageOption
- func WithVersion(version string) PackageOption
- type PackageVersion
- type Params
- type TestPackageConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseSuite ¶ added in v0.64.0
type BaseSuite struct {
e2e.BaseSuite[environments.WindowsHost]
// contains filtered or unexported fields
}
BaseSuite the base suite for all installer tests on Windows (install script, MSI, exe etc...). To run the test suites locally, pick a pipeline and define the following environment variables: E2E_PIPELINE_ID: the ID of the pipeline CURRENT_AGENT_VERSION: pull it from one of the jobs that builds the Agent STABLE_INSTALLER_VERSION_PACKAGE: use `crane ls public.ecr.aws/datadog/installer-package | sort | tail -n 2 | head -n 1` STABLE_AGENT_VERSION_PACKAGE: use `crane ls public.ecr.aws/datadog/agent-package | sort | tail -n 2 | head -n 1` or pick any other version from that registry.
For example:
CI_COMMIT_SHA=ac2acaffab7b039f8c2524df8ae82f9f5fd04d5d; E2E_PIPELINE_ID=40537701; CURRENT_AGENT_VERSION=7.57.0-devel+git.370.d429ae3; STABLE_INSTALLER_VERSION_PACKAGE=7.56.0-installer-0.4.6-1-1 STABLE_AGENT_VERSION_PACKAGE=7.55.2-1
func (*BaseSuite) AssertSuccessfulAgentPromoteExperiment ¶ added in v0.65.0
AssertSuccessfulAgentPromoteExperiment that experiment was promoted successfully
func (*BaseSuite) AssertSuccessfulAgentStartExperiment ¶ added in v0.65.0
AssertSuccessfulAgentStartExperiment that experiment started successfully
func (*BaseSuite) BeforeTest ¶ added in v0.64.0
BeforeTest creates a new Datadog Installer and sets the output logs directory for each tests
func (*BaseSuite) CurrentAgentVersion ¶ added in v0.64.0
func (s *BaseSuite) CurrentAgentVersion() *agentVersion.Version
CurrentAgentVersion the version of the Agent in the current pipeline
func (*BaseSuite) InstallScript ¶ added in v0.64.0
func (s *BaseSuite) InstallScript() *DatadogInstallScript
InstallScript The Datadog Install script for testing.
func (*BaseSuite) Installer ¶ added in v0.64.0
func (s *BaseSuite) Installer() *DatadogInstaller
Installer The Datadog Installer for testing.
func (*BaseSuite) MustStartExperimentCurrentVersion ¶ added in v0.65.0
func (s *BaseSuite) MustStartExperimentCurrentVersion()
MustStartExperimentCurrentVersion start an experiment with current version of the Agent
func (*BaseSuite) MustStartExperimentPreviousVersion ¶ added in v0.65.0
func (s *BaseSuite) MustStartExperimentPreviousVersion()
MustStartExperimentPreviousVersion starts an experiment with the previous version of the Agent
func (*BaseSuite) Require ¶ added in v0.64.0
func (s *BaseSuite) Require() *suiteasserts.SuiteAssertions
Require instantiates a suiteAssertions for the current suite. This allows writing assertions in a "natural" way, i.e.:
suite.Require().HasAService(...).WithUserSid(...)
Ideally this suite assertion would exist at a higher level of abstraction so that it could be shared by multiple suites, but for now it exists only on the Windows Datadog installer `BaseSuite` object.
func (*BaseSuite) SetupSuite ¶ added in v0.64.0
func (s *BaseSuite) SetupSuite()
SetupSuite checks that the environment variables are correctly setup for the test
func (*BaseSuite) StableAgentVersion ¶ added in v0.64.0
func (s *BaseSuite) StableAgentVersion() PackageVersion
StableAgentVersion the version of the last published stable agent
func (*BaseSuite) StartExperimentCurrentVersion ¶ added in v0.65.0
StartExperimentCurrentVersion starts an experiment of current agent version
func (*BaseSuite) WaitForInstallerService ¶ added in v0.65.0
WaitForInstallerService waits for installer service to be expected state
type Catalog ¶ added in v0.65.0
type Catalog struct {
Packages []PackageEntry `json:"packages"`
}
Catalog is a struct to represent a catalog of packages, used with the set-catalog subcommand
type DatadogInstallScript ¶ added in v0.64.0
type DatadogInstallScript struct {
// contains filtered or unexported fields
}
DatadogInstallScript represents an interface to the Datadog Install script on the remote host.
func NewDatadogInstallScript ¶ added in v0.64.0
func NewDatadogInstallScript(env *environments.WindowsHost) *DatadogInstallScript
NewDatadogInstallScript instantiates a new instance of the Datadog Install Script running on a remote Windows host.
type DatadogInstaller ¶
type DatadogInstaller struct {
// contains filtered or unexported fields
}
DatadogInstaller represents an interface to the Datadog Installer on the remote host.
func NewDatadogInstaller ¶
func NewDatadogInstaller(env *environments.WindowsHost, outputDir string) *DatadogInstaller
NewDatadogInstaller instantiates a new instance of the Datadog Installer running on a remote Windows host.
func (*DatadogInstaller) GarbageCollect ¶ added in v0.65.0
func (d *DatadogInstaller) GarbageCollect() (string, error)
GarbageCollect runs the garbage-collect command, removing unused packages
func (*DatadogInstaller) Install ¶
func (d *DatadogInstaller) Install(opts ...MsiOption) error
Install will attempt to install the Datadog Agent on the remote host. By default, it will use the installer from the current pipeline.
func (*DatadogInstaller) InstallExperiment ¶
func (d *DatadogInstaller) InstallExperiment(packageName string, opts ...installer.PackageOption) (string, error)
InstallExperiment will attempt to use the Datadog Installer to start an experiment for the package given in parameter.
func (*DatadogInstaller) InstallPackage ¶
func (d *DatadogInstaller) InstallPackage(packageName string, opts ...installer.PackageOption) (string, error)
InstallPackage will attempt to use the Datadog Installer to install the package given in parameter. version: A function that returns the version of the package to install. By default, it will install the package matching the current pipeline. This is a function so that it can be combined with Note that this command is a direct command and won't go through the Daemon.
func (*DatadogInstaller) PromoteExperiment ¶ added in v0.65.0
func (d *DatadogInstaller) PromoteExperiment(packageName string) (string, error)
PromoteExperiment will use the Datadog Installer service to promote an experiment
func (*DatadogInstaller) Purge ¶ added in v0.61.0
func (d *DatadogInstaller) Purge() (string, error)
Purge runs the purge command, removing all packages
func (*DatadogInstaller) RemoveExperiment ¶
func (d *DatadogInstaller) RemoveExperiment(packageName string) (string, error)
RemoveExperiment requests that the Datadog Installer removes a package on the remote host.
func (*DatadogInstaller) RemovePackage ¶
func (d *DatadogInstaller) RemovePackage(packageName string) (string, error)
RemovePackage requests that the Datadog Installer removes a package on the remote host.
func (*DatadogInstaller) SetCatalog ¶ added in v0.65.0
func (d *DatadogInstaller) SetCatalog(newCatalog Catalog) (string, error)
SetCatalog configures the catalog for the Datadog Installer daemon
func (*DatadogInstaller) StartExperiment ¶ added in v0.65.0
func (d *DatadogInstaller) StartExperiment(packageName string, packageVersion string) (string, error)
StartExperiment will use the Datadog Installer service to start an experiment
func (*DatadogInstaller) StartInstallerExperiment ¶ added in v0.65.0
func (d *DatadogInstaller) StartInstallerExperiment(packageName string, packageVersion string) (string, error)
StartInstallerExperiment will use the Datadog Installer service to start an experiment
func (*DatadogInstaller) Status ¶ added in v0.60.0
func (d *DatadogInstaller) Status() (string, error)
Status returns the status provided by the running daemon
func (*DatadogInstaller) StopExperiment ¶ added in v0.65.0
func (d *DatadogInstaller) StopExperiment(packageName string) (string, error)
StopExperiment will use the Datadog Installer service to stop an experiment
func (*DatadogInstaller) Uninstall ¶
func (d *DatadogInstaller) Uninstall(opts ...MsiOption) error
Uninstall will attempt to uninstall the Datadog Agent on the remote host.
func (*DatadogInstaller) Version ¶
func (d *DatadogInstaller) Version() (string, error)
Version returns the version of the Datadog Installer on the host.
type MsiOption ¶ added in v0.64.0
MsiOption is an optional function parameter type for the Datadog Installer Install command
func CreateInstallerFolders ¶ added in v0.64.0
CreateInstallerFolders Specifies whether to create some folders that are necessary for the Datadog Installer. Those folders are normally created when using the install script / bootstrapper, but are not when installing the Datadog Installer MSI directly.
func WithMSIArg ¶
WithMSIArg uses a specific URL for the Datadog Installer Install command instead of using the pipeline URL.
func WithMSIDevEnvOverrides ¶ added in v0.65.0
WithMSIDevEnvOverrides applies overrides to the MSI source config based on environment variables.
Example: local MSI package file
export CURRENT_AGENT_MSI_URL="file:///path/to/msi/package.msi"
Example: from a different pipeline
export CURRENT_AGENT_MSI_PIPELINE="123456"
Example: stable version from installers_v2.json
export CURRENT_AGENT_MSI_VERSION=7.60.0-1"
Example: custom URL
export CURRENT_AGENT_MSI_URL="https://s3.amazonaws.com/dd-agent-mstesting/builds/beta/ddagent-cli-7.64.0-rc.9.msi"
func WithMSILogFile ¶ added in v0.58.0
WithMSILogFile sets the filename for the MSI log file, to be stored in the output directory.
func WithOption ¶ added in v0.64.0
WithOption converts an Option to an MsiOption (downcast) allowing to use the base Option methods on with a func that accepts MsiOptions
type MsiParams ¶ added in v0.64.0
type MsiParams struct {
Params
// contains filtered or unexported fields
}
MsiParams contains the optional parameters for the Datadog Installer Install command
type Option ¶
Option is an optional function parameter type for the Params
func WithAgentUser ¶ added in v0.65.0
WithAgentUser sets the user to install the agent as
func WithExtraEnvVars ¶ added in v0.64.0
WithExtraEnvVars specifies additional environment variables.
func WithInstallerScript ¶ added in v0.65.0
WithInstallerScript uses a specific URL for the Datadog Installer script command instead of using the pipeline script.
func WithInstallerURL ¶
WithInstallerURL uses a specific URL for the Datadog Installer Install command instead of using the pipeline URL.
func WithURLFromInstallersJSON ¶ added in v0.65.0
WithURLFromInstallersJSON uses a specific URL for the Datadog Installer from an installers_v2.json file. jsonURL: The URL of the installers_v2.json file, i.e. pipeline.StableURL version: The artifact version to retrieve, i.e. "7.56.0-installer-0.4.5-1"
Example: WithInstallerURLFromInstallersJSON(pipeline.StableURL, "7.56.0-installer-0.4.5-1") will look into "https://s3.amazonaws.com/ddagent-windows-stable/stable/installers_v2.json" for the Datadog Installer version "7.56.0-installer-0.4.5-1"
func WithURLFromPipeline ¶ added in v0.65.0
WithURLFromPipeline uses the Datadog Installer MSI from a pipeline artifact.
type PackageEntry ¶ added in v0.65.0
type PackageEntry struct {
Package string `json:"package"`
Version string `json:"version"`
URL string `json:"url"`
}
PackageEntry is a struct to represent a package entry in the catalog
type PackageOption ¶ added in v0.65.0
type PackageOption func(*TestPackageConfig) error
PackageOption is an optional function parameter type for the Datadog Installer
func WithAlias ¶ added in v0.65.0
func WithAlias(alias string) PackageOption
WithAlias specifies the package's alias.
func WithAuthentication ¶ added in v0.65.0
func WithAuthentication(auth string) PackageOption
WithAuthentication uses a specific authentication for a Registry to install the package.
func WithDevEnvOverrides ¶ added in v0.65.0
func WithDevEnvOverrides(prefix string) PackageOption
WithDevEnvOverrides applies overrides to the package config based on environment variables.
Example: local OCI package file
export CURRENT_AGENT_OCI_URL="file:///path/to/oci/package.tar"
Example: from a different pipeline
export CURRENT_AGENT_OCI_PIPELINE="123456"
Example: from a different pipeline (assumes that the package being overridden is already from a pipeline)
export CURRENT_AGENT_OCI_VERSION="pipeline-123456"
Example: custom URL
export CURRENT_AGENT_OCI_URL="oci://installtesting.datad0g.com/agent-package:pipeline-123456"
func WithName ¶ added in v0.65.0
func WithName(name string) PackageOption
WithName uses a specific name for the package.
func WithPipeline ¶ added in v0.65.0
func WithPipeline(pipeline string) PackageOption
WithPipeline configures the package to be installed from a pipeline.
func WithRegistry ¶ added in v0.65.0
func WithRegistry(registryURL string) PackageOption
WithRegistry uses a specific Registry from where to install the package.
func WithURLOverride ¶ added in v0.65.0
func WithURLOverride(url string) PackageOption
WithURLOverride specifies the package's URL.
func WithVersion ¶ added in v0.65.0
func WithVersion(version string) PackageOption
WithVersion uses a specific version of the package.
type PackageVersion ¶
type PackageVersion struct {
// contains filtered or unexported fields
}
PackageVersion is a helper type to store both the version and the package version of a binary. The package version has the "-1" suffix, whereas the binary's "version" command does not contain the "-1" suffix.
func NewVersionFromPackageVersion ¶ added in v0.65.0
func NewVersionFromPackageVersion(packageVersion string) PackageVersion
NewVersionFromPackageVersion creates a new PackageVersion from a package version string
func (PackageVersion) PackageVersion ¶
func (v PackageVersion) PackageVersion() string
PackageVersion the version with the package suffix
func (PackageVersion) Version ¶
func (v PackageVersion) Version() string
Version the version without the package suffix
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
Params contains the optional parameters for the Datadog Install Script command
type TestPackageConfig ¶ added in v0.65.0
type TestPackageConfig struct {
// Name the name of the package
Name string
// Alias Sometimes the package is named differently in some registries
Alias string
// Version the version to install
Version string
// Registry the URL of the registry
Registry string
// Auth the authentication method, "" for no authentication
Auth string
// contains filtered or unexported fields
}
TestPackageConfig is a struct that regroups the fields necessary to install a package from an OCI Registry
func CreatePackageSourceIfLocal ¶ added in v0.65.0
func CreatePackageSourceIfLocal(host *components.RemoteHost, pkg TestPackageConfig) (TestPackageConfig, error)
CreatePackageSourceIfLocal will create a package on the remote host if the URL is a local file. This is useful for development to test local packages.
func NewPackageConfig ¶ added in v0.65.0
func NewPackageConfig(opts ...PackageOption) (TestPackageConfig, error)
NewPackageConfig is a struct that regroups the fields necessary to install a package from an OCI Registry
func (TestPackageConfig) URL ¶ added in v0.65.0
func (c TestPackageConfig) URL() string
URL returns the OCI URL of the package
It may begin with `file://` if the package is local.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package consts list the common packages paths used in the Datadog Installer tests.
|
Package consts list the common packages paths used in the Datadog Installer tests. |
|
Package assertions provide custom assertions for Windows tests
|
Package assertions provide custom assertions for Windows tests |
|
Package suiteasserts extends require.Assertions with custom assertions
|
Package suiteasserts extends require.Assertions with custom assertions |
|
suites
|
|
|
apm-library-dotnet-package
Package dotnettests contains the E2E tests for the .NET APM Library package.
|
Package dotnettests contains the E2E tests for the .NET APM Library package. |