diff --git a/.buildkite/bk.integration.pipeline.yml b/.buildkite/bk.integration.pipeline.yml index 8291961a76c..6f0aa1396f1 100644 --- a/.buildkite/bk.integration.pipeline.yml +++ b/.buildkite/bk.integration.pipeline.yml @@ -524,7 +524,7 @@ steps: limit: 1 agents: provider: "gcp" - machineType: "n2-standard-4" + machineType: "n2-standard-8" image: "${IMAGE_UBUNTU_2404_X86_64}" diskSizeGb: 80 plugins: diff --git a/.buildkite/integration.pipeline.yml b/.buildkite/integration.pipeline.yml index b889c66307a..288245ea164 100644 --- a/.buildkite/integration.pipeline.yml +++ b/.buildkite/integration.pipeline.yml @@ -70,7 +70,7 @@ steps: limit: 1 agents: provider: "aws" - instanceType: "c6g.4xlarge" + instanceType: "c6g.2xlarge" image: "${IMAGE_UBUNTU_2204_ARM_64}" - label: "Packaging: Ubuntu arm64 FIPS" @@ -87,7 +87,7 @@ steps: limit: 1 agents: provider: "aws" - instanceType: "c6g.4xlarge" + instanceType: "c6g.2xlarge" image: "${IMAGE_UBUNTU_2204_ARM_64}" - label: "Packaging: windows/amd64 zip" @@ -119,7 +119,7 @@ steps: limit: 1 agents: provider: "aws" - instanceType: "c6g.4xlarge" + instanceType: "c6g.2xlarge" image: "${IMAGE_UBUNTU_2204_ARM_64}" - label: "Packaging: Containers linux/amd64" @@ -186,16 +186,16 @@ steps: - build/distributions/** agents: provider: "aws" - instanceType: "c6g.4xlarge" + instanceType: "c6g.2xlarge" diskSizeGb: 200 image: "${IMAGE_UBUNTU_2204_ARM_64}" - label: "Triggering Integration tests" - depends_on: - - int-packaging +# depends_on: +# - int-packaging command: "buildkite-agent pipeline upload .buildkite/bk.integration.pipeline.yml" - label: "Triggering custom FIPS integration tests" - depends_on: - - int-packaging +# depends_on: +# - int-packaging command: "buildkite-agent pipeline upload .buildkite/bk.integration-fips.pipeline.yml" diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 1dafcfd851d..48fdf28d029 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -37,6 +37,7 @@ steps: agents: provider: "gcp" image: "${IMAGE_UBUNTU_2204_X86_64}" + machineType: "n2-highcpu-8" retry: automatic: limit: 1 @@ -56,6 +57,7 @@ steps: agents: provider: "gcp" image: "${IMAGE_UBUNTU_2204_X86_64}" + machineType: "n2-highcpu-8" retry: automatic: limit: 1 @@ -76,6 +78,7 @@ steps: agents: provider: "gcp" image: "${IMAGE_UBUNTU_2204_X86_64}" + machineType: "n2-highcpu-8" retry: automatic: limit: 1 @@ -112,7 +115,7 @@ steps: agents: provider: "gcp" image: "${IMAGE_WIN_2022}" - machine_type: "n2-standard-8" + machineType: "n2-standard-8" disk_size: 200 disk_type: "pd-ssd" retry: @@ -132,7 +135,7 @@ steps: agents: provider: "gcp" image: "${IMAGE_WIN_2016}" - machine_type: "n2-standard-8" + machineType: "n2-standard-8" disk_size: 200 disk_type: "pd-ssd" retry: @@ -192,7 +195,7 @@ steps: agents: provider: "gcp" image: "${IMAGE_WIN_10}" - machine_type: "n2-standard-8" + machineType: "n2-standard-8" disk_type: "pd-ssd" retry: automatic: @@ -211,7 +214,7 @@ steps: agents: provider: "gcp" image: "${IMAGE_WIN_11}" - machine_type: "n2-standard-8" + machineType: "n2-standard-8" disk_type: "pd-ssd" retry: automatic: diff --git a/.buildkite/scripts/buildkite-integration-tests.ps1 b/.buildkite/scripts/buildkite-integration-tests.ps1 index 45f526125eb..0fada7fa16f 100644 --- a/.buildkite/scripts/buildkite-integration-tests.ps1 +++ b/.buildkite/scripts/buildkite-integration-tests.ps1 @@ -70,7 +70,12 @@ try # This 2-hour timeout provides enough room for future, potentially longer tests, # while still enforcing a reasonable upper limit on total execution time. # See: https://pkg.go.dev/cmd/go#hdr-Testing_flags - $gotestArgs = @("-tags=integration", "-test.shuffle=on", "-test.timeout=2h0m0s", "$env:TEST_PACKAGE", "-v", "-args", "-integration.groups=$GROUP_NAME", "-integration.sudo=$TEST_SUDO") + $gotestFlags = @("-test.shuffle=on", "-test.timeout=2h0m0s") + if(-not ([string]::IsNullOrEmpty($env:BUILDKITE_PULL_REQUEST))) + { + $gotestFlags += "-test.short" + } + $gotestArgs = @("-tags=integration", ${gotestFlags}, "$env:TEST_PACKAGE", "-v", "-args", "-integration.groups=$GROUP_NAME", "-integration.sudo=$TEST_SUDO") & gotestsum --no-color -f standard-quiet --junitfile-hide-skipped-tests --junitfile "${outputXML}" --jsonfile "${outputJSON}" -- @gotestArgs $TestsExitCode = $LASTEXITCODE diff --git a/.buildkite/scripts/buildkite-integration-tests.sh b/.buildkite/scripts/buildkite-integration-tests.sh index 2f669230df6..345615fcc0a 100755 --- a/.buildkite/scripts/buildkite-integration-tests.sh +++ b/.buildkite/scripts/buildkite-integration-tests.sh @@ -66,7 +66,12 @@ echo "~~~ Integration tests: ${GROUP_NAME}" # This 2-hour timeout provides enough room for future, potentially longer tests, # while still enforcing a reasonable upper limit on total execution time. # See: https://pkg.go.dev/cmd/go#hdr-Testing_flags -GOTEST_ARGS=(-tags integration -test.shuffle on -test.timeout 2h0m0s "${TEST_PACKAGE}" -v -args "-integration.groups=${GROUP_NAME}" "-integration.sudo=${TEST_SUDO}" "-integration.fips=${FIPS:-false}") + +GOTEST_OPTS="-test.shuffle on -test.timeout 2h0m0s" +if [[ "${BUILDKITE_PULL_REQUEST:="false"}" != "false" ]]; then + GOTEST_OPTS="${GOTEST_OPTS} -test.short" +fi +GOTEST_ARGS=(-tags integration ${GOTEST_OPTS} "${TEST_PACKAGE}" -v -args "-integration.groups=${GROUP_NAME}" "-integration.sudo=${TEST_SUDO}" "-integration.fips=${FIPS:-false}") set +e TEST_BINARY_NAME="elastic-agent" AGENT_VERSION="${AGENT_VERSION}" SNAPSHOT=true \ gotestsum --no-color -f standard-quiet --junitfile-hide-skipped-tests --junitfile "${outputXML}" --jsonfile "${outputJSON}" -- "${GOTEST_ARGS[@]}" diff --git a/.buildkite/scripts/buildkite-k8s-integration-tests.sh b/.buildkite/scripts/buildkite-k8s-integration-tests.sh index 84c4c06d650..3fd4f714bda 100755 --- a/.buildkite/scripts/buildkite-k8s-integration-tests.sh +++ b/.buildkite/scripts/buildkite-k8s-integration-tests.sh @@ -44,14 +44,19 @@ EOF IFS=',' read -r -a docker_variants <<< "${DOCKER_VARIANTS}" -echo "~~~ Building k8s inner tests binary" -GOOS=linux GOARCH="${TARGET_ARCH}" CGO_ENABLED=0 go test -tags 'kubernetes_inner' -c -o ./testsBinary ./testing/kubernetes_inner/... -chmod +x ./testsBinary +#echo "~~~ Building k8s inner tests binary" +#GOOS=linux GOARCH="${TARGET_ARCH}" CGO_ENABLED=0 go test -tags 'kubernetes_inner' -c -o ./testsBinary ./testing/kubernetes_inner/... +#chmod +x ./testsBinary export TEST_DEFINE_PREFIX="${CLUSTER_NAME}" make install-gotestsum +GOTEST_OPTS="-test.shuffle on -test.timeout 2h0m0s" +if [[ "${BUILDKITE_PULL_REQUEST:="false"}" != "false" ]]; then + GOTEST_OPTS="${GOTEST_OPTS} -test.short" +fi + TESTS_EXIT_STATUS=0 for variant in "${docker_variants[@]}"; do echo "~~~ k8s Integration tests for variant: ${variant}" @@ -88,12 +93,12 @@ for variant in "${docker_variants[@]}"; do # read image name from manifest image=$(tar -Oxf "${image_archive_path}" manifest.json | jq -r '.[0].RepoTags[0]') - # embed k8s inner tests binary and build again the same image - echo "Embedding k8s inner tests binary into ${image}" - BUILDKIT_PROGRESS=plain docker build --tag "${image}" . -f - <