-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Buildkite integration tests: Windows 2022 Sudo tests (#6010)
* [CI]Run Ubuntu x86 and ARM integration tests on buildkite * Updated the new pipeline * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * Test Windown 2022 in buildkite * test pre-command hook * Test windows flags * Fix pre-command * Newer win image * newer image * Newer win image * quotes * quotes * Debug gotestsum * Debug gotestsum * Debug gotestsum * Test PS5.1 * go test, no gotestsum * raw go test * pwsh * pwsh * Merged with main * gotestsum * gotestsum * gotestsum * Run with stack * Test all OS * Test all OS * Test all OS * Added gotestsum for testing purposes * added asdf install, newer artifacts * Cleanup * Cleanup * Removed build_id
- Loading branch information
Showing
8 changed files
with
133 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,2 @@ | ||
# Shorten BUILDKITE_MESSAGE if needed to avoid filling the Windows env var buffer | ||
$env:BUILDKITE_MESSAGE = $env:BUILDKITE_MESSAGE.Substring(0, [System.Math]::Min(2048, $env:BUILDKITE_MESSAGE.Length)) | ||
|
||
# Install gcc TODO: Move to the VM image | ||
choco install mingw | ||
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 | ||
refreshenv | ||
|
||
# Install gvm and go | ||
# TODO: Move GVM download to the base VM image | ||
$env:GvmVersion = "0.5.2" | ||
[Net.ServicePointManager]::SecurityProtocol = "tls12" | ||
$env:GoVersion = Get-Content -Path .go-version | ||
Invoke-WebRequest -URI https://github.com/andrewkroh/gvm/releases/download/v$env:GvmVersion/gvm-windows-amd64.exe -Outfile C:\Windows\System32\gvm.exe | ||
gvm --format=powershell $env:GoVersion | Invoke-Expression | ||
go version | ||
|
||
$GOPATH = $(go env GOPATH) | ||
$env:Path = "$GOPATH\bin;" + $env:Path | ||
$env:GOTMPDIR = "$GOPATH\tmp" | ||
New-Item -ItemType Directory -Force -Path $env:GOTMPDIR | ||
[Environment]::SetEnvironmentVariable("GOPATH", "$GOPATH", [EnvironmentVariableTarget]::Machine) | ||
[Environment]::SetEnvironmentVariable("GOTMPDIR", "$GOPATH\tmp", [EnvironmentVariableTarget]::Machine) | ||
[Environment]::SetEnvironmentVariable("Path", "$GOPATH\bin;$env:Path", [EnvironmentVariableTarget]::Machine) | ||
go env | ||
|
||
# Install tools | ||
go install github.com/magefile/mage | ||
go install github.com/elastic/go-licenser | ||
go install golang.org/x/tools/cmd/goimports | ||
go install github.com/jstemmer/go-junit-report | ||
go install gotest.tools/gotestsum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# # Install gcc TODO: Move to the VM image | ||
choco install mingw | ||
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 | ||
refreshenv | ||
|
||
# Install gvm and go | ||
# TODO: Move GVM download to the base VM image | ||
$env:GvmVersion = "0.5.2" | ||
[Net.ServicePointManager]::SecurityProtocol = "tls12" | ||
$env:GoVersion = Get-Content -Path .go-version | ||
Invoke-WebRequest -URI https://github.com/andrewkroh/gvm/releases/download/v$env:GvmVersion/gvm-windows-amd64.exe -Outfile C:\Windows\System32\gvm.exe | ||
gvm --format=powershell $env:GoVersion | Invoke-Expression | ||
go version | ||
|
||
$GOPATH = $(go env GOPATH) | ||
$env:Path = "$GOPATH\bin;" + $env:Path | ||
$env:GOTMPDIR = "$GOPATH\tmp" | ||
New-Item -ItemType Directory -Force -Path $env:GOTMPDIR | ||
[Environment]::SetEnvironmentVariable("GOPATH", "$GOPATH", [EnvironmentVariableTarget]::Machine) | ||
[Environment]::SetEnvironmentVariable("GOTMPDIR", "$GOPATH\tmp", [EnvironmentVariableTarget]::Machine) | ||
[Environment]::SetEnvironmentVariable("Path", "$GOPATH\bin;$env:Path", [EnvironmentVariableTarget]::Machine) | ||
go env | ||
|
||
Install tools | ||
go install github.com/magefile/mage | ||
go install github.com/elastic/go-licenser | ||
go install golang.org/x/tools/cmd/goimports | ||
go install github.com/jstemmer/go-junit-report | ||
go install gotest.tools/gotestsum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
param ( | ||
[string]$GROUP_NAME | ||
) | ||
|
||
Write-Output "~~~ Switching to PowerShell 7" | ||
pwsh | ||
$PSVersionTable.PSVersion | ||
|
||
# TODO: dedicated ESS strack for retries | ||
Write-Output "~~~ Receiving ESS stack metadata" | ||
$env:ELASTICSEARCH_HOST = (buildkite-agent meta-data get "es.host") | ||
$env:ELASTICSEARCH_USERNAME = (buildkite-agent meta-data get "es.username") | ||
$env:ELASTICSEARCH_PASSWORD = (buildkite-agent meta-data get "es.pwd") | ||
$env:KIBANA_HOST = (buildkite-agent meta-data get "kibana.host") | ||
$env:KIBANA_USERNAME = (buildkite-agent meta-data get "kibana.username") | ||
$env:KIBANA_PASSWORD = (buildkite-agent meta-data get "kibana.pwd") | ||
|
||
Write-Output "~~~ Running integration tests as $env:USERNAME" | ||
Write-Output "~~~ Integration tests: $GROUP_NAME" | ||
|
||
go install gotest.tools/gotestsum | ||
gotestsum --version | ||
|
||
# Read package version from .package-version file | ||
$PACKAGE_VERSION = Get-Content .package-version -ErrorAction SilentlyContinue | ||
if ($PACKAGE_VERSION) { | ||
$PACKAGE_VERSION = "${PACKAGE_VERSION}-SNAPSHOT" | ||
} | ||
|
||
echo "~~~ Building test binaries" | ||
mage build:testBinaries | ||
|
||
# Run integration tests with gotestsum | ||
echo "~~~ Running tests" | ||
$env:TEST_BINARY_NAME = "elastic-agent" | ||
$env:AGENT_VERSION = $PACKAGE_VERSION | ||
$env:SNAPSHOT = $true | ||
|
||
$ErrorActionPreference = 'Continue' | ||
|
||
gotestsum --no-color -f standard-quiet --junitfile "build/${GROUP_NAME}.integration.xml" --jsonfile "build/${GROUP_NAME}.integration.out.json" -- -tags=integration -shuffle=on -timeout=2h0m0s "github.com/elastic/elastic-agent/testing/integration" -v -args "-integration.groups=$GROUP_NAME" "-integration.sudo=true" | ||
$TESTS_EXIT_STATUS = $LASTEXITCODE | ||
$ErrorActionPreference = 'Stop' | ||
|
||
# Generate HTML report if XML output exists | ||
$outputXML = "build/${GROUP_NAME}.integration.xml" | ||
if (Test-Path $outputXML) { | ||
# Install junit2html if not installed | ||
go install github.com/alexec/junit2html@latest | ||
Get-Content $outputXML | junit2html > "build/TEST-report.html" | ||
} else { | ||
Write-Output "Cannot generate HTML test report: $outputXML not found" | ||
} | ||
|
||
exit $TESTS_EXIT_STATUS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
mage 1.14.0 | ||
golang 1.22.8 | ||
golang 1.22.9 | ||
terraform 1.9.3 |