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

test: Improve test for serving ontologies in different formats #3115

Merged
merged 32 commits into from
Mar 20, 2024

Conversation

BalduinLandolt
Copy link
Contributor

@BalduinLandolt BalduinLandolt commented Mar 13, 2024

Pull Request Checklist

Task Description

This PR attempts to make the approval tests more ergonomic and feel more like "real" approval tests.
It also removes redundant test cases.

  • The knora-api can be retrieved through two separate routes; instead of checking both against the same files, the test now ensures that both routes return the same content.
  • The number of test cases was radically reduced
    • testing exactly the following things (both in simple and complex schema; and in the formats turtle, JSON-LD and RDF-XML):
      • the built-in ontologies knora-api, salsah-gui and standoff
      • a class definition from a built-in ontology
      • a property definition from a built-in ontology
      • metadata of a project ontology
      • a project ontology
      • a project ontology returning labels in all languages
      • a class definition of a project ontology
      • a property definition of a project ontology
    • the following test cases were removed because they were redundant according to the above systematic
      • allOntologyMetadata
      • incunabulaOntologyMetadata
      • beolOntologyMetadata
      • incunabulaOntologySimple
      • incunabulaOntologyWithValueObjects
      • knoraApiSimpleHasColor
      • knoraApiWithValueObjectsHasColor
      • incunabulaSimplePubDate
      • incunabulaWithValueObjectsPubDate
      • incunabulaPageAndBookWithValueObjects
      • boxOntologyWithValueObjects
      • minimalOntologyWithValueObjects
      • imagesBild
      • incunabulaBook
      • incunabulaPage
      • anythingHasDate
      • imagesTitel
      • incunabulaPartOf
    • the following test cases have been added to fulfil the above systematic
      • anythingOntologySimple
      • anythingHasListItemSimple
      • anythingHasListItem
      • anythingThingSimple
      • anythingThing
    • the following test cases are no longer available in the client test data
      • all-ontology-metadata-response
      • get-ontologies-project-incunabula-response
      • get-ontologies-project-beol-response
      • incunabula-ontology
      • minimal-ontology
      • get-class-image-bild-response
      • get-class-incunabula-book-response
      • get-property-DateValue-response
      • get-property-textValue-response
      • get-property-linkvalue-response

PR Type

  • build/chore: maintenance tasks (no production code change)
  • docs: documentation changes (no production code change)
  • feat: represents new features
  • fix: represents bug fixes
  • perf: performance improvements
  • refactor: represents production code refactoring
  • test: adding or refactoring tests (no production code change)

Basic requirements for bug fixes and features

  • Tests for the changes have been added
  • Docs have been added / updated

Does this PR introduce a breaking change?

  • Yes

Does this PR change client-test-data?

  • Yes

@BalduinLandolt BalduinLandolt self-assigned this Mar 13, 2024
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 13.15%. Comparing base (eac5751) to head (fdc73a3).
Report is 143 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3115      +/-   ##
==========================================
+ Coverage   11.74%   13.15%   +1.40%     
==========================================
  Files         246      264      +18     
  Lines       22907    22395     -512     
==========================================
+ Hits         2690     2945     +255     
+ Misses      20217    19450     -767     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BalduinLandolt BalduinLandolt changed the base branch from main to wip/attempt-cherry-pick March 19, 2024 08:28
@BalduinLandolt BalduinLandolt force-pushed the wip/move-ontology-test-to-separate-file branch from af5d793 to 6ddc1df Compare March 19, 2024 08:39
@BalduinLandolt BalduinLandolt changed the title test: Move test for serving ontologies in different formats to separate file test: Improve test for serving ontologies in different formats Mar 19, 2024
Base automatically changed from wip/attempt-cherry-pick to main March 19, 2024 09:38
@BalduinLandolt BalduinLandolt marked this pull request as ready for review March 19, 2024 10:00
Copy link
Contributor

@siers siers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Judging by the description sounds good, however one question – could it be that some routes now have less integration test coverage?

@BalduinLandolt
Copy link
Contributor Author

Judging by the description sounds good, however one question – could it be that some routes now have less integration test coverage?

this test (mostly) only tests one route, so it is fairly confined where we might have lost coverage. The only thing I can think of that might have lost test coverage now, is if we have any ontology features that were used in some of the no-longer-requested project ontologies, but are not used in the anything ontology (which is still tested here). But this would be limited to things like different value types or stuff like that, so if we lose any coverage here at all, it should only be stuff that is covered by other tests. But I can't say 100% for sure.

Copy link
Contributor

@mpro7 mpro7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess corresponding tests tests need to be removed on the dsp-js side... :)

@BalduinLandolt BalduinLandolt enabled auto-merge (squash) March 20, 2024 11:08
BalduinLandolt added a commit to dasch-swiss/dsp-js-lib that referenced this pull request Mar 20, 2024
@BalduinLandolt BalduinLandolt merged commit a010275 into main Mar 20, 2024
13 checks passed
@BalduinLandolt BalduinLandolt deleted the wip/move-ontology-test-to-separate-file branch March 20, 2024 11:28
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

Successfully merging this pull request may close these issues.

4 participants