-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…20030) * [ci] Favor direct mage invocation on CI (#19960) This changes Jenkins and Travis to directly invoke mage where possible instead of going through make. Some of the remaining make don't yet have a mage equivalant (mainly crosscompile). For Packetbeat this add Jenkins stages to test on darwin and Windows. There were a few fixes I had to make related to these changes: - Add some mage target dependencies to ensure fields and dashboards are ready when tests use them. - Swap the order of the Go imports for dev-tools/mage/targets/integtest and unittest so that unit tests run before integ tests when running the 'mage test' target. - chown the shared Python venv that is in the root of the repo after Dockerized integ tests exit to ensure there are no permissions issues caused by root owned files. - I found a few Python string encoding issues that caused tests failures. I thought we fixed these during the Python 3 conversion, but something here exposed a few that we didn't address. One thing of note that I did not correct. Journalbeat has system tests but they are not executed. The existing/old Makefile has SYSTEM_TESTS=false so they are not executed. So when I switched it to mage I left it as 'mage goUnitTest' to avoid the Python when failed when I tried it. (cherry picked from commit 4a1f800)
- Loading branch information
1 parent
7e884d9
commit 4c6dba2
Showing
15 changed files
with
249 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
set -exuo pipefail | ||
|
||
# Changes on these files will trigger all builds. | ||
COMMON_DIRLIST="dev-tools .travis.yml testing .ci" | ||
|
||
# Commit range to check for. For example master...<PR branch> | ||
RANGE=$TRAVIS_COMMIT_RANGE | ||
DIRLIST="$@ $COMMON_DIRLIST" | ||
|
||
# Find modified files in range and filter out docs only changes. | ||
CHANGED_FILES=$(git diff --name-only $RANGE | grep -v '.asciidoc') | ||
|
||
beginswith() { case $2 in "$1"*) true;; *) false;; esac } | ||
|
||
for path in $DIRLIST; do | ||
for changed in $CHANGED_FILES; do | ||
if beginswith $path $changed; then | ||
exit 0 # found a match -> continue testing | ||
fi | ||
done | ||
done | ||
|
||
echo "NOT testing required. Modified files: $CHANGED_FILES" | ||
exit 1 |
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
Oops, something went wrong.