Skip to content

Commit 3d0ac46

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/k8s
* upstream/master: Remove folder jobdsl reference (#725) docs: update CHANGELOG.md [maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare release v1.1.138 Allow withGoEnv to accept an OS override arg (#724) fix: support using gherkin-lint args (#723) [test-infra] fix pytests with multimodule (#722)
2 parents b443a81 + f0b506f commit 3d0ac46

File tree

15 files changed

+68
-15
lines changed

15 files changed

+68
-15
lines changed

.ci/scripts/gherkin-lint.sh

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,37 @@ set -eo pipefail
44
IMAGE="gherkin/lint"
55
docker pull "${IMAGE}" > /dev/null || true
66

7-
## Iterate for each file without failing fast.
7+
arguments=""
8+
declare -a files
9+
810
set +e
9-
for file in "$@"; do
10-
if ! docker run --rm -t -v "$(pwd)":/src -w /src "${IMAGE}" ${file} ; then
11-
echo "ERROR: gherkin-lint failed for the file '${file}'"
11+
12+
while [ "$1" != "" ]; do
13+
case $1 in
14+
--disable )
15+
arguments="$arguments $1 $2"
16+
shift
17+
;;
18+
--enable )
19+
arguments="$arguments $1 $2"
20+
shift
21+
;;
22+
-v | --verbose )
23+
arguments="$arguments $1"
24+
;;
25+
* )
26+
files+=("$1")
27+
esac
28+
shift
29+
done
30+
31+
echo "Running gherkin-lint with arguments: '${arguments}'"
32+
33+
## Iterate for each file without failing fast.
34+
for file in "${files[@]}"; do
35+
# shellcheck disable=SC2086
36+
if ! docker run --rm -t -v "$(pwd)":/src -w /src "${IMAGE}" ${arguments} ${file}; then
37+
echo "ERROR: gherkin-lint failed for the file '${file}'. Arguments: ${arguments}"
1238
exit_status=1
1339
fi
1440
done

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## v1.1.138 (15/09/2020)
4+
5+
#### 🐛 Bug Fixes
6+
7+
- [test-infra] fix pytests with multimodule [#722](https://github.com/elastic/apm-pipeline-library/pull/722)
8+
9+
#### ⚙️ CI
10+
11+
- [**on-hold**] refactor: use env variables from the plugin [#426](https://github.com/elastic/apm-pipeline-library/pull/426)
12+
313
## v1.1.137 (14/09/2020)
414

515
#### 🚀 Enhancements

local/configs/jenkins.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ jobs:
126126
- file: "/var/pipeline-library/src/test/resources/folders/beats.dsl"
127127
- file: "/var/pipeline-library/src/test/resources/folders/getBuildInfoJsonFiles.dsl"
128128
- file: "/var/pipeline-library/src/test/resources/folders/it.dsl"
129-
- file: "/var/pipeline-library/src/test/resources/folders/timeout.dsl"
130129
- file: "/var/pipeline-library/src/test/resources/jobs/beats/beatsStages.dsl"
131130
- file: "/var/pipeline-library/src/test/resources/jobs/beats/beatsWhen.dsl"
132131
- file: "/var/pipeline-library/src/test/resources/jobs/cancelPreviousRunningBuilds.dsl"

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>co.elastic</groupId>
55
<artifactId>jenkins-library</artifactId>
6-
<version>1.1.138-SNAPSHOT</version>
6+
<version>1.1.139-SNAPSHOT</version>
77
<name>APM Pipeline Shared Library</name>
88
<description>Pipeline Shared Library containing utility steps.</description>
99
<url>https://github.com/elastic/apm-pipeline-library</url>

resources/JenkinsfileTemplate.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pipeline {
108108
// the contributor is member from the elastic organisation, it tracks the status
109109
// with a GitHub check when using a Multibranch Pipeline!
110110
// Git reference repos are a good practise to speed up the whole execution time.
111-
gitCheckout(basedir: "${BASE_DIR}", branch: 'master',
111+
gitCheckout(basedir: "${BASE_DIR}",
112112
repo: "git@github.com:elastic/${env.REPO}.git",
113113
credentialsId: "${JOB_GIT_CREDENTIALS}",
114114
githubNotifyFirstTimeContributor: false,

resources/scripts/jenkins/apm-ci/test-mac.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@ if command -v docker-machine ; then
2828
docker-machine start default || true
2929
eval "$(docker-machine env default)"
3030
docker_py_test=test-infra/apm-ci/test_installed_tools_docker.py
31-
else
32-
docker_py_test=""
3331
fi
3432

3533
## Run test-infra and trap error to notify when required
3634
set -x
35+
# shellcheck disable=SC2086
3736
{ py.test -v \
38-
test-infra/apm-ci/test_installed_tools.py "${docker_py_test}" \
37+
test-infra/apm-ci/test_installed_tools.py ${docker_py_test} \
3938
--junit-xml=target/junit-test-infra.xml; \
4039
err="$?"; } || true
4140

resources/scripts/jenkins/beats-ci/test-mac.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ set -x
3030

3131
## Run test-infra and trap error to notify when required
3232
{ py.test -v \
33-
test-infra/beats-ci/test_installed_tools.py \
33+
test-infra/beats-ci/test_beats_installed_tools.py \
3434
--junit-xml=target/junit-test-infra.xml; \
3535
err="$?"; } || true
3636

resources/scripts/jenkins/beats-ci/test.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ exec { venv\Scripts\activate.bat }
3232
exec { pip install testinfra }
3333

3434
# Run the test-infra
35-
exec { py.test -v test-infra\beats-ci\test_windows.py --junit-xml=target\junit-test-infra.xml }
35+
exec { py.test -v test-infra\beats-ci\test_beats_windows.py --junit-xml=target\junit-test-infra.xml }

resources/scripts/jenkins/beats-ci/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ PACKER=${1:-false}
3232

3333
## Run test-infra and trap error to notify when required
3434
{ py.test -v \
35-
test-infra/beats-ci/test_installed_tools.py \
35+
test-infra/beats-ci/test_beats_installed_tools.py \
3636
--junit-xml=target/junit-test-infra.xml; \
3737
er="$?"; } || true
3838
err="${er}"
3939

4040
if [ "${PACKER}" = "true" ] ; then
4141
{ py.test -v \
42-
test-infra/beats-ci/test_packer.py \
42+
test-infra/beats-ci/test_beats_packer.py \
4343
--junit-xml=target/junit-test-packer.xml; \
4444
er="$?"; } || true
4545
if [ $er -gt 0 ] ; then

src/test/groovy/WithGoEnvStepTests.groovy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,24 @@ class WithGoEnvStepTests extends ApmBasePipelineTest {
8787
assertJobStatusSuccess()
8888
}
8989

90+
@Test
91+
void testOSArg() throws Exception {
92+
def script = loadScript(scriptName)
93+
env.GO_VERSION = "1.12.2"
94+
def isOK = false
95+
96+
script.call(os: 'custom-os'){
97+
if(binding.getVariable("PATH") == "WS/bin:WS/.gvm/versions/go1.12.2.custom-os.amd64/bin:/foo/bin"
98+
&& binding.getVariable("GOROOT") == "WS/.gvm/versions/go1.12.2.custom-os.amd64"
99+
&& binding.getVariable("GOPATH") == "WS" ){
100+
isOK = true
101+
}
102+
}
103+
printCallStack()
104+
assertTrue(isOK)
105+
assertTrue(assertMethodCallContainsPattern('sh', 'Installing go 1.12.2'))
106+
assertJobStatusSuccess()
107+
}
90108

91109
@Test
92110
void testPkgs() throws Exception {

0 commit comments

Comments
 (0)