Skip to content

Commit

Permalink
[CI] Buildkite integration tests: Run integration tests on ARM (#5956)
Browse files Browse the repository at this point in the history
* [CI]Run Ubuntu x86 and ARM integration tests on buildkite

* Updated the new pipeline

* Applied review changes
  • Loading branch information
pazone authored Nov 11, 2024
1 parent f994f5b commit c01636e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 106 deletions.
122 changes: 26 additions & 96 deletions .buildkite/bk.integration.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,115 +38,45 @@ steps:
- package-it
- integration-ess
steps:
- label: "Default"
key: stateful-ubuntu-default-sudo
- label: "x86_64:Group: {{matrix}}"
command: |
buildkite-agent artifact download build/distributions/** . --step 'package-it'
.buildkite/scripts/steps/integration_tests_tf_sudo.sh "default" "^(TestAPMConfig|TestDiagnosticsOptionalValues|TestIsolatedUnitsDiagnosticsOptionalValues|TestDiagnosticsCommand|TestIsolatedUnitsDiagnosticsCommand|TestEventLogFile|TestFakeComponent|TestFakeIsolatedUnitsComponent|TestOtelFileProcessing|TestOtelLogsIngestion|TestOtelAPMIngestion|TestPackageVersion)$$"
.buildkite/scripts/steps/integration_tests_tf_sudo.sh {{matrix}}
artifact_paths:
- build/**
agents:
provider: "gcp"
imageProject: elastic-images-qa
machineType: "n1-standard-8"
image: "family/platform-ingest-elastic-agent-ubuntu-2204"
image: "family/platform-ingest-elastic-agent-ubuntu-2404"
matrix:
- default
- upgrade
- fleet
- fqdn
- deb
- fleet-airgapped
- fleet-privileged
- fleet-airgapped-privileged

- label: "Upgrade"
key: stateful-ubuntu-upgrade-sudo
- label: "arm:Group:{{matrix}}"
command: |
buildkite-agent artifact download build/distributions/** . --step 'package-it'
.buildkite/scripts/steps/integration_tests_tf_sudo.sh "upgrade" "^(TestUpgradeBrokenPackageVersion|TestStandaloneUpgradeWithGPGFallback|TestStandaloneUpgradeWithGPGFallbackOneRemoteFailing|TestStandaloneUpgradeRollback|TestStandaloneUpgradeRollbackOnRestarts|TestStandaloneUpgradeFailsWhenUpgradeIsInProgress|TestStandaloneUpgradeRetryDownload|TestStandaloneUpgradeSameCommit|TestStandaloneUpgrade|TestStandaloneUpgradeUninstallKillWatcher)$$"
.buildkite/scripts/steps/integration_tests_tf_sudo.sh {{matrix}}
artifact_paths:
- build/**
agents:
provider: "gcp"
imageProject: elastic-images-qa
machineType: "n1-standard-8"
image: "family/platform-ingest-elastic-agent-ubuntu-2204"

- label: "Fleet"
key: stateful-ubuntu-fleet-sudo
command: |
buildkite-agent artifact download build/distributions/** . --step 'package-it'
ls -lah build/distributions/
.buildkite/scripts/steps/integration_tests_tf_sudo.sh "fleet" "^(TestLongRunningAgentForLeaks|TestDelayEnroll|TestDelayEnrollUnprivileged|TestInstallAndCLIUninstallWithEndpointSecurity|TestInstallAndUnenrollWithEndpointSecurity|TestInstallWithEndpointSecurityAndRemoveEndpointIntegration|TestEndpointSecurityNonDefaultBasePath|TestEndpointSecurityUnprivileged|TestEndpointSecurityCannotSwitchToUnprivileged|TestEndpointLogsAreCollectedInDiagnostics|TestForceInstallOverProtectedPolicy|TestSetLogLevelFleetManaged|TestLogIngestionFleetManaged|TestMetricsMonitoringCorrectBinaries|TestEndpointAgentServiceMonitoring|TestMonitoringPreserveTextConfig|TestMonitoringLivenessReloadable|TestComponentBuildHashInDiagnostics|TestProxyURL|TestFleetManagedUpgradeUnprivileged)$$"
artifact_paths:
- build/**
agents:
provider: "gcp"
imageProject: elastic-images-qa
machineType: "n1-standard-8"
image: "family/platform-ingest-elastic-agent-ubuntu-2204"

- label: "FQDN"
key: stateful-ubuntu-fqdn-sudo
command: |
buildkite-agent artifact download build/distributions/** . --step 'package-it'
ls -lah build/distributions/
.buildkite/scripts/steps/integration_tests_tf_sudo.sh "fqdn" "^(TestFQDN)$$"
artifact_paths:
- build/**
agents:
provider: "gcp"
imageProject: elastic-images-qa
machineType: "n1-standard-8"
image: "family/platform-ingest-elastic-agent-ubuntu-2204"

- label: "Deb"
key: stateful-ubuntu-deb-sudo
command: |
buildkite-agent artifact download build/distributions/** . --step 'package-it'
ls -lah build/distributions/
.buildkite/scripts/steps/integration_tests_tf_sudo.sh "deb" "^(TestDebLogIngestFleetManaged|TestDebFleetUpgrade)$$"
artifact_paths:
- build/**
agents:
provider: "gcp"
imageProject: elastic-images-qa
machineType: "n1-standard-8"
image: "family/platform-ingest-elastic-agent-ubuntu-2204"

- label: "Fleet Airgapped"
key: stateful-ubuntu-fleet-airgapped-sudo
command: |
buildkite-agent artifact download build/distributions/** . --step 'package-it'
ls -lah build/distributions/
.buildkite/scripts/steps/integration_tests_tf_sudo.sh "fleet-airgapped" "^(TestFleetAirGappedUpgradeUnprivileged)$$"
artifact_paths:
- build/**
agents:
provider: "gcp"
imageProject: elastic-images-qa
machineType: "n1-standard-8"
image: "family/platform-ingest-elastic-agent-ubuntu-2204"

- label: "Fleet Privileged"
key: stateful-ubuntu-fleet-privileged-sudo
command: |
buildkite-agent artifact download build/distributions/** . --step 'package-it'
ls -lah build/distributions/
.buildkite/scripts/steps/integration_tests_tf_sudo.sh "fleet-privileged" "^(TestInstallFleetServerBootstrap|TestFleetManagedUpgradePrivileged)$$"
artifact_paths:
- build/**
agents:
provider: "gcp"
imageProject: elastic-images-qa
machineType: "n1-standard-8"
image: "family/platform-ingest-elastic-agent-ubuntu-2204"

- label: "Fleet Airgapped Privileged"
key: stateful-ubuntu-fleet-airgapped-privileged-sudo
command: |
buildkite-agent artifact download build/distributions/** . --step 'package-it'
ls -lah build/distributions/
.buildkite/scripts/steps/integration_tests_tf_sudo.sh "fleet-airgapped-privileged" "^(TestFleetAirGappedUpgradePrivileged)$$"
artifact_paths:
- build/**
agents:
provider: "gcp"
imageProject: elastic-images-qa
machineType: "n1-standard-8"
image: "family/platform-ingest-elastic-agent-ubuntu-2204"
provider: "aws"
imagePrefix: "platform-ingest-beats-ubuntu-2404-aarch64"
instanceType: "m6g.xlarge"
matrix:
- default
- upgrade
- fleet
- fqdn
- deb
- fleet-airgapped
- fleet-privileged
- fleet-airgapped-privileged

- label: ESS stack cleanup
depends_on: integration-tests
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/ess_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source .buildkite/scripts/steps/ess.sh
OVERRIDE_STACK_VERSION="$(cat .package-version)"
OVERRIDE_STACK_VERSION=${OVERRIDE_STACK_VERSION}"-SNAPSHOT"

ess_up $OVERRIDE_STACK_VERSION || echo "Failed to start ESS stack" >&2
ess_up $OVERRIDE_STACK_VERSION

echo "ES_HOST: ${ELASTICSEARCH_HOST}"
buildkite-agent meta-data set "es.host" $ELASTICSEARCH_HOST
Expand Down
7 changes: 1 addition & 6 deletions .buildkite/scripts/steps/integration_tests_tf_sudo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ source .buildkite/scripts/steps/ess.sh

GROUP_NAME=$1
if [ -z "$GROUP_NAME" ]; then
echo "Error: Specify the group name: sudo-integration-tests.sh [group_name] [tests_to_run]" >&2
exit 1
fi
TESTS_TO_RUN=$2
if [ -z "$TESTS_TO_RUN" ]; then
echo "Error: Specify the tests to run: sudo-integration-tests.sh [group_name] [tests_to_run]" >&2
echo "Error: Specify the group name: sudo-integration-tests.sh [group_name]" >&2
exit 1
fi

Expand Down
3 changes: 1 addition & 2 deletions .buildkite/scripts/sudo-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source /opt/buildkite-agent/hooks/pre-command
source .buildkite/hooks/pre-command || echo "No pre-command hook found"

GROUP_NAME=$1
TESTS_TO_RUN=$2

echo "~~~ Running integration tests as $USER"
echo "~~~ Integration tests: ${GROUP_NAME}"
Expand All @@ -15,7 +14,7 @@ if [[ -n "$PACKAGE_VERSION" ]]; then
PACKAGE_VERSION=${PACKAGE_VERSION}"-SNAPSHOT"
fi
set +e
AGENT_VERSION="${PACKAGE_VERSION}" SNAPSHOT=true TEST_DEFINE_PREFIX="sudo_${GROUP_NAME}_ubuntu" gotestsum --no-color -f standard-quiet --junitfile "build/${GROUP_NAME}.integration.xml" --jsonfile "build/${GROUP_NAME}.integration.out.json" -- -tags integration -test.shuffle on -test.timeout 2h0m0s -test.run "${TESTS_TO_RUN}" github.com/elastic/elastic-agent/testing/integration
TEST_BINARY_NAME="elastic-agent" AGENT_VERSION="${PACKAGE_VERSION}" SNAPSHOT=true gotestsum --no-color -f standard-quiet --junitfile "build/${GROUP_NAME}.integration.xml" --jsonfile "build/${GROUP_NAME}.integration.out.json" -- -tags integration -test.shuffle on -test.timeout 2h0m0s github.com/elastic/elastic-agent/testing/integration -v -args -integration.groups="${GROUP_NAME}" -integration.sudo=true
TESTS_EXIT_STATUS=$?
set -e

Expand Down
2 changes: 1 addition & 1 deletion test_infra/ess/deployment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ locals {
deployment_version = data.ec_stack.latest.version

ess_region = coalesce(var.ess_region, "gcp-us-east1")
deployment_template_id = coalesce(var.deployment_template_id, "gcp-cpu-optimized-v7")
deployment_template_id = coalesce(var.deployment_template_id, "gcp-cpu-optimized")
}

# If we have defined a stack version, validate that this version exists on that region and return it.
Expand Down

0 comments on commit c01636e

Please sign in to comment.