mirror of https://gerrit.osmocom.org/pysim
contrib/jenkins.sh: split test/pylint/docs
Split the jenkins job up in three parts, so each of them can run in parallel, and the test part that has to run on a specific node (and blocks it while running), finishes faster. Don't install depends of pylint/docs jobs as they will run in docker and the depends get installed once in the container. Related: OS#5497 Depends: docker-playground Id5c75725d2fab46b29773fa4f637fa2d73fa7291 Depends: osmo-ci Iea4f15fd9c9f8f36cb8d638c48da000eafe746a4 Change-Id: I5245c529db729e209d78a02ab9c917a90d0e0206
This commit is contained in:
parent
0529c1906d
commit
8e45b75711
|
@ -4,6 +4,7 @@
|
||||||
# environment variables:
|
# environment variables:
|
||||||
# * WITH_MANUALS: build manual PDFs if set to "1"
|
# * WITH_MANUALS: build manual PDFs if set to "1"
|
||||||
# * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1")
|
# * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1")
|
||||||
|
# * JOB_TYPE: one of 'test', 'pylint', 'docs'
|
||||||
#
|
#
|
||||||
|
|
||||||
export PYTHONUNBUFFERED=1
|
export PYTHONUNBUFFERED=1
|
||||||
|
@ -15,36 +16,43 @@ if [ ! -d "./pysim-testdata/" ] ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
virtualenv -p python3 venv --system-site-packages
|
case "$JOB_TYPE" in
|
||||||
. venv/bin/activate
|
"test")
|
||||||
pip install -r requirements.txt
|
virtualenv -p python3 venv --system-site-packages
|
||||||
|
. venv/bin/activate
|
||||||
|
|
||||||
# Execute automatically discovered unit tests first
|
pip install -r requirements.txt
|
||||||
python -m unittest discover -v -s tests/
|
|
||||||
|
|
||||||
# Run pylint to find potential errors
|
# Execute automatically discovered unit tests first
|
||||||
# Ignore E1102: not-callable
|
python -m unittest discover -v -s tests/
|
||||||
# pySim/filesystem.py: E1102: method is not callable (not-callable)
|
|
||||||
# Ignore E0401: import-error
|
|
||||||
# pySim/utils.py:276: E0401: Unable to import 'Crypto.Cipher' (import-error)
|
|
||||||
# pySim/utils.py:277: E0401: Unable to import 'Crypto.Util.strxor' (import-error)
|
|
||||||
pip install pylint
|
|
||||||
python -m pylint -j0 --errors-only \
|
|
||||||
--disable E1102 \
|
|
||||||
--disable E0401 \
|
|
||||||
--enable W0301 \
|
|
||||||
pySim *.py
|
|
||||||
|
|
||||||
# attempt to build documentation
|
# Run the test with physical cards
|
||||||
pip install sphinx
|
cd pysim-testdata
|
||||||
pip install sphinxcontrib-napoleon
|
../tests/pysim-test.sh
|
||||||
pip3 install -e 'git+https://github.com/osmocom/sphinx-argparse@master#egg=sphinx-argparse'
|
;;
|
||||||
(cd docs && make html latexpdf)
|
"pylint")
|
||||||
|
# Run pylint to find potential errors
|
||||||
|
# Ignore E1102: not-callable
|
||||||
|
# pySim/filesystem.py: E1102: method is not callable (not-callable)
|
||||||
|
# Ignore E0401: import-error
|
||||||
|
# pySim/utils.py:276: E0401: Unable to import 'Crypto.Cipher' (import-error)
|
||||||
|
# pySim/utils.py:277: E0401: Unable to import 'Crypto.Util.strxor' (import-error)
|
||||||
|
python3 -m pylint -j0 --errors-only \
|
||||||
|
--disable E1102 \
|
||||||
|
--disable E0401 \
|
||||||
|
--enable W0301 \
|
||||||
|
pySim *.py
|
||||||
|
;;
|
||||||
|
"docs")
|
||||||
|
rm -rf docs/_build
|
||||||
|
make -C "docs" html latexpdf
|
||||||
|
|
||||||
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
|
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
|
||||||
make -C "docs" publish publish-html
|
make -C "docs" publish publish-html
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
# run the test with physical cards
|
*)
|
||||||
cd pysim-testdata
|
set +x
|
||||||
../tests/pysim-test.sh
|
echo "ERROR: JOB_TYPE has unexpected value '$JOB_TYPE'."
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
Loading…
Reference in New Issue