@@ -12,9 +12,13 @@ addons:
1212 - libmpc-dev
1313before_cache :
1414 - rm -f $HOME/.cache/pip/log/debug.log
15- # place the slowest (instrumental and py2.6) first
15+ # place the slowest (instrumental, mutation and py2.6) first
1616matrix :
1717 include :
18+ - python : 3.7
19+ dist : xenial
20+ sudo : true
21+ env : MUTATION=yes
1822 - python : 2.7
1923 env : INSTRUMENTAL=yes
2024 - python : 2.6
@@ -101,15 +105,16 @@ install:
101105 else
102106 travis_retry pip install -r build-requirements.txt;
103107 fi
104- - if [[ $TOX_ENV =~ gmpy2 ]]; then travis_retry pip install gmpy2; fi
108+ - if [[ $TOX_ENV =~ gmpy2 ]] || [[ $MUTATION ]] ; then travis_retry pip install gmpy2; fi
105109 - if [[ $TOX_ENV =~ gmpyp ]]; then travis_retry pip install gmpy; fi
106110 - if [[ $INSTRUMENTAL ]]; then travis_retry pip install instrumental; fi
111+ - if [[ $MUTATION ]]; then travis_retry pip install cosmic-ray gmpy2; fi
107112 - pip list
108113script :
109114 - if [[ $TOX_ENV ]]; then tox -e $TOX_ENV; fi
110- - if [[ $TOX_ENV =~ gmpy2 ]]; then tox -e speedgmpy2; fi
111- - if [[ $TOX_ENV =~ gmpyp ]]; then tox -e speedgmpy; fi
112- - if ! [[ $TOX_ENV =~ gmpy ]]; then tox -e speed; fi
115+ - if [[ $TOX_ENV =~ gmpy2 ]] && [[ -z $MUTATION ]] ; then tox -e speedgmpy2; fi
116+ - if [[ $TOX_ENV =~ gmpyp ]] && [[ -z $MUTATION ]] ; then tox -e speedgmpy; fi
117+ - if ! [[ $TOX_ENV =~ gmpy ]] && [[ -z $MUTATION ]] ; then tox -e speed; fi
113118 - |
114119 if [[ $INSTRUMENTAL && $TRAVIS_PULL_REQUEST != "false" ]]; then
115120 git checkout $PR_FIRST^
@@ -133,6 +138,26 @@ script:
133138 if [[ $INSTRUMENTAL && $TRAVIS_PULL_REQUEST != "false" ]]; then
134139 instrumental -f .instrumental.cov -s | python diff-instrumental.py --read .diff-instrumental --fail-under 70 --max-difference -0.1
135140 fi
141+ # cosmic-ray (mutation testing) runs
142+ - if [[ $MUTATION ]]; then cosmic-ray init cosmic-ray.toml session.sqlite; fi
143+ - if [[ $MUTATION ]]; then cosmic-ray baseline --report session.sqlite; fi
144+ - if [[ $MUTATION ]]; then cr-report --show-output session.baseline.sqlite; fi
145+ - |
146+ if [[ $MUTATION ]]; then
147+ cosmic-ray exec session.sqlite &
148+ COSMIC_PID=$!
149+ # make sure that we output something every 5 minutes (otherwise travis will kill us)
150+ while kill -s 0 $COSMIC_PID; do
151+ sleep 300
152+ cr-report session.sqlite | tail -n 3;
153+ done &
154+ REPORT_PID=$!
155+ # kill exec after 25 minutes
156+ (sleep $((60*25)); kill $COSMIC_PID) &
157+ fi
158+ - if [[ $MUTATION ]]; then wait $COSMIC_PID ; kill $REPORT_PID ; true; fi
159+ - if [[ $MUTATION ]]; then cr-report --show-output session.sqlite | tail -n 40; fi
160+ - if [[ $MUTATION ]]; then cr-rate --estimate --fail-over 25 --confidence 99.9 session.sqlite; fi
136161after_success :
137- - if [[ -z $INSTRUMENTAL ]]; then coveralls; fi
162+ - if [[ -z $INSTRUMENTAL && -z $MUTATION ]]; then coveralls; fi
138163
0 commit comments