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

Allow running the mongo test suite against mongomock #1083

Closed
wants to merge 2 commits into from

Conversation

francoisfreitag
Copy link
Member

Running tests in a mock environment would be helpful to packagers for Arch Linux, and maybe others. They do not have access to a running MongoDB instance in the package build environment but would still like to run smoke tests against the package.

The tests against mongomock have been included in the regular test suite to keep verifying that environment.

Tests that require a MongoDB instance can be skipped by setting the environment variable MONGO_USE_MOCK=1.

Support is being provided on a best-effort basis, to help downstream packagers. FactoryBoy could remove support for this feature if it ends up being an issue, as the usage is fairly niche. Requiring a MongoDB instance to run the Mongo test suite does not seem unreasonable.

Closes #1081

@francoisfreitag francoisfreitag force-pushed the mongomock branch 6 times, most recently from c79472a to 838c941 Compare July 11, 2024 18:50
ArchLinux and maybe other Linux distributions have interest in testing
their package of the project, in an environment where MongoDB isn’t
available.

Support for that environment is provided on a best-effort basis. If this
patch ends up being more trouble than it’s worth, please revert it.
Otherwise, let’s be helpful to others. :)
> If setUpClass() fails, meaning that tearDownClass() is not called,
  then any cleanup functions added will still be called.
rbarrois added a commit that referenced this pull request Aug 18, 2024
rbarrois added a commit that referenced this pull request Aug 18, 2024
rbarrois added a commit that referenced this pull request Aug 18, 2024
rbarrois added a commit that referenced this pull request Aug 18, 2024
@rbarrois
Copy link
Member

Merged as 819acce, thanks!

@rbarrois rbarrois closed this Aug 18, 2024
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.

Optionally allow running tests with mongomock
2 participants