Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combining/merging multiple MOcov json reports? #12

Open
mathieuboudreau opened this issue May 9, 2018 · 2 comments
Open

Combining/merging multiple MOcov json reports? #12

mathieuboudreau opened this issue May 9, 2018 · 2 comments

Comments

@mathieuboudreau
Copy link
Contributor

mathieuboudreau commented May 9, 2018

I'm wondering if this is a feature/function that would be "easy" to implement. I'm not too familiar with what's under the hood of MOcov yet, so I'm not sure if it would be easy to reuse some of your functions to help with this.

The reason I need this is because TRAVIS tests are limited to 30 minutes per job, which means that our project needs to split our MOxUnit tests calls in TRAVIS into multiple jobs.

e.g.


jobs:
  include:
    - stage: Test 
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible/quickMoxTests');res=moxunit_runtests('-recursive');exit(~res);"
    - stage: Test
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible');res=moxunit_runtests('BatchExample_test.m');exit(~res);"
    # Paste Sim_test commands below 
    # Pay attention to the indentation! Make them look like -stage and script lines above.
    - stage: Test
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible');res=moxunit_runtests('SimTest_charmed.m');exit(~res);"
    - stage: Test
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible');res=moxunit_runtests('SimTest_dti.m');exit(~res);"
    - stage: Test
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible');res=moxunit_runtests('SimTest_noddi.m');exit(~res);"
    - stage: Test
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible');res=moxunit_runtests('SimTest_qmt_bssfp.m');exit(~res);"
    - stage: Test
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible');res=moxunit_runtests('SimTest_qmt_sirfse.m');exit(~res);"
    - stage: Test
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible');res=moxunit_runtests('SimTest_qmt_spgr.m');exit(~res);"
    - stage: Test
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible');res=moxunit_runtests('SimTest_inversion_recovery.m');exit(~res);"
    - stage: Test
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible');res=moxunit_runtests('SimTest_vfa_t1.m');exit(~res);"
    - stage: Test
      script: travis_wait 30 octave --no-gui --eval "bootstrapTest;cd('/home/travis/build/neuropoly/qMRLab/Test/MoxUnitCompatible');res=moxunit_runtests('SimTest_mwf.m');exit(~res);"

This means that we need to do multiple calls to MOcov, which will generate multiple coverage.json files.

This would be a really useful feature, which other coverage software have (e.g. Python's coverage package has a coverage combine option: http://coverage.readthedocs.io/en/latest/cmd.html#combining-data-files)

@mathieuboudreau
Copy link
Contributor Author

I think something like this would have the functionality I'd want: https://gist.github.com/mathieuboudreau/ec85853f8b0c587bd4f0806c046181fa

I went through the MOcov code – it appears you've only got code to write JSON files and not read them, so I used JSONlab as my JSON file loader.

I guess I could just use my own function for this, but I think it would fit well within MOcov's functionality to include it.

@nno
Copy link
Contributor

nno commented May 10, 2018

I didn't look in detail into JSONlab, but would it help to include some option in moxunit_runtests to specify a list of JSON input files with coverage? Then moxunit_runtests could read those files and combine coverage, and store a big JSON file combining its current coverage with those from the other JSON files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants