typedb / typedb-behaviour

TypeDB Behaviour Test Specification
Mozilla Public License 2.0
10 stars 19 forks source link

Concept Type BDDs for all the types, edges, its annotations and ordering #287

Closed farost closed 5 months ago

farost commented 5 months ago

Usage and product changes

We refactor already existing BDDs for concept/type package, adding new base cases of type manipulations and refactoring already existing cases for better scalability in the future.

We add tests for all the annotations from 3.0 and basic lists (of roles and of owns) manipulations for:

The ultimate goal of this PR is to have decent coverage for schema and refactor the concept/type tests so this format could be reused in concept/thing later on, additionally being available for small additions on the schema level.

Moreover, all the files now tend to have structure for easier test cases search:

Implementation

I won't put many additional comments inside the steps declarations, here is the whole process of additions and refactoring and my logic behind it:

Setup:

Owns:

Plays: I copied the base of owns tests and followed the same ideas. The main differences here:

Entity type and Relation type: Followed a similar approach as for plays, haven't refactored old tests much, but tried to cover annotations decently. Relation types also received additional special tests for relates (roles) and lists of relates.

Attribute type: Closer to owns for easier changes and scalability regarding annotations, but active in using the old tests for simple cases.

Addons:

typedb-bot commented 5 months ago

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Trivial Change

Code

Architecture

farost commented 5 months ago

I added some new TODOs for me to address. I'll add a new comment here when the PR is ready for a new review cycle. Otherwise, you can check my answers to the previous comments and check the new commits!

farost commented 5 months ago

Had a huge update over all the tests in this PR based on the implemented logic on the server side!

There are too many details to mention, all the valuable discussions and decisions were highlighted in our Discord.

There is still a number of TODOs for future work on schema validation, not implemented features and small stuff, but it looks like we can merge it in this form and address it later.

Currently, all the tests in type pass for my branch with validations and fixes: https://github.com/vaticle/typedb/pull/7094

farost commented 5 months ago

Honestly, I feel like there are some of the tests written for some of edges (owns/relates/plays) that are not explicitly covered by other edges, but there is too many things in the scope at the moment. I tried to cover everything thoroughly and can guarantee 95% of the cases to be covered by the tests, the rest I'm sure we'll check through test coverage checks later