Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .buildkite/scripts/common_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Forcing to checkout again all the files with a correct autocrlf.
# Doing this here because we cannot set git clone options before.
function fixCRLF {
Write-Host "-- Fixing CRLF in git checkout --"
git config core.autocrlf input
git rm --quiet --cached -r .
git reset --quiet --hard
}

function ensureBinPath {
$workDir = if ($env:WORKSPACE) { $env:WORKSPACE } else { $PWD.Path }
$binDir = Join-Path $workDir "bin"
if (-not (Test-Path $binDir)) { New-Item -ItemType Directory -Path $binDir | Out-Null }
$env:PATH = "$binDir;$env:PATH"
return $binDir
}

function withGolang($version) {
Write-Host "--- Install golang (GVM)"
$binDir = ensureBinPath
$gvmExe = Join-Path $binDir "gvm-windows-amd64.exe"
$gvmUrl = "https://github.com/andrewkroh/gvm/releases/download/$env:SETUP_GVM_VERSION/gvm-windows-amd64.exe"

Write-Host "Installing GVM tool"
$maxTries = 5
for ($i = 1; $i -le $maxTries; $i++) {
try {
Invoke-WebRequest -Uri $gvmUrl -OutFile $gvmExe -UseBasicParsing
break
} catch {
if ($i -eq $maxTries) { throw }
Start-Sleep -Seconds 3
}
}

Write-Host "Installing Go version $version"
& $gvmExe --format=powershell $version | Invoke-Expression
$env:PATH = "$(go env GOPATH)\bin;$env:PATH"
go version
go env
}
20 changes: 1 addition & 19 deletions .buildkite/scripts/stack_tests_windows.ps1
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
$ErrorActionPreference = "Stop" # set -e

# Forcing to checkout again all the files with a correct autocrlf.
# Doing this here because we cannot set git clone options before.
function fixCRLF {
Write-Host "-- Fixing CRLF in git checkout --"
git config core.autocrlf input
git rm --quiet --cached -r .
git reset --quiet --hard
}

function withGolang($version) {
# Avoid conflicts with previous installations.
Remove-Item env:GOROOT

Write-Host "-- Install golang $version --"
choco install -y golang --version $version
setupChocolateyPath
go version
go env
}
. "$PSScriptRoot\common_windows.ps1"

function withDocker($version) {
Write-Host "-- Install Docker $version --"
Expand Down
22 changes: 1 addition & 21 deletions .buildkite/scripts/unit_tests_windows.ps1
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
$ErrorActionPreference = "Stop" # set -e

# Forcing to checkout again all the files with a correct autocrlf.
# Doing this here because we cannot set git clone options before.
function fixCRLF {
Write-Host "-- Fixing CRLF in git checkout --"
git config core.autocrlf input
git rm --quiet --cached -r .
git reset --quiet --hard
}

function withGolang($version) {
# Avoid conflicts with previous installations.
Remove-Item env:GOROOT

Write-Host "-- Install golang $version --"
choco install -y golang --version $version
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
refreshenv
go version
go env
}
. "$PSScriptRoot\common_windows.ps1"

function installGoDependencies {
$installPackages = @(
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ new_package

# default output directory for dump commands
package-dump

# cursor
.cursor
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@
- external: ecs
name: agent.id
dimension: true
- name: error.message
external: ecs
Comment on lines +52 to +53

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this field because of this error:

test case failed: one or more errors found in documents stored in metrics-system.process-96148 data stream: [0] field "error.message" is undefined

This is related to #3330 . Before the presence of this field error.message cause to fail the tests. As there is no event.kind , the field validator is executed and that field was not defined.

Example (buildkite link):

test case failed: one or more errors found in documents stored in metrics-system.process-63529 data stream: [0] found error.message in event: [non fatal error; reporting partial metrics: error fetching PID metrics for 1 processes, most likely a "permission denied" error. Enable debug logging to determine the exact cause.]

Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@
name: event.type
- external: ecs
name: message
- external: ecs
name: error.message