Inspired by model-bakery, this project aims to simplify the process of creating MongoDB documents for testing purposes. The goal is to deliver a maintainable, intuitive, and developer-friendly API specifically designed for MongoDB. By streamlining the generation of test data, this tool will empower developers to efficiently create realistic document structures, enhancing the testing workflow for applications that rely on MongoDB as their primary database.
- To have the conveniences of model_bakery (from the Django world) in Flask with MongoEngine.
- We want more context within the test itself (instead of having fixtures in conftest where we don't know which fields are populated).
- We don't want to create a Factory for every Document in the application.
We welcome contributions to the mongo_bakery project! Here are the steps to get started:
-
Fork the Repository: Fork the mongo_bakery repository on GitHub.
-
Clone Your Fork: Clone your forked repository to your local machine.
git clone https://github.com/your-username/mongo_bakery.git cd mongo_bakery
-
Create a Branch: Create a new branch for your feature or bugfix.
git checkout -b branch-name
-
Install Dependencies: Install the required dependencies. We use the uv tool to manage our prject dependencies and vitualenv. So it is a prerequisite to the project.
uv sync
This command will create the Python virtual environment with the Python version of the project and install all dependencies.
-
Make Changes: Implement your feature or bugfix.
-
Run Tests and Lint: Ensure all tests and lint pass before submitting your changes.
uv run task test
This command runs
ruff check
as a lint,pytest
to run all tests, andcoverage html
to generate an html report of test coverage. This html report is for the development side only. On our CI with Github Actions, it runspytest --cov=mongo_bakery --cov-report=xml
to generate a report that is send to codecov.io -
Commit Changes: Commit your changes with a descriptive commit message. Use Conventional Commits to write your commit messages.
git add . git commit -m "feat(issue4): Description of your changes"
-
Push to GitHub: Push your changes to your forked repository.
git push origin branch-name
-
Create a Pull Request: Open a pull request on the original repository. Provide a clear description of your changes and any relevant information.
-
Review Process: Your pull request will be reviewed by the maintainers. Be prepared to make any necessary changes based on feedback.
Made with contrib.rocks.