Skip to content

Conversation

ByteOtter
Copy link
Contributor

@ByteOtter ByteOtter commented Jul 30, 2025

What this PR does / why we need it:
In order to improve test coverage - and therefore reliability of our code - this PR adds unittests to the src/gardenlinux/s3 module.

Which issue(s) this PR fixes:
Fixes #122
Tracks #138

Special notes for your reviewer:

This PR introduces a new dev-dependency: moto

This dependency mocks an AWS environment and allows for testing of our boto3 code.

Once merged, it could be that there is a conflict with #142 due to changes to the pyproject.toml. This is easily fixed though.

Currently, pytest catches a deprecation warning DeprecationWarning: datetime.datetime.utcnow() though this most likely comes from moto and will be fixed upstream in the future.

Release note:

@ByteOtter ByteOtter changed the title Add tests for the s3 module [TESTS] Add tests for the s3 module Jul 30, 2025
@ByteOtter ByteOtter force-pushed the tests/add-s3-tests branch from 647f990 to 44b2c48 Compare July 30, 2025 10:27
@ByteOtter ByteOtter requested a review from NotTheEvilOne July 30, 2025 14:53
@ByteOtter ByteOtter force-pushed the tests/add-s3-tests branch 2 times, most recently from 245873d to 1edbb89 Compare July 31, 2025 09:26
* Use fixture with mock_aws context manager instead of directly patching
Bucket
@ByteOtter ByteOtter force-pushed the tests/add-s3-tests branch from 1edbb89 to a4190b9 Compare July 31, 2025 09:29
@ByteOtter ByteOtter requested a review from NotTheEvilOne July 31, 2025 09:58
Copy link
Contributor

@NotTheEvilOne NotTheEvilOne left a comment

Choose a reason for hiding this comment

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

LGTM

@NotTheEvilOne NotTheEvilOne merged commit cd7131a into main Jul 31, 2025
9 checks passed
@NotTheEvilOne NotTheEvilOne deleted the tests/add-s3-tests branch July 31, 2025 15:39
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

Successfully merging this pull request may close these issues.

Add tests for src/gardenlinux/s3
2 participants