Skip to content

Commit

Permalink
Merge b3b5be8 into 8deb089
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato42 committed Dec 2, 2019
2 parents 8deb089 + b3b5be8 commit c36a853
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 5 deletions.
35 changes: 30 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ addons:
- libmpc-dev
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
# place the slowest (instrumental and py2.6) first
# place the slowest (instrumental, mutation and py2.6) first
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
env: MUTATION=yes
- python: 2.7
env: INSTRUMENTAL=yes
- python: 2.6
Expand Down Expand Up @@ -100,12 +104,13 @@ install:
- if [[ $TOX_ENV =~ gmpy2 ]]; then travis_retry pip install gmpy2; fi
- if [[ $TOX_ENV =~ gmpyp ]]; then travis_retry pip install gmpy; fi
- if [[ $INSTRUMENTAL ]]; then travis_retry pip install instrumental; fi
- if [[ $MUTATION ]]; then travis_retry pip install cosmic-ray gmpy2; fi
- pip list
script:
- if [[ $TOX_ENV ]]; then tox -e $TOX_ENV; fi
- if [[ $TOX_ENV =~ gmpy2 ]]; then tox -e speedgmpy2; fi
- if [[ $TOX_ENV =~ gmpyp ]]; then tox -e speedgmpy; fi
- if ! [[ $TOX_ENV =~ gmpy ]]; then tox -e speed; fi
- if [[ $TOX_ENV =~ gmpy2 ]] && [[ -z $MUTATION ]]; then tox -e speedgmpy2; fi
- if [[ $TOX_ENV =~ gmpyp ]] && [[ -z $MUTATION ]]; then tox -e speedgmpy; fi
- if ! [[ $TOX_ENV =~ gmpy ]] && [[ -z $MUTATION ]]; then tox -e speed; fi
- |
if [[ $INSTRUMENTAL && $TRAVIS_PULL_REQUEST != "false" ]]; then
git checkout $PR_FIRST^
Expand All @@ -129,6 +134,26 @@ script:
if [[ $INSTRUMENTAL && $TRAVIS_PULL_REQUEST != "false" ]]; then
instrumental -f .instrumental.cov -s | python diff-instrumental.py --read .diff-instrumental --fail-under 70 --max-difference -0.1
fi
# cosmic-ray (mutation testing) runs
- if [[ $MUTATION ]]; then cosmic-ray init cosmic-ray.toml session.sqlite; fi
- if [[ $MUTATION ]]; then cosmic-ray baseline --report session.sqlite; fi
- if [[ $MUTATION ]]; then cr-report --show-output session.baseline.sqlite; fi
- |
if [[ $MUTATION ]]; then
cosmic-ray exec session.sqlite &
COSMIC_PID=$!
# make sure that we output something every 5 minutes (otherwise travis will kill us)
while kill -s 0 $COSMIC_PID; do
sleep 300
cr-report session.sqlite | tail -n 3;
done &
REPORT_PID=$!
# kill exec after 25 minutes
(sleep $((60*25)); kill $COSMIC_PID) &
fi
- if [[ $MUTATION ]]; then wait $COSMIC_PID ; kill $REPORT_PID ; true; fi
- if [[ $MUTATION ]]; then cr-report --show-output session.sqlite | tail -n 40; fi
- if [[ $MUTATION ]]; then cr-rate --estimate --fail-over 25 --confidence 99.9 session.sqlite; fi
after_success:
- if [[ -z $INSTRUMENTAL ]]; then coveralls; fi
- if [[ -z $INSTRUMENTAL && -z $MUTATION ]]; then coveralls; fi

10 changes: 10 additions & 0 deletions cosmic-ray.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

cosmic-ray init cosmic-ray.toml session.sqlite
cosmic-ray baseline --report session.sqlite
cr-report --show-output session.baseline.sqlite
cosmic-ray exec session.sqlite
cr-report session.sqlite
cr-html session.sqlite > session.html
cr-rate --estimate --fail-over 25 --confidence 99.9 session.sqlite
18 changes: 18 additions & 0 deletions cosmic-ray.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[cosmic-ray]
module-path = "src"
python-version = ""
timeout = 300.0
exclude-modules = ['src/ecdsa/_version.py', 'src/ecdsa/test*']
test-command = "pytest -x src/"

[cosmic-ray.execution-engine]
name = "local"

[cosmic-ray.cloning]
method = "copy"
commands = []

[cosmic-ray.interceptors]
enabled = [ "spor", "pragma_no_mutate", "operators-filter",]

[cosmic-ray.operators-filter]

0 comments on commit c36a853

Please sign in to comment.