Skip to content
Snippets Groups Projects
Commit 42ae8266 authored by Anton Joubert's avatar Anton Joubert
Browse files

Testing Jenkinsfile

Add pytest runner and configuration
parent 596f416c
Branches
Tags
No related merge requests found
......@@ -2,6 +2,7 @@
# Packages
*.egg
*.eggs
*.egg-info
dist
build
......@@ -24,6 +25,7 @@ pip-log.txt
.tox
.cache
nosetests.xml
results.xml
# Developer tools
*~
......@@ -31,3 +33,6 @@ nosetests.xml
# Ansible
*.retry
# Miscellaneous
.DS_Store
node('docker') {
withDockerContainer(
image: 'tango-levpro:latest',
args: '-u root'
) {
stage 'Cleanup workspace'
sh 'chmod 777 -R .'
sh 'rm -rf *'
stage 'Checkout SCM'
checkout([
$class: 'GitSCM',
branches: [[name: "refs/heads/${env.BRANCH_NAME}"]],
extensions: [[$class: 'LocalBranch']],
userRemoteConfigs: scm.userRemoteConfigs,
doGenerateSubmoduleConfigurations: false,
submoduleCfg: []
])
stage 'Install & Unit Tests'
timestamps {
timeout(time: 30, unit: 'MINUTES') {
ansiColor('xterm') {
try {
sh 'export'
sh 'mount'
sh 'python setup.py test --addopts="--junitxml results.xml"'
}
finally {
step([$class: 'JUnitResultArchiver', testResults: 'results.xml'])
}
}
}
}
}
}
[aliases]
test=pytest
[nosetests]
verbosity=3
detailed-errors=1
......
......@@ -8,8 +8,14 @@
# WRITTEN PERMISSION OF SKA SA. #
###############################################################################
import sys
from setuptools import setup, find_packages
# prevent unnecessary installation of pytest-runner
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
setup(name="levpro",
description="Element Base Classes - Evolutionary Prototype",
author="MeerKAT CAM Team",
......@@ -30,17 +36,18 @@ setup(name="levpro",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Astronomy"],
platforms=["OS Independent"],
setup_requires=[],
setup_requires=[] + pytest_runner,
install_requires=[
"enum34",
"argparse"
],
tests_require=[
"nose",
"coverage",
"nose",
"nosexcover",
"pytest",
"unittest2"
],
keywords="elt lmc ska",
keywords="levpro lmc ska",
test_suite="nose.collector",
zip_safe=False)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment