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: Utility to compare two lists of documents for equality #6005

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

julian-risch
Copy link
Member

@julian-risch julian-risch commented Oct 9, 2023

Related Issues

contains_same_docs always returned True if the two input lists of documents had the same length. This happened because the implementation uses the return value of sort instead of sorted.
Four tests using the utility were actually broken due to issues in the implementation of the tests.

Proposed Changes:

  • Use sorted instead of sort, which returns the sorted list so that it can be compared to the other sorted list of documents.
  • Fix four broken tests that used the utility. Three of them contained just small mistakes. One had a problem comparing int -2 and float -2.0 for equality.

How did you test it?

Manual tests for the contains_same_docs. It's a small utility function of DocumentStoreBaseTests and I didn't want to add tests for it.
Updated unit tests.

Notes for the reviewer

Checklist

@julian-risch julian-risch added the ignore-for-release-notes PRs with this flag won't be included in the release notes. label Oct 9, 2023
@julian-risch julian-risch requested a review from a team as a code owner October 9, 2023 10:21
@julian-risch julian-risch requested review from silvanocerza and removed request for a team October 9, 2023 10:21
@github-actions github-actions bot added the type:documentation Improvements on the docs label Oct 9, 2023
@masci masci merged commit 12fe036 into main Oct 11, 2023
@masci masci deleted the fix-contains-same-docs branch October 11, 2023 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release-notes PRs with this flag won't be included in the release notes. type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants