Skip to content

Commit

Permalink
test for checking minio config
Browse files Browse the repository at this point in the history
Signed-off-by: Pratiksha Sankhe <[email protected]>
  • Loading branch information
psankhe28 committed Oct 13, 2024
1 parent 79d3969 commit b9d6f7a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/code_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,35 @@ jobs:
files: ./test_unit.xml
fail_ci_if_error: true
verbose: true

minio-config-test:
name: Minio configuration test
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up environment
uses: ./.github/actions/setup/poetry
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--with=test"
poetry-export-options: "--with=test"

- name: Run tests and generate coverage as test_minio.xml
run: |
poetry run pytest \
--cov-report term \
--cov-report xml:test_minio.xml \
--cov=tests/test_minio
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: test_minio
files: ./test_minio.xml
fail_ci_if_error: true
verbose: true
...
17 changes: 17 additions & 0 deletions tests/test_integration/test_minio_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Integration tests for the minio configuration."""

import pytest
from minio import Minio
from pydantic import ValidationError
from cloud_storage_handler.api.elixircloud.csh.models import MinioConfig

def test_create_minio_client():
config = MinioConfig()
client = Minio(
endpoint=f"{config.hostname}:{config.port}",
access_key=config.access_key,
secret_key=config.secret_key,
secure=config.secure,
)
config.client = client
assert isinstance(config.client, Minio)

0 comments on commit b9d6f7a

Please sign in to comment.