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

Make code changes to address all test warnings #950

Merged
merged 15 commits into from
Aug 7, 2024
Merged

Conversation

grahamalama
Copy link
Contributor

Ahh, a test suite run with no warnings reported

================================================================================================ test session starts ================================================================================================
platform darwin -- Python 3.12.4, pytest-8.3.2, pluggy-1.5.0
rootdir: /Users/gbeckley/code/github/mozilla-it/ctms-api
configfile: pyproject.toml
testpaths: tests/unit
plugins: Faker-26.0.0, anyio-4.4.0, factoryboy-2.7.0
collected 484 items                                                                                                                                                                                                 

tests/unit/bin/test_client_credentials.py ................                                                                                                                                                    [  3%]
tests/unit/routers/contacts/test_api.py ......................................................                                                                                                                [ 14%]
tests/unit/routers/contacts/test_api_delete.py ...                                                                                                                                                            [ 15%]
tests/unit/routers/contacts/test_api_get.py ......                                                                                                                                                            [ 16%]
tests/unit/routers/contacts/test_api_get_by_alt_id.py ...................                                                                                                                                     [ 20%]
tests/unit/routers/contacts/test_api_patch.py ............................................................................................................................                                    [ 45%]
tests/unit/routers/contacts/test_api_post.py ..................................................                                                                                                               [ 56%]
tests/unit/routers/contacts/test_api_put.py ...................................................                                                                                                               [ 66%]
tests/unit/routers/contacts/test_bulk.py .................                                                                                                                                                    [ 70%]
tests/unit/routers/contacts/test_private_api.py ..............................                                                                                                                                [ 76%]
tests/unit/routers/test_platform.py .........                                                                                                                                                                 [ 78%]
tests/unit/schemas/test_contact.py ......                                                                                                                                                                     [ 79%]
tests/unit/schemas/test_newsletter.py ..                                                                                                                                                                      [ 79%]
tests/unit/schemas/test_waitlist.py ..............................                                                                                                                                            [ 86%]
tests/unit/test_auth.py .................                                                                                                                                                                     [ 89%]
tests/unit/test_backport_legacy_waitlists.py ....                                                                                                                                                             [ 90%]
tests/unit/test_crud.py ...............................                                                                                                                                                       [ 96%]
tests/unit/test_log.py ......                                                                                                                                                                                 [ 98%]
tests/unit/test_metrics.py .........                                                                                                                                                                          [100%]

=============================================================================================== 484 passed in 54.01s ================================================================================================

Base automatically changed from use-ruff to main August 1, 2024 11:21
@grahamalama
Copy link
Contributor Author

Since merging #932, a warning is being triggered when we call init_metrics_labels 🤔

tests/unit/test_metrics.py::test_init_metrics_labels
  /Users/gbeckley/code/github/mozilla-it/ctms-api/.venv/lib/python3.12/site-packages/fastapi/openapi/utils.py:207: UserWarning: Duplicate Operation ID lbheartbeat___lbheartbeat___head for function lbheartbeat at /Users/gbeckley/code/github/mozilla-it/ctms-api/.venv/lib/python3.12/site-packages/dockerflow/fastapi/views.py
    warnings.warn(message, stacklevel=1)

tests/unit/test_metrics.py::test_init_metrics_labels
  /Users/gbeckley/code/github/mozilla-it/ctms-api/.venv/lib/python3.12/site-packages/fastapi/openapi/utils.py:207: UserWarning: Duplicate Operation ID heartbeat___heartbeat___head for function heartbeat at /Users/gbeckley/code/github/mozilla-it/ctms-api/.venv/lib/python3.12/site-packages/dockerflow/fastapi/views.py
    warnings.warn(message, stacklevel=1)

We might have to settle with 1 warning, for now

@grahamalama grahamalama marked this pull request as ready for review August 1, 2024 12:19
@grahamalama grahamalama requested a review from a team as a code owner August 1, 2024 12:19
Copy link
Contributor

@alexcottner alexcottner left a comment

Choose a reason for hiding this comment

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

seems good

@grahamalama grahamalama merged commit 761da1c into main Aug 7, 2024
5 checks passed
@grahamalama grahamalama deleted the address-warnings branch August 7, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants