Skip to content

Commit

Permalink
Skip Windows testing if magefile.go does not exist (elastic#12099) (e…
Browse files Browse the repository at this point in the history
…lastic#12129)

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 19c1159)
  • Loading branch information
andrewkroh authored May 9, 2019
1 parent d1043be commit b41d2a9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dev-tools/jenkins_ci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ $env:RACE_DETECTOR = "true"
# Install mage from vendor.
exec { go install github.com/elastic/beats/vendor/github.com/magefile/mage } "mage install FAILURE"

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
Expand All @@ -62,5 +62,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"
}

0 comments on commit b41d2a9

Please sign in to comment.