From 037a9686a717c0a08ef413524f40c37de9a378fa Mon Sep 17 00:00:00 2001 From: Johannes Feldmann Date: Tue, 18 Dec 2018 09:39:48 +0100 Subject: [PATCH] Parallel Code Coverage for CI --- .gitlab-ci.yml | 7 ++++++- DRAMSys/tests/DDR3/ci.yml | 13 +++++++++++++ DRAMSys/tests/WIDEIO/ci.yml | 5 ++++- README.md | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac93cca1..df341f76 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,12 +23,17 @@ build: - cd build - qmake ../DRAMSys/DRAMSys.pro - make -j4 + - mkdir -p coverage coverage: stage: Coverage coverage: '/^TOTAL.*\s+(\d+\%)$/' script: - - gcovr -r build/ + - lcov `find coverage -type f -exec echo "-a {}" \;` -o coverage/final.out + artifacts: + paths: + - coverage/final.out + include: - '/DRAMSys/tests/DDR3/ci.yml' diff --git a/DRAMSys/tests/DDR3/ci.yml b/DRAMSys/tests/DDR3/ci.yml index 06cdadfa..7462848f 100644 --- a/DRAMSys/tests/DDR3/ci.yml +++ b/DRAMSys/tests/DDR3/ci.yml @@ -10,9 +10,12 @@ example_ddr3: - perl -e 'if(`sqldiff ../../DRAMSys/tests/DDR3/expected/ddr3-example_ddr3_ch0.tdb ddr3-example_ddr3_ch0.tdb` eq "") {exit(0)} else {exit(-1)}' - cd ../traceAnalyzer - python3 ../../DRAMSys/traceAnalyzer/scripts/tests.py ../simulator/ddr3-example_ddr3_ch0.tdb | if ! grep "failed"; then exit 0; else exit 1; fi + # Run Code Coverage + - lcov -c -d build/ -o coverage/{$CI_JOB_NAME}.out artifacts: paths: - build/simulator/ddr3-example_ddr3_ch0.tdb + - coverage/{$CI_JOB_NAME}.out expire_in: 2 days # Testing Reordering with FR_FCFS Scheduling Algorithm: @@ -27,12 +30,15 @@ fr_fcfs: - perl -e 'if(`sqldiff ../../DRAMSys/tests/DDR3/expected/ddr3-fr_fcfs_ddr3_ch0.tdb ddr3-fr_fcfs_ddr3_ch0.tdb` eq "") {exit(0)} else {exit(-1)}' - cd ../traceAnalyzer - python3 ../../DRAMSys/traceAnalyzer/scripts/tests.py ../simulator/ddr3-fr_fcfs_ddr3_ch0.tdb | if ! grep "failed"; then exit 0; else exit 1; fi + # Run Code Coverage + - lcov -c -d build/ -o coverage/{$CI_JOB_NAME}.out allow_failure: true # TODO should be removed after first tests artifacts: paths: - build/simulator/ddr3-fr_fcfs_ddr3_ch0.tdb + - coverage/{$CI_JOB_NAME}.out expire_in: 2 days # Testing with TLM Protocol Cchecker @@ -42,3 +48,10 @@ protocol_checker: - cd build/simulator - ./DRAMSys ../../DRAMSys/tests/DDR3/simulations/ddr3-protocol_checker.xml ../../DRAMSys/tests/DDR3/ - echo "TODO" + # Run Code Coverage + - lcov -c -d build/ -o coverage/{$CI_JOB_NAME}.out + + artifacts: + paths: + - coverage/{$CI_JOB_NAME}.out + expire_in: 2 days diff --git a/DRAMSys/tests/WIDEIO/ci.yml b/DRAMSys/tests/WIDEIO/ci.yml index 76ca5555..445a8596 100644 --- a/DRAMSys/tests/WIDEIO/ci.yml +++ b/DRAMSys/tests/WIDEIO/ci.yml @@ -15,7 +15,9 @@ example_wideio: - python3 ../../DRAMSys/traceAnalyzer/scripts/tests.py ../simulator/wideio-example_wideio_ch1.tdb | if ! grep "failed"; then exit 0; else exit 1; fi - python3 ../../DRAMSys/traceAnalyzer/scripts/tests.py ../simulator/wideio-example_wideio_ch2.tdb | if ! grep "failed"; then exit 0; else exit 1; fi - python3 ../../DRAMSys/traceAnalyzer/scripts/tests.py ../simulator/wideio-example_wideio_ch3.tdb | if ! grep "failed"; then exit 0; else exit 1; fi - + # Run Code Coverage + - lcov -c -d build/ -o coverage/{$CI_JOB_NAME}.out + allow_failure: true # TODO: should be removed once the problems are fixed! artifacts: @@ -24,5 +26,6 @@ example_wideio: - build/simulator/wideio-example_wideio_ch1.tdb - build/simulator/wideio-example_wideio_ch2.tdb - build/simulator/wideio-example_wideio_ch3.tdb + - coverage/{$CI_JOB_NAME}.out expire_in: 2 days diff --git a/README.md b/README.md index 22db70c4..ac7101e3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ framework that consists of models reflecting the DRAM functionality, power consumption, temperature behaviour and retention time errors. Pipeline Status: [![pipeline status](https://git.eit.uni-kl.de/ems/astdm/dram.sys/badges/master/pipeline.svg)](https://git.eit.uni-kl.de/ems/astdm/dram.sys/commits/master) - +[![Coverage report](https://git.eit.uni-kl.de/ems/astdm/dram.sys/badges/master/coverage.svg?job=coverage)](https://git.eit.uni-kl.de/ems/astdm/dram.sys/commits/master) ## Basic Setup Open a terminal window, go to your home directory, create a directory for your