Skip to content

Commit 304263b

Browse files
committed
provide debugging information in mutation run, upload mutation report
1 parent 5025ce3 commit 304263b

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ jobs:
215215
if: ${{ contains(matrix.tox-env, 'gmpyp') }}
216216
run: pip install gmpy
217217
- name: Install gmpy2 dependencies
218-
if: ${{ contains(matrix.tox-env, 'gmpy2') || contains(matrix.tox-env, 'instrumental') }}
218+
if: ${{ contains(matrix.tox-env, 'gmpy2') || contains(matrix.tox-env, 'instrumental') || matrix.mutation == 'true' }}
219219
run: sudo apt-get install -y libmpfr-dev libmpc-dev
220220
- name: Install gmpy2
221-
if: ${{ contains(matrix.tox-env, 'gmpy2') || contains(matrix.tox-env, 'instrumental') }}
221+
if: ${{ contains(matrix.tox-env, 'gmpy2') || contains(matrix.tox-env, 'instrumental') || matrix.mutation == 'true' }}
222222
run: pip install gmpy2
223223
- name: Install build dependencies (2.6)
224224
if: ${{ matrix.python-version == '2.6' }}
@@ -268,7 +268,7 @@ jobs:
268268
- name: Install mutation testing dependencies
269269
if: ${{ matrix.mutation == 'true' }}
270270
run: |
271-
pip install https://github.com/tomato42/cosmic-ray/archive/random-order.zip
271+
pip install https://github.com/sixty-north/cosmic-ray/archive/master.zip
272272
- name: Display installed python package versions
273273
run: pip list
274274
- name: Test native speed
@@ -296,27 +296,38 @@ jobs:
296296
cosmic-ray init cosmic-ray.toml session-vs-master.sqlite
297297
git branch master origin/master
298298
cr-filter-git --config cosmic-ray.toml session-vs-master.sqlite
299-
cr-report session-vs-master.sqlite | tail -n 5
299+
cr-report session-vs-master.sqlite | tail -n 3
300300
- name: Exec mutation testing for PR
301301
if: ${{ matrix.mutation == 'true' && github.event.pull_request }}
302302
run: |
303-
systemd-run --user --scope -p MemoryMax=2G -p MemoryHigh=2G cosmic-ray exec cosmic-ray.toml session-vs-master.sqlite &
303+
systemd-run --user --scope -p MemoryMax=2G -p MemoryHigh=2G cosmic-ray --verbosity INFO exec cosmic-ray.toml session-vs-master.sqlite &
304304
cosmic_pid=$!
305-
for i in $(seq 1 10); do
306-
echo $i
307-
for j in $(seq 1 60); do
308-
echo -n .
309-
sleep 1
310-
done
305+
for i in $(seq 1 600); do
306+
# wait for test execution at most 10 minutes
307+
kill -s 0 $cosmic_pid || break
308+
sleep 1
311309
done
312-
kill $cosmic_pid
310+
kill $cosmic_pid || true
313311
wait $cosmic_pid || true
314312
- name: Check test coverage for PR
315313
if: ${{ matrix.mutation == 'true' && github.event.pull_request }}
316314
run: |
317315
# remove not-executed results
318316
sqlite3 session-vs-master.sqlite "DELETE from work_results WHERE work_results.worker_outcome = 'SKIPPED'"
319-
cr-report session-vs-master.sqlite | tail -n 5
317+
cr-report session-vs-master.sqlite | tail -n 3
318+
- name: Generate html report
319+
if: ${{ matrix.mutation == 'true' && github.event.pull_request }}
320+
run: |
321+
cr-html session-vs-master.sqlite > cosmic-ray.html
322+
- name: Archive mutation testing results
323+
if: ${{ matrix.mutation == 'true' && github.event.pull_request }}
324+
uses: actions/upload-artifact@v3
325+
with:
326+
name: mutation-PR-coverage-report
327+
path: cosmic-ray.html
328+
- name: Check test coverage for PR
329+
if: ${{ matrix.mutation == 'true' && github.event.pull_request }}
330+
run: |
320331
# check if executed have at most 15% survival rate
321332
cr-rate --estimate --confidence 99.9 --fail-over 15 session-vs-master.sqlite
322333
- name: instrumental test coverage on PR
@@ -399,7 +410,7 @@ jobs:
399410
key: sessions-${{ github.sha }}
400411
- name: Install cosmic-ray
401412
run: |
402-
pip3 install https://github.com/tomato42/cosmic-ray/archive/random-order.zip
413+
pip3 install https://github.com/sixty-north/cosmic-ray/archive/master.zip
403414
- name: Install dependencies
404415
run: |
405416
sudo apt-get install -y sqlite3
@@ -474,7 +485,7 @@ jobs:
474485
- name: Install build dependencies
475486
run: |
476487
pip install -r build-requirements.txt
477-
pip install https://github.com/tomato42/cosmic-ray/archive/random-order.zip
488+
pip install https://github.com/sixty-north/cosmic-ray/archive/master.zip
478489
- name: Run mutation testing
479490
run: |
480491
cp sessions/session-${{ matrix.name }}.sqlite session.sqlite
@@ -621,7 +632,7 @@ jobs:
621632
key: sessions-${{ github.sha }}-19-done
622633
- name: Install cosmic-ray
623634
run: |
624-
pip3 install https://github.com/tomato42/cosmic-ray/archive/random-order.zip
635+
pip3 install https://github.com/sixty-north/cosmic-ray/archive/master.zip
625636
- name: Install dependencies
626637
run: |
627638
sudo apt-get install -y sqlite3

0 commit comments

Comments
 (0)