-
Notifications
You must be signed in to change notification settings - Fork 0
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
Mocked AWS & Github Action #39
Conversation
@@ -345,6 +331,14 @@ def load_whisper_model(model_name): | |||
|
|||
|
|||
if __name__ == "__main__": | |||
dotenv.load_dotenv() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the loading of the dotenv file was moved here so that it doesn't interfere with unit testing, which overrides the runtime environment
@pytest.fixture(scope="function") | ||
def queues(sqs): | ||
sqs.create_queue(QueueName=TODO_QUEUE) | ||
sqs.create_queue(QueueName=DONE_QUEUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the above is for mocking out STS, SQS and S3 services with moto. moto allows these mocked out services to operate as if they were actually running, but with fake local resources.
|
||
bucket = speech_to_text.get_bucket() | ||
for obj in bucket.objects.all(): | ||
obj.delete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we aren't using AWS live anymore, and moto resources are temporary, this cleanup can go away.
d887601
to
7aeb806
Compare
This PR mocks AWS resources in the test with moto. It also includes a Github Action configuration to run linting and format check with ruff, before running the tests.
Closes #12
Refs #36