From 50d9280483fb1cf60ad7a5a3893ac71cb5876607 Mon Sep 17 00:00:00 2001 From: Andrew Kroh Date: Thu, 9 May 2019 08:30:13 -0400 Subject: [PATCH] Skip Windows testing if magefile.go does not exist (#12099) Changes the jenkins_ci.ps1 script to skip testing when magefile.go does not exist. This will allow us to add projects like x-pack/winlogbeat to the test matrix because not all branches have an x-pack/winlogbeat/magefile.go file. (cherry picked from commit cc05f62d5d42f9b3c66a490d62c617c4b28025c9) --- dev-tools/jenkins_ci.ps1 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dev-tools/jenkins_ci.ps1 b/dev-tools/jenkins_ci.ps1 index 61cee20ac2b..2a6b25c0577 100755 --- a/dev-tools/jenkins_ci.ps1 +++ b/dev-tools/jenkins_ci.ps1 @@ -38,10 +38,10 @@ echo "Fetching testing dependencies" # TODO (elastic/beats#5050): Use a vendored copy of this. exec { go get github.com/docker/libcompose } -if (Test-Path "$env:beat") { +if (Test-Path "$env:beat\magefile.go") { cd "$env:beat" } else { - echo "$env:beat does not exist" + echo "$env:beat\magefile.go does not exist" New-Item -ItemType directory -Path build | Out-Null New-Item -Name build\TEST-empty.xml -ItemType File | Out-Null exit @@ -66,5 +66,8 @@ echo "System testing $env:beat" $packages = $(go list ./... | select-string -Pattern "/vendor/" -NotMatch | select-string -Pattern "/scripts/cmd/" -NotMatch) $packages = ($packages|group|Select -ExpandProperty Name) -join "," exec { go test -race -c -cover -covermode=atomic -coverpkg $packages } "go test -race -cover FAILURE" -Set-Location -Path tests/system -exec { nosetests --with-timer --with-xunit --xunit-file=../../build/TEST-system.xml } "System test FAILURE" + +if (Test-Path "tests\system") { + Set-Location -Path tests\system + exec { nosetests --with-timer --with-xunit --xunit-file=../../build/TEST-system.xml } "System test FAILURE" +}