Skip to content

Commit

Permalink
[ci] Favor direct mage invocation on CI (#19960) (#20153)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Jul 30, 2020
1 parent 3914872 commit af1ff5e
Show file tree
Hide file tree
Showing 13 changed files with 199 additions and 61 deletions.
146 changes: 118 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,49 +37,85 @@ jobs:

# Filebeat
- os: linux
env: TARGETS="-C filebeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh filebeat libbeat || travis_terminate 0
env:
- PROJECT=filebeat
- MAGE='build test'
go: $TRAVIS_GO_VERSION
stage: test
- os: osx
env: TARGETS="TEST_ENVIRONMENT=0 -C filebeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh filebeat libbeat || travis_terminate 0
env:
- PROJECT=filebeat
- MAGE='build unitTest'
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
env: TARGETS="-C x-pack/filebeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh x-pack/filebeat filebeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/filebeat
- MAGE='build test'
go: $(GO_VERSION)
stage: test

# Heartbeat
- os: linux
env: TARGETS="-C heartbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh heartbeat libbeat || travis_terminate 0
env:
- PROJECT=heartbeat
- MAGE='build test'
go: $TRAVIS_GO_VERSION
stage: test
- os: osx
env: TARGETS="TEST_ENVIRONMENT=0 -C heartbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh heartbeat libbeat || travis_terminate 0
env:
- PROJECT=heartbeat
- MAGE='build unitTest'
go: $TRAVIS_GO_VERSION
stage: test

# Auditbeat
- os: linux
env: TARGETS="-C auditbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh auditbeat libbeat || travis_terminate 0
env:
- PROJECT=auditbeat
- MAGE='build test'
go: $TRAVIS_GO_VERSION
stage: test
- os: osx
env: TARGETS="TEST_ENVIRONMENT=0 -C auditbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh auditbeat libbeat || travis_terminate 0
env:
- PROJECT=auditbeat
- MAGE='build unitTest'
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
env: TARGETS="-C auditbeat crosscompile"
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
env: TARGETS="-C x-pack/auditbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh x-pack/auditbeat auditbeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/auditbeat
- MAGE='build test'
go: $TRAVIS_GO_VERSION
stage: test
- os: osx
before_install: .ci/scripts/travis_has_changes.sh x-pack/auditbeat auditbeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/auditbeat
- MAGE='build unitTest'
go: $TRAVIS_GO_VERSION
stage: test

# Libbeat
- os: linux
env: TARGETS="-C libbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh libbeat || travis_terminate 0
env:
- PROJECT=libbeat
- MAGE='build test'
# The libbeat tests are so verbose that they exceed the maximum allowed log length of Travis CI.
- MAGEFILE_VERBOSE=false
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
Expand All @@ -91,58 +127,86 @@ jobs:
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
env: TARGETS="-C x-pack/libbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh x-pack/libbeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/libbeat
- MAGE='build test'
go: $TRAVIS_GO_VERSION
stage: test

# Metricbeat
- os: linux
env: TARGETS="-C metricbeat unit-tests"
before_install: .ci/scripts/travis_has_changes.sh metricbeat libbeat || travis_terminate 0
env:
- PROJECT=metricbeat
- MAGE='build unitTest'
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
before_install: .ci/scripts/travis_has_changes.sh metricbeat libbeat || travis_terminate 0
install:
install:
- .ci/scripts/install-kind.sh
- .ci/scripts/install-kubectl.sh
env:
- TARGETS="-C metricbeat integration-tests"
- K8S_VERSION=v1.17.2
- KIND_VERSION=v0.7.0
- PROJECT=metricbeat
- MAGE='goIntegTest'
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
env: TARGETS="-C metricbeat system-tests"
before_install: .ci/scripts/travis_has_changes.sh metricbeat libbeat || travis_terminate 0
env:
- PROJECT=metricbeat
- MAGE='pythonIntegTest'
go: $TRAVIS_GO_VERSION
stage: test
- os: osx
env: TARGETS="-C metricbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh metricbeat libbeat || travis_terminate 0
env:
- PROJECT=metricbeat
- MAGE='build unitTest'
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
env: TARGETS="-C metricbeat crosscompile"
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
env: TARGETS="-C x-pack/metricbeat unit-tests"
before_install: .ci/scripts/travis_has_changes.sh x-pack/metricbeat metricbeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/metricbeat
- MAGE='build unitTest'
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
env: TARGETS="-C x-pack/metricbeat integration-tests"
before_install: .ci/scripts/travis_has_changes.sh x-pack/metricbeat metricbeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/metricbeat
- MAGE='goIntegTest'
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
env: TARGETS="-C x-pack/metricbeat system-tests"
before_install: .ci/scripts/travis_has_changes.sh x-pack/metricbeat metricbeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/metricbeat
- MAGE='pythonIntegTest'
go: $TRAVIS_GO_VERSION
stage: test
- os: osx
env: TARGETS="-C x-pack/metricbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh metricbeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/metricbeat
- MAGE='build unitTest'
go: $TRAVIS_GO_VERSION
stage: test

# Packetbeat
- os: linux
env: TARGETS="-C packetbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh packetbeat libbeat || travis_terminate 0
env:
- PROJECT=packetbeat
- MAGE='build test'
go: $TRAVIS_GO_VERSION
stage: test

Expand All @@ -154,40 +218,58 @@ jobs:

# Functionbeat
- os: linux
env: TARGETS="-C x-pack/functionbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh x-pack/functionbeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/functionbeat
- MAGE='build test'
go: $TRAVIS_GO_VERSION
stage: test
- os: osx
env: TARGETS="TEST_ENVIRONMENT=0 -C x-pack/functionbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh x-pack/functionbeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/functionbeat
- MAGE='build unitTest'
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
before_install: .ci/scripts/travis_has_changes.sh x-pack/functionbeat libbeat || travis_terminate 0
env: TARGETS="-C x-pack/functionbeat test-gcp-functions"
env:
- PROJECT=x-pack/functionbeat
- MAGE='testGCPFunctions'
go: 1.13.1
stage: test

# Docker Log Driver
- os: linux
env: TARGETS="-C x-pack/dockerlogbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh x-pack/dockerlogbeat libbeat || travis_terminate 0
env:
- PROJECT=x-pack/dockerlogbeat
- MAGE='build test'
go: $TRAVIS_GO_VERSION
stage: test

# Journalbeat
- os: linux
env: TARGETS="-C journalbeat testsuite"
before_install: .ci/scripts/travis_has_changes.sh journalbeat libbeat || travis_terminate 0
env:
- PROJECT=journalbeat
- MAGE='build goUnitTest'
go: $TRAVIS_GO_VERSION
stage: test

# Agent
- os: linux
before_install: .ci/scripts/travis_has_changes.sh x-pack/elastic-agent libbeat || travis_terminate 0
env: TARGETS="-C x-pack/elastic-agent testsuite"
env:
- PROJECT=x-pack/elastic-agent
- MAGE='build test'
go: $TRAVIS_GO_VERSION
stage: test
- os: osx
before_install: .ci/scripts/travis_has_changes.sh x-pack/elastic-agent libbeat || travis_terminate 0
env: TARGETS="TEST_ENVIRONMENT=0 -C x-pack/elastic-agent testsuite"
env:
- PROJECT=x-pack/elastic-agent
- MAGE='build unitTest'
go: $TRAVIS_GO_VERSION
stage: test

Expand Down Expand Up @@ -279,6 +361,7 @@ before_install:
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- if [ $TRAVIS_OS_NAME = osx ]; then pip install virtualenv==16.7.9; fi
- make mage


# Skips installations step
Expand All @@ -289,7 +372,14 @@ script:
# Default Travis timeout is 10min, so this workaround prints timestamps every 9min to reset the counter.
# Using seconds (540s = 9min) instead of minutes for shell compatibility reasons.
- while sleep 540; do echo "=====[ ${SECONDS} seconds still running ]====="; done &
- make $TARGETS
- if [[ -n "$MAGE" ]]; then
echo ">> mage $MAGE from $PROJECT";
cd "$PROJECT";
mage $MAGE;
else
echo ">> make $TARGETS";
make $TARGETS;
fi
- kill %1

notifications:
Expand Down
Loading

0 comments on commit af1ff5e

Please sign in to comment.