You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New versions of pytest and moto broke our test environment, as such they were pinned to the non-breaking changes temporarily. The purpose of this ticket is to update pytest and moto to their newest versions and fix the breaking changes. This should only affect our tests and should have no bearing on app code.
Ticket is understood, and QA has been contacted (if the ticket has a QA label).
User Story(ies)
As a VA Notify engineer I want current software So that our code runs smooth and we have access to all features
For Moto 5.x:
All decorators have been replaced with mock_aws
The batch_simple decorator has been replaced with: @mock_aws(config={“batch”: {“use_docker”: False}})
The awslambda_simple decorator has been replaced with: @mock_aws(config={“lambda”: {“use_docker”: False}})
When starting the MotoServer, the service-argument (i.e.: motoserver s3) is no longer supported. A single MotoServer-instance can be used for all AWS-services.
Test that fail out include
tests/app/celery/test_scheduled_tasks.py:9: in
from moto import mock_dynamodb
from moto import mock_dynamodb
E ImportError: cannot import name 'mock_dynamodb' from 'moto'
tests/app/letters/test_letter_utils.py:7: in
from moto import mock_s3
from moto import mock_s3
E ImportError: cannot import name 'mock_s3' from 'moto'
tests/lambda_functions/two_way_sms/test_two_way_sms_v2.py:11: in
from moto import mock_ssm
E ImportError: cannot import name 'mock_ssm' from 'moto'
Engineering Checklist
pytest upgraded to 8.x (note: it looks like this was upgraded, double0check to be sure)
moto upgraded to 5.x
All dependencies locked to ~= M.m
e.g. pytest ~= 8.0. No third decimal place (patch version), and all contain ~=
Acceptance Criteria
pytest and moto upgraded to 8.x and 5.x respectively.
I update the dependency and made the necessary changes. There's one test that fails when running locally in a container, but looks like it passes when the tests are run on the PR. I'll continue trying to figure out what's going on with that tomorrow.
The test failing locally is this one: test_fetch_notification_status_for_service_for_day
After running the tests several times today I did not encounter the above test failing anymore. Maybe I was running tests without a clean database? I'm putting this PR up for review once I deploy to dev.
User Story - Business Need
New versions of pytest and moto broke our test environment, as such they were pinned to the non-breaking changes temporarily. The purpose of this ticket is to update pytest and moto to their newest versions and fix the breaking changes. This should only affect our tests and should have no bearing on app code.
User Story(ies)
As a VA Notify engineer
I want current software
So that our code runs smooth and we have access to all features
Additional Info and Resources
Specific to the moto upgrade:
Test that fail out include
Engineering Checklist
pytest ~= 8.0
. No third decimal place (patch version), and all contain~=
Acceptance Criteria
Potential Dependencies
1436 must be finished first.
The text was updated successfully, but these errors were encountered: