forked from pydantic/pydantic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add third-party tests for BeanieODM (pydantic#11177)
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,63 @@ jobs: | |
- name: Run SQLModel tests | ||
run: uv run --no-project pytest tests | ||
|
||
test-beanie: | ||
name: Test Beanie (main branch) on Python ${{ matrix.python-version }} | ||
# If 'schedule' was the trigger, don't run it on contributors' forks | ||
if: | | ||
github.event_name == 'workflow_dispatch' || | ||
(github.event_name == 'schedule' && github.repository == 'pydantic/pydantic') || | ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'third-party-tests')) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] | ||
steps: | ||
- name: Checkout Beanie | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: BeanieODM/beanie | ||
|
||
- name: Checkout Pydantic | ||
uses: actions/checkout@v4 | ||
with: | ||
path: pydantic-latest | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Start MongoDB | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: "8.0" | ||
mongodb-replica-set: test-rs | ||
|
||
- name: Install Beanie dependencies | ||
run: | | ||
pip install .[test,ci] | ||
pip uninstall --yes pydantic | ||
pip install ./pydantic-latest | ||
- name: List installed dependencies | ||
run: pip list | ||
|
||
- name: Run Beanie tests | ||
# Run tests except for known issues on https://github.com/BeanieODM/beanie/issues/1084 | ||
run: | | ||
pytest -v \ | ||
--deselect tests/odm/test_encoder.py::test_should_encode_pydantic_v2_url_correctly \ | ||
--deselect tests/odm/test_encoder.py::test_should_be_able_to_save_retrieve_doc_with_url \ | ||
--deselect tests/odm/test_fields.py::test_revision_id_not_in_schema \ | ||
--deselect tests/odm/test_json_schema_generation.py::test_schema_export_of_model_with_decimal_field \ | ||
--deselect tests/odm/test_json_schema_generation.py::test_schema_export_of_model_with_pydanticobjectid \ | ||
--deselect tests/odm/test_json_schema_generation.py::test_schema_export_of_model_with_link \ | ||
--deselect tests/odm/test_json_schema_generation.py \ | ||
--deselect tests/odm/test_json_schema_generation.py::test_schema_export_of_model_with_list_link \ | ||
--deselect tests/odm/test_json_schema_generation.py::test_schema_export_of_model_with_backlink \ | ||
--deselect tests/odm/test_json_schema_generation.py::test_schema_export_of_model_with_list_backlink \ | ||
test-openapi-python-client: | ||
name: Test openapi-python-client (main branch) on Python ${{ matrix.python-version }} | ||
# If 'schedule' was the trigger, don't run it on contributors' forks | ||
|
@@ -163,13 +220,15 @@ jobs: | |
needs: | ||
- test-fastapi | ||
- test-sqlmodel | ||
- test-beanie | ||
- test-openapi-python-client | ||
if: | | ||
github.repository == 'pydantic/pydantic' && | ||
github.event_name == 'schedule' && | ||
( | ||
needs.test-fastapi.result == 'failure' || | ||
needs.test-sqlmodel.result == 'failure' || | ||
needs.test-beanie.result == 'failure' || | ||
needs.test-openapi-python-client.result == 'failure' | ||
) | ||
permissions: | ||
|