Skip to content

Commit df1ebf7

Browse files
authored
[ci] Make tests pass in Jenkinsfile pipeline (#17071)
* Address failing tests and warnings * Ensure mage unitTest works consistently Windows will invoke `mage unitTest` that will run the Go and Python tests without requiring the integration tests environment. Use an alias for goTestUnit in metricbeat * Only include test output when `mage -v` is used The full test output is written to a file and we archive that. Additionally if a test fails that output is still logged out stderr. This helps speed things up because Jenkins doesn't need to deal with streaming megabytes of log output to the console. It also makes it easier to spot errors in the log. * Jenkinsfile updates Changes: - Disable macOS by default. These workers don't have python3 so they cannot a portion of the tests. - Add python38 to the PATH on Windows. - Various fixes to the environment variables on Windows. - Always add the GVM GOROOT/bin to the PATH on POSIX. Same as was being done on Windows. - Use bat instead of sh on Windows to run `mage dumpVariables`. * Add MAGEFILE_VERBOSE to travis-ci env
1 parent 8a2ed76 commit df1ebf7

File tree

23 files changed

+237
-195
lines changed

23 files changed

+237
-195
lines changed

.ci/scripts/install-go.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ GVM_CMD="${HOME}/bin/gvm"
1010

1111
mkdir -p "${HOME}/bin"
1212

13-
curl -sSLo "${GVM_CMD}" "https://github.com/andrewkroh/gvm/releases/download/v0.2.1/gvm-${ARCH}-amd64"
13+
curl -sSLo "${GVM_CMD}" "https://github.com/andrewkroh/gvm/releases/download/v0.2.2/gvm-${ARCH}-amd64"
1414
chmod +x "${GVM_CMD}"
1515

1616
gvm ${GO_VERSION}|cut -d ' ' -f 2|tr -d '\"' > ${PROPERTIES_FILE}

.ci/scripts/install-tools.bat

+12-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,19 @@ IF ERRORLEVEL 1 (
99
mkdir %WORKSPACE%\bin
1010
where /q gvm
1111
IF ERRORLEVEL 1 (
12-
curl -sL -o %WORKSPACE%\bin\gvm.exe https://github.com/andrewkroh/gvm/releases/download/v0.2.1/gvm-windows-amd64.exe
12+
curl -sL -o %WORKSPACE%\bin\gvm.exe https://github.com/andrewkroh/gvm/releases/download/v0.2.2/gvm-windows-amd64.exe
1313
)
1414
FOR /f "tokens=*" %%i IN ('"gvm.exe" use %GO_VERSION% --format=batch') DO %%i
1515

16+
go env
1617
go install -mod=vendor github.com/magefile/mage
18+
mage -version
19+
where mage
20+
21+
if not exist C:\Python38\python.exe (
22+
REM Install python 3.8.
23+
choco install python -y -r --no-progress --version 3.8.2
24+
)
25+
python --version
26+
where python
27+

.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ indent_style = tab
2929
[*.mk]
3030
indent_style = tab
3131

32+
[Jenkinsfile]
33+
indent_size = 2
34+
indent_style = space
35+
3236
[Vagrantfile]
3337
indent_size = 2
3438
indent_style = space

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ env:
1717
# Newer versions of minikube fail on travis, see: https://github.com/kubernetes/minikube/issues/2704
1818
- TRAVIS_MINIKUBE_VERSION=v0.25.2
1919
- MACOSX_DEPLOYMENT_TARGET=10.15
20+
# Enable verbose output since Travis users cannot access test output that is written to files.
21+
# The constant output from tests also prevents time-outs.
22+
- MAGEFILE_VERBOSE=true
2023

2124
# Only run CI jobs on specific branches.
2225
# To keep the number of Travis CI jobs in check, we decided to configure Travis to only kick off CI jobs for the master branch.

0 commit comments

Comments
 (0)