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

Update mongo tests #47

Merged
merged 11 commits into from
Aug 21, 2023
Merged

Update mongo tests #47

merged 11 commits into from
Aug 21, 2023

Conversation

king-alexander
Copy link
Collaborator

@king-alexander king-alexander commented Mar 14, 2023

🗣 Description

These changes update tests that connect to a mock Mongo database.

💭 Motivation and context

🧪 Testing

I modified the tests that connect to a mock Mongo database to use the new connection method. After my changes, all tests passed locally.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

✅ Post-merge checklist

  • Create a release.

@king-alexander king-alexander added breaking change This issue or pull request involves changes to existing functionality improvement This issue or pull request will add or improve functionality, maintainability, or ease of use python Pull requests that update Python code labels Mar 14, 2023
@king-alexander king-alexander added test This issue or pull request adds or otherwise modifies test code question This issue is a request for information or needs discussion and removed breaking change This issue or pull request involves changes to existing functionality labels Mar 16, 2023
@king-alexander king-alexander mentioned this pull request Mar 21, 2023
2 tasks
@king-alexander king-alexander self-assigned this Jun 22, 2023
@king-alexander king-alexander removed the question This issue is a request for information or needs discussion label Jun 27, 2023
@king-alexander king-alexander marked this pull request as ready for review June 27, 2023 15:24
Copy link
Contributor

@jasonodoom jasonodoom left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

I have a few questions/comments.

.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
tests/test_util.py Outdated Show resolved Hide resolved
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

These changes look good to me, but I'll wait for the GH Actions checks to pass before actually approving.

@dav3r
Copy link
Member

dav3r commented Jul 11, 2023

These changes look good to me, but I'll wait for the GH Actions checks to pass before actually approving.

Yes, please let us know when the GH Actions all pass and then we will finalize our reviews.

@king-alexander
Copy link
Collaborator Author

I will add a test to boost coverage and make the Coveralls check happy.

The 'mongomock://' URI is deprecated, so the connection URIs now start
with 'mongodb://'.
This test broke once the 'mongomock://' URI was no longer supported. I
had to rewrite the test to use the new connection method.
The mongomock connection method introduced in MongoEngine 0.27.0 is not
recognized in Python 3.6.
This commit augments `connect_from_config()` with a `client` argument to
determine which client class to use when called. The default client
class for MongoEngine (`pymongo.MongoClient`) is explicitly made the
default value so alternative client classes can be specified where
necessary.
Connect MongoEngine with mongomock to test connections from a
configuration.
The 6.0 release contains a temporary workaround to a regression in
Cython 3.10.0a10 that throws an attribute error. See more details
upstream at yaml/pyyaml#601 and
yaml/pyyaml#702.
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

Strong work!

Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Looks good! 👍 👍

This fabricated subject covers domains that end in "fed.us" to boost
test coverage.
The Docker Compose package is causing a dependency conflict. And with
respect to #40, the package no longer belongs in this project.
@king-alexander king-alexander merged commit cf69dc0 into develop Aug 21, 2023
37 checks passed
@king-alexander king-alexander deleted the improvement/update-mongo-tests branch August 21, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use python Pull requests that update Python code test This issue or pull request adds or otherwise modifies test code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade MongoEngine
4 participants