@@ -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
@@ -100,12 +104,13 @@ install:
100104 - if [[ $TOX_ENV =~ gmpy2 ]]; then travis_retry pip install gmpy2; fi
101105 - if [[ $TOX_ENV =~ gmpyp ]]; then travis_retry pip install gmpy; fi
102106 - if [[ $INSTRUMENTAL ]]; then travis_retry pip install instrumental; fi
107+ - if [[ $MUTATION ]]; then travis_retry pip install cosmic-ray gmpy2; fi
103108 - pip list
104109script :
105110 - if [[ $TOX_ENV ]]; then tox -e $TOX_ENV; fi
106- - if [[ $TOX_ENV =~ gmpy2 ]]; then tox -e speedgmpy2; fi
107- - if [[ $TOX_ENV =~ gmpyp ]]; then tox -e speedgmpy; fi
108- - if ! [[ $TOX_ENV =~ gmpy ]]; then tox -e speed; fi
111+ - if [[ $TOX_ENV =~ gmpy2 ]] && [[ -z $MUTATION ]] ; then tox -e speedgmpy2; fi
112+ - if [[ $TOX_ENV =~ gmpyp ]] && [[ -z $MUTATION ]] ; then tox -e speedgmpy; fi
113+ - if ! [[ $TOX_ENV =~ gmpy ]] && [[ -z $MUTATION ]] ; then tox -e speed; fi
109114 - |
110115 if [[ $INSTRUMENTAL && $TRAVIS_PULL_REQUEST != "false" ]]; then
111116 git checkout $PR_FIRST^
@@ -129,6 +134,26 @@ script:
129134 if [[ $INSTRUMENTAL && $TRAVIS_PULL_REQUEST != "false" ]]; then
130135 instrumental -f .instrumental.cov -s | python diff-instrumental.py --read .diff-instrumental --fail-under 70 --max-difference -0.1
131136 fi
137+ # cosmic-ray (mutation testing) runs
138+ - if [[ $MUTATION ]]; then cosmic-ray init cosmic-ray.toml session.sqlite; fi
139+ - if [[ $MUTATION ]]; then cosmic-ray baseline --report session.sqlite; fi
140+ - if [[ $MUTATION ]]; then cr-report --show-output session.baseline.sqlite; fi
141+ - |
142+ if [[ $MUTATION ]]; then
143+ cosmic-ray exec session.sqlite &
144+ COSMIC_PID=$!
145+ # make sure that we output something every 5 minutes (otherwise travis will kill us)
146+ while kill -s 0 $COSMIC_PID; do
147+ sleep 300
148+ cr-report session.sqlite | tail -n 3;
149+ done &
150+ REPORT_PID=$!
151+ # kill exec after 25 minutes
152+ (sleep $((60*25)); kill $COSMIC_PID) &
153+ fi
154+ - if [[ $MUTATION ]]; then wait $COSMIC_PID ; kill $REPORT_PID ; true; fi
155+ - if [[ $MUTATION ]]; then cr-report --show-output session.sqlite | tail -n 40; fi
156+ - if [[ $MUTATION ]]; then cr-rate --estimate --fail-over 25 --confidence 99.9 session.sqlite; fi
132157after_success :
133- - if [[ -z $INSTRUMENTAL ]]; then coveralls; fi
158+ - if [[ -z $INSTRUMENTAL && -z $MUTATION ]]; then coveralls; fi
134159
0 commit comments