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

Tests: Add Tests to contains Filter Operator on PostgreSQL Backend #6617

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

rabbull
Copy link
Contributor

@rabbull rabbull commented Nov 19, 2024

This PR adds tests to validate the behavior of the contains operator when applied to JSON objects and arrays in the PostgreSQL backend. The tests cover a variety of scenarios, including type matching, negations, and edge cases such as empty arrays or objects. This is a test-only PR, and no features or functionality in aiida-core have been modified.

Some corner case behaviors appear unintuitive and will be documented in a separate issue for further investigation.

@rabbull rabbull requested a review from GeigerJ2 November 19, 2024 12:30
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.90%. Comparing base (ef60b66) to head (2113fa9).
Report is 140 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6617      +/-   ##
==========================================
+ Coverage   77.51%   77.90%   +0.40%     
==========================================
  Files         560      567       +7     
  Lines       41444    42147     +703     
==========================================
+ Hits        32120    32831     +711     
+ Misses       9324     9316       -8     

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

Copy link
Contributor

@GeigerJ2 GeigerJ2 left a comment

Choose a reason for hiding this comment

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

Great work, @rabbull, thanks for adding those extensive tests. I'd say we get this merged, and then figure out how we can resolve the unexpected behaviors.

I'd use the first paragraph of this PR description as the commit message for the squashed commit. Is that fine for you, or would you like something else? If so, please comment the text here. Thanks!

@rabbull
Copy link
Contributor Author

rabbull commented Nov 20, 2024

I'd use the first paragraph of this PR description as the commit message for the squashed commit.

Sure, this LGTM. :)

Copy link
Contributor

@GeigerJ2 GeigerJ2 left a comment

Choose a reason for hiding this comment

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

Very nice work, thanks a lot for extending the tests so thoroughly, @rabbull! Some minor proposals to extend them further.

tests/orm/test_querybuilder.py Show resolved Hide resolved
tests/orm/test_querybuilder.py Show resolved Hide resolved
tests/orm/test_querybuilder.py Show resolved Hide resolved
tests/orm/test_querybuilder.py Show resolved Hide resolved
tests/orm/test_querybuilder.py Show resolved Hide resolved
@GeigerJ2 GeigerJ2 merged commit c789d0a into aiidateam:main Nov 26, 2024
10 checks passed
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.

2 participants