Skip to content

Commit

Permalink
test: allow skipping S3-related tests (#1766)
Browse files Browse the repository at this point in the history
* test: allow skipping S3-related tests

Show the user how to skip S3 tests.

Signed-off-by: Mike Fiedler <[email protected]>

* docs: add changelog entry

Signed-off-by: Mike Fiedler <[email protected]>

---------

Signed-off-by: Mike Fiedler <[email protected]>
  • Loading branch information
miketheman authored Jul 3, 2024
1 parent 6994250 commit ee74573
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## New Features

- Add arbitrary configuration option for S3 Storage Backend Boto3 calls (PR #1697)
- Add pytest marker to allow skipping of S3 tests (PR #1766)
- Added HTTPS support in Docker Compose + Enabled bind-mount volume for Nginx config + add documentation in README.md (PR #1653)
- Initial support for python 3.12 (PR #1728)
- Move Docker images to 3.12 (PR #1733)
Expand Down
8 changes: 8 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ S3 unittests are more integration tests. They depend on [minio](https://docs.min
- You will either need to skip them or install mino
- Install options: <https://docs.min.io/docs/>

To skip the tests, run:

```bash
/path/to/venv/bin/tox -e py3 -- -k "not s3"
```

This will affect overall coverage numbers locally.

#### Docker Install

Docker is an easy way to get minio to run for tests to pass.
Expand Down
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ log_cli_level = DEBUG
log_level = DEBUG
asyncio_mode=strict
norecursedirs = src/bandersnatch_docker_compose

markers =
s3: mark tests that require an S3/MinIO bucket
2 changes: 2 additions & 0 deletions src/bandersnatch/tests/plugins/test_storage_plugin_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from bandersnatch.tests.mock_config import mock_config
from bandersnatch_storage_plugins import s3

pytestmark = pytest.mark.s3


def test_rewrite(s3_mock: S3Path) -> None:
backend = s3.S3Storage()
Expand Down

0 comments on commit ee74573

Please sign in to comment.