Feat 11077. Split Lint stage in Jenkinsfile.new
Change-Id: I22de3860f8a5c1192edd8180e07b96fcc176d178
Signed-off-by: caviedesj <juancamilo.caviedesvalencia.ext@telefonica.com>
diff --git a/Jenkinsfile.new b/Jenkinsfile.new
index 06616fe..be704ed 100644
--- a/Jenkinsfile.new
+++ b/Jenkinsfile.new
@@ -13,7 +13,6 @@
limitations under the License.
*/
-def ciHelper
def DEFAULT_MODULE_NAME = 'nbi'
pipeline {
@@ -126,17 +125,22 @@
}
}
- stage('Unit Tests') {
+ stage('Tests') {
steps {
script {
- if (!ciHelper) {
- ciHelper = load 'devops/jenkins/ci-pipelines/ci_helper.groovy'
- }
def UID = sh(returnStdout: true, script: 'id -u').trim()
def GID = sh(returnStdout: true, script: 'id -g').trim()
def common = "-v ${env.WORKSPACE}:/tests -e UID=${UID} -e GID=${GID} " + (params.DOCKER_ARGS ?: '')
- stage('Test') {
+ stage('Linting Tests') {
+ sh """
+ docker run --rm ${common} \
+ ${env.TEST_IMAGE} \
+ /tests/devops-stages/stage-lint.sh
+ """
+ }
+
+ stage('Unit Tests') {
sh """
docker run --rm ${common} \
${env.TEST_IMAGE} \
@@ -253,9 +257,11 @@
Promotion should be done in a separate downstream job after E2E success to avoid
*/
}
+
post {
always {
- cleanWs()
+ // cleanWs()
+ deleteDir()
}
}
}
diff --git a/devops-stages/stage-lint.sh b/devops-stages/stage-lint.sh
new file mode 100755
index 0000000..268652d
--- /dev/null
+++ b/devops-stages/stage-lint.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+echo "Launching tox"
+# TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto -e black,flake8,pylint,safety
+echo "DONE"
diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh
index 5a86dc9..8ef88ce 100755
--- a/devops-stages/stage-test.sh
+++ b/devops-stages/stage-test.sh
@@ -15,3 +15,4 @@
echo "Launching tox"
TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto
+# TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto -e cover