From 26567a2a39f004f29154bd5a553f2c719e8b4756 Mon Sep 17 00:00:00 2001 From: caviedesj Date: Tue, 13 Jan 2026 16:50:22 +0100 Subject: [PATCH] Feat 11077. Split Lint stage in Jenkinsfile.new Change-Id: I22de3860f8a5c1192edd8180e07b96fcc176d178 Signed-off-by: caviedesj --- Jenkinsfile.new | 20 +++++++++++++------- devops-stages/stage-lint.sh | 18 ++++++++++++++++++ devops-stages/stage-test.sh | 1 + 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100755 devops-stages/stage-lint.sh 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 @@ pipeline { } } - 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 @@ pipeline { 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 -- 2.25.1