@@ -12,9 +12,13 @@ addons:
12
12
- libmpc-dev
13
13
before_cache :
14
14
- 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
16
16
matrix :
17
17
include :
18
+ - python : 3.7
19
+ dist : xenial
20
+ sudo : true
21
+ env : MUTATION=yes
18
22
- python : 2.7
19
23
env : INSTRUMENTAL=yes
20
24
- python : 2.6
@@ -101,15 +105,16 @@ install:
101
105
else
102
106
travis_retry pip install -r build-requirements.txt;
103
107
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
105
109
- if [[ $TOX_ENV =~ gmpyp ]]; then travis_retry pip install gmpy; fi
106
110
- if [[ $INSTRUMENTAL ]]; then travis_retry pip install instrumental; fi
111
+ - if [[ $MUTATION ]]; then travis_retry pip install cosmic-ray gmpy2; fi
107
112
- pip list
108
113
script :
109
114
- 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
113
118
- |
114
119
if [[ $INSTRUMENTAL && $TRAVIS_PULL_REQUEST != "false" ]]; then
115
120
git checkout $PR_FIRST^
@@ -133,6 +138,26 @@ script:
133
138
if [[ $INSTRUMENTAL && $TRAVIS_PULL_REQUEST != "false" ]]; then
134
139
instrumental -f .instrumental.cov -s | python diff-instrumental.py --read .diff-instrumental --fail-under 70 --max-difference -0.1
135
140
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
136
161
after_success :
137
- - if [[ -z $INSTRUMENTAL ]]; then coveralls; fi
162
+ - if [[ -z $INSTRUMENTAL && -z $MUTATION ]]; then coveralls; fi
138
163
0 commit comments