From 069c2e7d62f88de76a4a2897696bfbab7e0daa93 Mon Sep 17 00:00:00 2001 From: Emmanuel Cazenave Date: Fri, 24 Jan 2020 12:20:48 +0100 Subject: [PATCH] jenkins: run tests against python3 (#38781) --- Jenkinsfile | 6 +++++- tox.ini | 12 +++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5da617cd..608ed50d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,10 @@ pipeline { agent any + options { + disableConcurrentBuilds() + timeout(time: 10, unit: 'MINUTES') + } stages { stage('Unit Tests') { steps { @@ -15,7 +19,7 @@ pipeline { utils.publish_coverage_native('index.html') utils.publish_pylint('pylint.out') } - junit '*_results.xml' + mergeJunitResults() } } } diff --git a/tox.ini b/tox.ini index 851886b9..6a1e8e80 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,9 @@ [tox] toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle/{env:BRANCH_NAME:} -envlist = django111-pg +envlist = py2-django111-pg-junit, py3-django111-pg-coverage [testenv] usedevelop = True -basepython = python2 setenv = DJANGO_SETTINGS_MODULE=passerelle.settings PASSERELLE_SETTINGS_FILE=tests/settings.py @@ -13,6 +12,8 @@ setenv = fast: FAST=--nomigrations sqlite: DB_ENGINE=django.db.backends.sqlite3 pg: DB_ENGINE=django.db.backends.postgresql_psycopg2 + coverage: COVERAGE=--junitxml=junit-{envname}.xml --cov-report xml --cov-report html --cov=passerelle/ --cov-config .coveragerc -Wignore + junit: JUNIT=--junitxml=junit-{envname}.xml deps = django111: django>=1.11,<1.12 psycopg2-binary @@ -32,7 +33,8 @@ deps = pytest-httpbin pytest-localserver pytest-sftpserver - http://quixote.python.ca/releases/Quixote-2.7b2.tar.gz + py2: http://quixote.python.ca/releases/Quixote-2.7b2.tar.gz + py3: Quixote vobject django-ratelimit pyquery @@ -40,8 +42,8 @@ deps = zeep<3.3 commands = ./get_wcs.sh - django111: py.test {posargs: {env:FAST:} --junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=passerelle/ --cov-config .coveragerc tests/} - django111: ./pylint.sh passerelle/ + py.test {posargs: {env:FAST:} {env:COVERAGE:} {env:JUNIT:} tests/} + coverage: ./pylint.sh passerelle/ [pytest] filterwarnings = default