Skip to content

Commit

Permalink
Merge pull request #342 from ONSdigital/Jenkins_CICD_changes
Browse files Browse the repository at this point in the history
changes to jenkinsfile
  • Loading branch information
JenCheshire authored Sep 25, 2024
2 parents 61709d9 + 8819231 commit 62f62fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pipeline {
unstash name: 'Checkout'

sh '''
PATH=$WORKSPACE/venv/bin:/usr/local/bin:$PATH
PATH=$WORKSPACE/venv/bin:/usr/local/bin:/root/.local/bin:$PATH
python3 -m pip install -U pip
pip3 install virtualenv
Expand All @@ -72,15 +72,14 @@ pipeline {
virtualenv venv
fi
. venv/bin/activate
export PIP_USER=false
python -m pip install -U pip
pip3 install pypandoc==1.7.5
pip3 install pypandoc
# Remove pydoop from requirements before it's installed.
awk '!/pydoop.*/' requirements.txt > temp && mv temp requirements.txt
pip3 install -r requirements.txt
pip3 install pyspark==2.4.0
pip3 freeze
Expand All @@ -105,8 +104,13 @@ pipeline {
sh '''
. venv/bin/activate
coverage run --branch --source=./${PROJECT_NAME} --omit=src/utils/hdfs_mods.py,src/utils/wrappers.py,src/utils/runlog.py,src/_version.py,src/pipeline.py \
-m pytest -ra ./tests --ignore=tests/test_utils/test_hdfs_mods.py
python3 -m pytest --junitxml "junit-report.xml" "./tests"
'''

junit restResults: 'junit-report.xml'

/* coverage run --branch --source=./${PROJECT_NAME} --omit=src/utils/hdfs_mods.py,src/utils/wrappers.py,src/utils/runlog.py,src/_version.py,src/pipeline.py \
-m pytest -ra ./tests --ignore=tests/test_utils/test_hdfs_mods.py
'''
/*
// Lines below create a coverage report for on Jenkins. Currently commented out
Expand Down Expand Up @@ -141,8 +145,8 @@ pipeline {
steps {
onStage()
colourText('info', "Building Python package.")
unstash name: 'Checkout'
unstash name: 'venv'
// unstash name: 'Checkout'
// unstash name: 'venv'

sh '''
. venv/bin/activate
Expand Down
2 changes: 1 addition & 1 deletion src/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.1"
__version__ = "2.0.2"

0 comments on commit 62f62fb

Please sign in to comment.