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(i): Restructure mutation integration test dir #1848

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #1847

Description

Restructures mutation integration test dir.

The previous structure did not offer adequate levels of test discoverability, and as we really need to add more tests here, it needed sorting out.

Also, all tests (I think) in the mutation directory have been migrated to the newer test framework. A handful have been deleted, as the restructuring highlight a few duplicates. Some schemas have also been simplified.

Two production bugs tickets were opened during this work:

The scope of the work in this PR shifted after the first two commits as I realised it would be more effort than I first thought, as such the 2nd and 3rd commits do quite a lot. I want to further improve the tests moved in the other commits in a similar way, however this is already a very large PR, and I instead will do that in another block of work.

The commits are not as clean as I would like, but reviewing commit by commit will help you guys see where stuff has moved.

Existing tests will be moved here as they are updated, and then new ones will be defined. Sub-directories will be added in later commits.
And convert them to the newer test framework, and tweak a few to make use of the mutation-test action magic.
Notable changes:
- The datetime boolean tests have been removed - the boolean filter param is irrelevant to the datetime field type and it only complicates the reading of the test without offering any significant advantage RE protection.
- The datetime ids tests have been removed for the same reason as the boolean filter tests.
- A test using an UpdateDoc test action has been added, this gives basic coverage of the field type happy path
- A test using an update request has been added, this ensures that updating multiple docs in a single request is functional.
- All references to the dockeys have been removed, returning them in the query protects against very-little at best here whilst incuring an annoying maintanence cost.

The withFilter tests remain as is, whilst they are really not comprehensive, they do cover the tests removed from with_datetime_test, and are not particularly relevant to the goal of this PR (which has nothing to do with filters).
Also updates them to the new framework
Also updates them to the new framework
Also updates them to the new framework
Also updates them to the new framework
Also updates them to the new framework
Also updates them to the new framework
Also updates them to the new framework
Also updates them to the new framework
No test changes, all were already using the new framework
No test changes, all were already using the new framework
No test changes, all were already using the new framework
No test changes, all were already using the new framework
No test changes, all were already using the new framework
No test changes, all were already using the new framework
No test changes, all were already using the new framework
Also converts a few remaining on the old framework to the new framework.
And convert them to the newer test framework.
And convert them to newer framework.
@AndrewSisley AndrewSisley added area/testing Related to any test or testing suite code quality Related to improving code quality action/no-benchmark Skips the action that runs the benchmark. labels Sep 6, 2023
@AndrewSisley AndrewSisley added this to the DefraDB v0.7 milestone Sep 6, 2023
@AndrewSisley AndrewSisley requested a review from a team September 6, 2023 18:50
@AndrewSisley AndrewSisley self-assigned this Sep 6, 2023
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.18% ⚠️

Comparison is base (6bd4ee5) 75.71% compared to head (22e590d) 75.54%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1848      +/-   ##
===========================================
- Coverage    75.71%   75.54%   -0.18%     
===========================================
  Files          209      209              
  Lines        22261    22261              
===========================================
- Hits         16854    16815      -39     
- Misses        4237     4283      +46     
+ Partials      1170     1163       -7     
Flag Coverage Δ
all-tests 75.54% <ø> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6bd4ee5...22e590d. Read the comment docs.

Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

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

Cheers for sorting out! Looking forward to resolving the conflicts within #1749 😆

@AndrewSisley AndrewSisley merged commit 8b10d0b into sourcenetwork:develop Sep 6, 2023
14 checks passed
@AndrewSisley AndrewSisley deleted the 935-mutation-field-type-validation branch September 6, 2023 22:51
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#1847

## Description

Restructures mutation integration test dir.

The previous structure did not offer adequate levels of test
discoverability, and as we really need to add more tests here, it needed
sorting out.

Also, all tests (I think) in the `mutation` directory have been migrated
to the newer test framework. A handful have been deleted, as the
restructuring highlight a few duplicates. Some schemas have also been
simplified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/testing Related to any test or testing suite code quality Related to improving code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restructure mutation integration test dir
2 participants