ontoportal-lirmm / ontologies_linked_data

Models and serializers for ontologies and related artifacts backed by 4store
Other
0 stars 6 forks source link

Feature: Optimize tests run time by 50% #107

Closed syphax-bouazzouni closed 6 months ago

syphax-bouazzouni commented 10 months ago

Context

This PR, does a clean-up of the tests, to make them run faster. Before this optimization, all the tests ran under 19,5 minutes (and 40 minutes in my local machine), image

and now it takes 9,85 minutes (and 20 minutes locally).

image

This improvement was done, by making the following changes:

  1. Parse the tested ontologies, only if needed.
  2. For the test that needs to parse ontology, disable the indexing and the extract metadata steps that take too much time and are not needed for most of the test.
  3. Remove parsing the same ontologies multiple times in different tests, trying to parse only once for a set of tests.
codecov[bot] commented 6 months ago

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (d5af89b) 80.49% compared to head (f0025c2) 79.94%.

Files Patch % Lines
...tologies_linked_data/models/ontology_submission.rb 60.00% 6 Missing :warning:
...ology_submissions/submission_metadata_extractor.rb 66.66% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## development #107 +/- ## =============================================== - Coverage 80.49% 79.94% -0.56% =============================================== Files 84 84 Lines 6131 6132 +1 =============================================== - Hits 4935 4902 -33 - Misses 1196 1230 +34 ``` | [Flag](https://app.codecov.io/gh/ontoportal-lirmm/ontologies_linked_data/pull/107/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ontoportal-lirmm) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/ontoportal-lirmm/ontologies_linked_data/pull/107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ontoportal-lirmm) | `79.94% <69.23%> (-0.56%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ontoportal-lirmm#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.