-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Integration tests state setup #11
Comments
I don't really understand why the same posts, tags and users are being redefined in some of the files, or why other fixture files exist but are empty. Seems like the original concept got misused, but I also see that all the code to have naming logic for each test suite got ripped out. |
@ErisDS atm, the empty files are: one-to-one and one-to-many relations fixtures. They are empty as we don't have any support for those relations just yet and will be filled out as we need them. As for 'many-to-many-extended' fixture redefining state, it hasn't been worked on and I did misunderstand it's usage in the beginning, will clean that up.
Which part are you referring to exactly? |
This commit results in quite a change to the idea behind the test framework that was in place to start with: |
I think the test env is fine as it is? We define resources in There are for sure ideas/improvements we can add to any test env we have 👻I am not sure it's worth leaving this issue open? 🤔 I doubt somebody will have time to optimise the test env 🤓 What i experienced in the past: most of the time test env improvements happen natuarly. If you need them, you add them. If something sucks while you write tests, you change it. @gargol feel free to either leave the issue open or close 🤘🏽 The only thing we could do quickly is to remove the empty fixture files e.g. https://github.com/NexesJS/mongo-knex/blob/master/test/integration/suite1/fixtures/one-to-many.json? 🤔 This is maybe a little bit confusing. These test cases are anyway not supported and skipped.
All of the original test env is still in place, except of the smart file name detection. When i was trying to get the tests fully working i had trouble working with it. |
refs https://github.com/NexesJS/mongo-knex/issues/19#issuecomment-444237523 - one-to-many and one-to-one is not implemented - removed related files - they were empty anyway
refs https://github.com/NexesJS/mongo-knex/issues/19#issuecomment-444237523 - one-to-many and one-to-one is not implemented - removed related files - they were empty anyway
The bigger the test suite for integration tests becomes, the harder it's to achieve a certain state for a test case. Opening this issue as a ground for discussion on how things could be improved.
As an example, checking if a certain record belongs to a specific relational filter takes to look up:
posts
collection inbase.json
,many-to-many.json
base.json
and checktags
collection thereWhen there are multiple records/properties matching this 3 step process becomes over cumbersome.
One of the thoughts around making things easier to check would be not having a global state like
base.json
but a set of helper functions that would set up the state in few steps. The downside of this approach is more work in the test case setup, but than it's a lot more clear which cases are being expected to be returned. Hard to find a good middle ground here 🤷♂️Don't have any specific recepie and current approach is good enough :) Just opening this issue as a discussion to try improve future test suite maintenance and development.
The text was updated successfully, but these errors were encountered: