summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCengiz Kaygusuz <cngkaygusuz@gmail.com>2018-10-25 14:16:37 -0400
committerCengiz Kaygusuz <cngkaygusuz@gmail.com>2018-10-25 14:30:53 -0400
commitdaa2ddadc82b1da705f73449fc85960f3784a934 (patch)
tree03b51c3490fdabc0e2912b153890d7441ab6c1ca
parent2fe1bb0be12e9c603bc82d3990b9305c248d99e1 (diff)
downloadpyparsing-git-daa2ddadc82b1da705f73449fc85960f3784a934.tar.gz
Implement testing and coverage for multiple py versions using scrutinizer
-rw-r--r--.scrutinizer.yml31
-rw-r--r--requirements-dev.txt1
-rwxr-xr-xscrutinizer-pyenv.sh13
-rw-r--r--tox.ini7
4 files changed, 44 insertions, 8 deletions
diff --git a/.scrutinizer.yml b/.scrutinizer.yml
index 1ea545f..25e0b64 100644
--- a/.scrutinizer.yml
+++ b/.scrutinizer.yml
@@ -1,21 +1,36 @@
-# This file contains the configuration for Scrutinizer-CI, a tool we use for software quality.
-
+# This file contains the configuration for Scrutinizer-CI, a tool we use for software quality purposes.
build:
- # We will be running our tests in Python 2.7.7
environment:
- python: 2.7.7
+ python: 3.6.3
+
+ variables:
+ PYTHON_VERSIONS: 'jython-2.7.1 pypy2.7-5.10.0 pypy3.5-5.10.1 2.7.15 3.3.6 3.4.5 3.5.6'
- # Install development dependencies.
dependencies:
override:
+ - 'SCRIPT_PATH=$PWD/scrutinizer-pyenv.sh'
+
+ - 'pushd . '
+ - 'cd $HOME'
+
+ - command: '$SCRIPT_PATH'
+ not_if: 'exists-in-cache repository "$PYTHON_VERSIONS"'
+ idle_timeout: 3000
+ - command: 'store-in-cache repository "$PYTHON_VERSIONS" .pyenv'
+ not_if: 'exists-in-cache repository "$PYTHON_VERSIONS"'
+
+ - command: 'restore-from-cache repository "$PYTHON_VERSIONS"'
+ only_if: 'exists-in-cache repository "$PYTHON_VERSIONS"'
+
+ - 'popd'
+
- 'pip install -r requirements-dev.txt'
- - true # to have scrutinizer-ci not infer any commands.
tests:
override:
+ - 'pyenv local $PYTHON_VERSIONS'
# Following command generates .coverage file, the output of the "coverage" tool.
- -
- command: coverage run unitTests.py
+ - command: 'tox && coverage combine'
coverage: # This section instructs Scrutinizer-CI this command produces test coverage output.
file: '.coverage'
format: 'py-cc'
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 8f039d1..c765658 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1 +1,2 @@
coverage==4.4.2
+tox==3.5.2
diff --git a/scrutinizer-pyenv.sh b/scrutinizer-pyenv.sh
new file mode 100755
index 0000000..f6fa468
--- /dev/null
+++ b/scrutinizer-pyenv.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -e
+
+pushd .
+cd .pyenv
+git fetch --tags
+git checkout v1.2.7
+popd
+
+echo $PYTHON_VERSIONS | xargs -n1 pyenv install
+
+
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..bf02946
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,7 @@
+[tox]
+envlist=pypy, pypy3, py27, py33, py34, py35, py36
+
+[testenv]
+deps=-rrequirements-dev.txt
+commands=coverage run --parallel --branch unitTests.py
+