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

[Task] write unit tests for the most important beng-lod-server functions #189

Open
wmelder opened this issue Apr 8, 2022 · 7 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@wmelder
Copy link
Contributor

wmelder commented Apr 8, 2022

Roadmap: https://docs.google.com/spreadsheets/d/1mun1uFaws5TBkb_fQmonxmGSWhIYsF5lg0Ffous0Nis/edit#gid=0&range=J24

Include a test for each different 'branch' of the payload_to_rdf functions in NISVRdfConcept and SDORdfConcept, so that we can be sure when we change something that all the cases are still being correctly created.

@KleinRana
Copy link

@wmelder , @jblom zijn er nu unittests voor alle belangrijke functies en is dit bijgewerkt voor de status quo

@wmelder
Copy link
Contributor Author

wmelder commented May 19, 2022

ik weet niet of alle belangrijke functies voorzien zijn... jaap heeft in #191 de basic functions gedaan...

@wmelder
Copy link
Contributor Author

wmelder commented May 19, 2022

ik update in ieder geval wel de laatste dev branches met deze unittests.

@gb-beng gb-beng reopened this Jun 15, 2022
@gb-beng
Copy link
Contributor

gb-beng commented Jun 15, 2022

Reopened to complete more extensive tests.

@gb-beng gb-beng assigned wmelder and gb-beng and unassigned jblom Jun 15, 2022
@gb-beng
Copy link
Contributor

gb-beng commented Jun 17, 2022

Besides any important functions that @wmelder can suggest based on his overview of the codebase, we can take a look at the coverage report to determine which tests to write :

---------- coverage: platform linux, python 3.8.13-final-0 -----------
Name                                         Stmts   Miss  Cover
----------------------------------------------------------------
src/apis/__init__.py                            28      6    79%
src/apis/dataset/DataCatalogLODHandler.py      139     68    51%
src/apis/dataset/dataset_api.py                 65     37    43%
src/apis/gtaa/gtaa_api.py                       37     25    32%
src/apis/health/health_api.py                   19      9    53%
src/apis/mime_type_util.py                      73     46    37%
src/apis/resource/DAANStorageLODHandler.py      16     11    31%
src/apis/resource/StorageLODHandler.py          70     16    77%
src/apis/resource/resource_api.py               53     40    25%
src/models/BaseRdfConcept.py                   101     26    74%
src/models/SDORdfConcept.py                    236     97    59%
src/util/APIUtil.py                             81     37    54%
src/util/OpenBeeldenLinkRetriever.py           209    157    25%
src/util/base_util.py                           84     70    17%
src/util/ld_util.py                            140     24    83%
----------------------------------------------------------------
TOTAL                                         1622    669    59%
* i've omitted files with 100% coverage

Likewise we can look at the coverage for type annotations:

 ln_typ  ln_tot fn_typ fn_tot module * not sure if i'm interpreting these columns correctly
---------------------------------------------------------------------------------
    105     169      5      8 util.base_util
     88     132      2      3 gtaa_api
     55      93      3      5 apis.mime_type_util
     54     216      1      4 dataset_api
     49     149      1      3 resource_api
     49     131      3      8 StorageLODHandler
     30      40      3      4 DependencyHealth
     19     326      1     17 DataCatalogLODHandler
      0     735      0     10 SDORdfConcept
      0     465      0      8 util.OpenBeeldenLinkRetriever
      0     335      0      4 NISVRdfConcept
      0     332      0      7 tests.unit_tests.util.ld_util_test
      0     220      0      6 tests.unit_tests.apis.resource.sdo_storage_lod_handler_test
      0     174      0     13 tests.conftest
      0     158      0      6 BaseRdfConcept
      0     142      0      7 DAANSchemaImporter
      0     113      0      2 tests.unit_tests.apis.resource.storage_lod_handler_test
      0     104      0     13 util.APIUtil
      0      75      0      1 data_catalog_lod_handler_test
      0      69      0      1 DAANJsonModel
      0      53      0      2 server
      0      47      0      1 health_api
      0      41      0      2 DAANStorageLODHandler
      0      38      0      1 conftest
      0      34      0      2 SDOStorageLODHandler
      0      32      0      5 tests.unit_tests.apis.resource.conftest
      0      28      0      4 tests.unit_tests.util.conftest
      0      28      0      1 tests.unit_tests.util.openbeelden_link_retriever_test
      0      15      0      2 tests.base_test
      0      11      0      1 pong_api_test
      0      10      0      1 pong_api
---------------------------------------------------------------------------------
   1485    5551     34    167 total
* i've omitted files with 100% coverage and those without functions

Also to keep in mind: the future design. What code will we drop entirely.

@wmelder
Copy link
Contributor Author

wmelder commented Jun 17, 2022

impressive list. Good remark that some of the code will disappear completely in the future design, from this repo at least.

@wmelder
Copy link
Contributor Author

wmelder commented Dec 7, 2022

add more use cases for all return codes

@wmelder wmelder added the enhancement New feature or request label May 24, 2023
@gb-beng gb-beng removed their assignment Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants