Skip to content

Commit

Permalink
Add third-party tests for BeanieODM (pydantic#11177)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaffad authored Dec 28, 2024
1 parent d823d8c commit 3294b9f
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/third-party.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3294b9f

Please sign in to comment.