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

Extract middleware unit tests #85

Closed
data-sync-user opened this issue Oct 20, 2022 · 4 comments
Closed

Extract middleware unit tests #85

data-sync-user opened this issue Oct 20, 2022 · 4 comments
Assignees

Comments

@data-sync-user
Copy link
Collaborator

data-sync-user commented Oct 20, 2022

Refactor middleware tests into unit and integration test layers to clearly delineate test responsibilities

  • Tests using the FAST API TestClient and responsible for verifying system interactions as a group, can be classified as integration tests
  • Tests checking logical operations within middleware modules can be classified as unit tests

Example
https://github.com/mozilla-services/merino-py/pull/74

Acceptance Criteria

  • The following modules are evaluated and tests refactored to unit or integration layers if appropriate:
    • featureflags.py (Tests found in tests\integration\api\v1\suggest\test_suggest.py)
    • metrics.py (Tests found in tests\integration\api\v1\suggest\test_metrics.py)
    • logging.py (Tests found in tests\integration\api\v1\suggest\test_suggest.py & tests\integration\api\test_heartbeat.py)
    • user_agent.py (Tests found in tests\integration\api\v1\suggest\test_user_agent.py)
  • Integration test module names are updated to follow the endpoint naming convention
  • Documentation is updated to include changes in structure or fixture

┆Issue is synchronized with this Jira Task
┆Epic: Add integration test layer to merino-py

@data-sync-user
Copy link
Collaborator Author

➤ Katrina Anderson commented:

Update (2022/11/08)

@data-sync-user
Copy link
Collaborator Author

➤ Katrina Anderson commented:

Update (2022/11/09)

  • Refactor tests for LoggingMiddleware and update draft PR

@data-sync-user
Copy link
Collaborator Author

➤ Katrina Anderson commented:

Update (2022/11/10)

  • Refactored LoggingMiddleware logic into a utility for better testability

@data-sync-user
Copy link
Collaborator Author

➤ Katrina Anderson commented:

Update (2022/11/14)

  • Refactored MetricsMiddleware integration tests into endpoint modules
  • Added unit test module

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

No branches or pull requests

2 participants