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

Switch mongo tests from randint to uuid #2591

Merged
merged 2 commits into from
Feb 15, 2023
Merged

Switch mongo tests from randint to uuid #2591

merged 2 commits into from
Feb 15, 2023

Conversation

sanders41
Copy link
Contributor

@sanders41 sanders41 commented Feb 14, 2023

Relates to #2178

Code Changes

  • Switch from randint to uuid in mongo tests

Steps to Confirm

  • verify mongo tests pass

Pre-Merge Checklist

Description Of Changes

The random int used in mongo tests is random, but not unique. The mongo tests don't clear out records between tests so by chance it is possible to have a clash in ids. This PR changes the use of random ints to using uuids. This is one of the causes mongo tests are flaky in CI, but I suspect it isn't the only reason so there is probably more to do here.

@cypress
Copy link

cypress bot commented Feb 14, 2023

Passing run #74 ↗︎

0 3 0 0 Flakiness 0

Details:

Merge 2d1469f into 9b9a03a...
Project: fides Commit: 39e6a95a13 ℹ️
Status: Passed Duration: 00:54 💡
Started: Feb 14, 2023 6:07 PM Ended: Feb 14, 2023 6:08 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Base: 85.74% // Head: 85.74% // No change to project coverage 👍

Coverage data is based on head (2d1469f) compared to base (9b9a03a).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2591   +/-   ##
=======================================
  Coverage   85.74%   85.74%           
=======================================
  Files         285      285           
  Lines       15477    15477           
  Branches     1945     1945           
=======================================
  Hits        13270    13270           
  Misses       1832     1832           
  Partials      375      375           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@ThomasLaPiana ThomasLaPiana left a comment

Choose a reason for hiding this comment

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

Great change here, I wonder if this might fix some of the pymongo update bugs I've been seeing too 🤔 (it was complaining about invalid UUID stuff)

@sanders41 sanders41 merged commit 9636222 into main Feb 15, 2023
@sanders41 sanders41 deleted the mongo-tests branch February 15, 2023 10:43
@sanders41
Copy link
Contributor Author

In 3.8 of pymomgo there was a change to the ObjectID format and it has to be 12 bytes in a specific format https://www.mongodb.com/docs/manual/reference/method/ObjectId/. I bet this is the error.

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