Add tox and add Jenkisfile
This commit is contained in:
parent
2a4cce3975
commit
0541b7f860
|
@ -0,0 +1,50 @@
|
||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'python:3.7'
|
||||||
|
args '--user 0:0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('setup') {
|
||||||
|
steps {
|
||||||
|
sh 'pip install tox coverage'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('test'){
|
||||||
|
steps {
|
||||||
|
sh 'tox'
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
stage("Extract test results") {
|
||||||
|
steps{
|
||||||
|
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'coverage.xml', conditionalCoverageTargets: '70, 0, 0', enableNewApi: true, failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
changed {
|
||||||
|
emailext subject: '$DEFAULT_SUBJECT',
|
||||||
|
body: '$DEFAULT_CONTENT',
|
||||||
|
recipientProviders: [
|
||||||
|
[$class: 'CulpritsRecipientProvider'],
|
||||||
|
[$class: 'DevelopersRecipientProvider'],
|
||||||
|
[$class: 'RequesterRecipientProvider']
|
||||||
|
],
|
||||||
|
replyTo: '$DEFAULT_REPLYTO',
|
||||||
|
to: '$DEFAULT_RECIPIENTS'
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
emailext subject: '$DEFAULT_SUBJECT',
|
||||||
|
body: '$DEFAULT_CONTENT',
|
||||||
|
recipientProviders: [
|
||||||
|
[$class: 'CulpritsRecipientProvider'],
|
||||||
|
[$class: 'DevelopersRecipientProvider'],
|
||||||
|
[$class: 'RequesterRecipientProvider']
|
||||||
|
],
|
||||||
|
replyTo: '$DEFAULT_REPLYTO',
|
||||||
|
to: '$DEFAULT_RECIPIENTS'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
18
setup.py
18
setup.py
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# This file is part stock_mass_balance_report module for Tryton.
|
# This file is part production_mass_balance_report module for Tryton.
|
||||||
# The COPYRIGHT file at the top level of this repository contains
|
# The COPYRIGHT file at the top level of this repository contains
|
||||||
# the full copyright notices and license terms.
|
# the full copyright notices and license terms.
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@ version = info.get('version', '0.0.1')
|
||||||
major_version, minor_version, _ = version.split('.', 2)
|
major_version, minor_version, _ = version.split('.', 2)
|
||||||
major_version = int(major_version)
|
major_version = int(major_version)
|
||||||
minor_version = int(minor_version)
|
minor_version = int(minor_version)
|
||||||
name = 'nantic_stock_mass_balance_report'
|
name = 'nantic_production_mass_balance_report'
|
||||||
download_url = 'https://bitbucket.org/nantic/trytond-stock_mass_balance_report'
|
download_url = "https://github.com/NaN-tic/trytond-production_mass_balance_report"
|
||||||
|
|
||||||
requires = []
|
requires = []
|
||||||
for dep in info.get('depends', []):
|
for dep in info.get('depends', []):
|
||||||
|
@ -62,16 +62,16 @@ setup(name=name,
|
||||||
long_description=read('README'),
|
long_description=read('README'),
|
||||||
author='NaN-tic',
|
author='NaN-tic',
|
||||||
author_email='info@nan-tic.com',
|
author_email='info@nan-tic.com',
|
||||||
url='https://bitbucket.org/nantic/',
|
url='https://github.com/NaN-tic/',
|
||||||
download_url=download_url,
|
download_url=download_url,
|
||||||
keywords='',
|
keywords='',
|
||||||
package_dir={'trytond.modules.stock_mass_balance_report': '.'},
|
package_dir={'trytond.modules.production_mass_balance_report': '.'},
|
||||||
packages=[
|
packages=[
|
||||||
'trytond.modules.stock_mass_balance_report',
|
'trytond.modules.production_mass_balance_report',
|
||||||
'trytond.modules.stock_mass_balance_report.tests',
|
'trytond.modules.production_mass_balance_report.tests',
|
||||||
],
|
],
|
||||||
package_data={
|
package_data={
|
||||||
'trytond.modules.stock_mass_balance_report': (info.get('xml', [])
|
'trytond.modules.production_mass_balance_report': (info.get('xml', [])
|
||||||
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt',
|
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt',
|
||||||
'icons/*.svg', 'tests/*.rst']),
|
'icons/*.svg', 'tests/*.rst']),
|
||||||
},
|
},
|
||||||
|
@ -101,7 +101,7 @@ setup(name=name,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
entry_points="""
|
entry_points="""
|
||||||
[trytond.modules]
|
[trytond.modules]
|
||||||
stock_mass_balance_report = trytond.modules.stock_mass_balance_report
|
production_mass_balance_report = trytond.modules.production_mass_balance_report
|
||||||
""",
|
""",
|
||||||
test_suite='tests',
|
test_suite='tests',
|
||||||
test_loader='trytond.test_loader:Loader',
|
test_loader='trytond.test_loader:Loader',
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
[tox]
|
||||||
|
envlist = py37-sqlite, stats
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
basepython=python3.7
|
||||||
|
commands = coverage run setup.py test
|
||||||
|
deps =
|
||||||
|
sqlite: sqlitebck
|
||||||
|
coverage
|
||||||
|
setenv =
|
||||||
|
sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://}
|
||||||
|
sqlite: DB_NAME={env:SQLITE_NAME::memory:}
|
||||||
|
install_command = pip install --pre --find-links https://trydevpi.tryton.org/ {opts} {packages}
|
||||||
|
|
||||||
|
[testenv:stats]
|
||||||
|
basepython=python3.7
|
||||||
|
commands =
|
||||||
|
coverage xml --omit=.tox/*,.eggs/*
|
Loading…
Reference in New Issue