dolphin-acoustics-vip / artwarp

MATLAB program for automated categorisation of tonal animal sounds
https://github.com/dolphin-acoustics-vip/artwarp/wiki
GNU Lesser General Public License v3.0
7 stars 10 forks source link

Add new test for initialization of Category #56

Closed tatedunbar closed 9 months ago

tatedunbar commented 9 months ago

Only tests category initialization to increase code coverage, as no other functions in Category.m have been written yet.

olexandr-konovalov commented 9 months ago

@tatedunbar thanks! Any ideas why https://github.com/dolphin-acoustics-vip/artwarp/actions/runs/7942238328/job/21685347941?pr=56 fails?

 ================================================================================
  Error occurred in category_test/category_test and it did not run to completion.
      ---------
      Error ID:
      ---------
      'MATLAB:UndefinedFunction'
      --------------
      Error Details:
      --------------
      Undefined function 'eq' for input arguments of type 'Contour'.

      Error in category_test (line 11)
      assert(cat.reference == contours(1), "Problem with initializing reference
      contour");
  ================================================================================
tatedunbar commented 9 months ago

@olexandr-konovalov I believe it's because using '==' compares whether the objects have the same handle. I'll try changing it to 'isequal', which should compare the properties they contain.

codecov[bot] commented 9 months ago

Codecov Report

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

Comparison is base (aa23247) 8.02% compared to head (7b4f86b) 8.39%.

Files Patch % Lines
tst/category_test.m 0.00% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #56 +/- ## ======================================== + Coverage 8.02% 8.39% +0.37% ======================================== Files 18 19 +1 Lines 399 405 +6 ======================================== + Hits 32 34 +2 - Misses 367 371 +4 ```

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

olexandr-konovalov commented 9 months ago

@tatedunbar it looks like you have added test - 8.39% (+0.37%) is the increase of coverage. We should merge this on Tuesday.

It however complains about the test file not covered - I think we might have to add (in another pull request) a .codecov.yml file similar to https://github.com/gap-packages/wedderga/blob/master/.codecov.yml in which we will exclude tst itself from coverage.