Skip to content

Test flake: test/bases/renku_data_services/data_api/test_data_connectors.py::test_validate_envidat_data_connector #1281

@leafty

Description

@leafty
FAILED test/bases/renku_data_services/data_api/test_data_connectors.py::test_validate_envidat_data_connector - renku_data_services.errors.errors.ValidationError: ValidationError: The provided DOI is not supported.
_____________________ test_validate_envidat_data_connector _____________________
[gw1] linux -- Python 3.13.13 /poetry_cache/virtualenvs/renku-data-services-xS3fZVNL-py3.13/bin/python

envidat_metadata = DOIMetadata(name='Alpine3D simulations of future climate scenarios CH2014', description='# Overview\r\n\r\nThe CH2014-...o only 2 days on average.\r\n', keywords=['CH2011', 'CH2014', 'CLIMATE CHANGE', 'SNOW DEPTH', 'SNOW WATER EQUIVALENT'])
sanic_client = <test.utils.SanicReusableASGITestClient object at 0x7f6daaa0bcb0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6d91a69320>

    async def test_validate_envidat_data_connector(
        envidat_metadata: DOIMetadata,
        sanic_client: SanicASGITestClient,
        monkeypatch: "MonkeyPatch",
    ) -> None:
        _mock_get_envidat_metadata(envidat_metadata, sanic_client, monkeypatch)
        body = GlobalDataConnectorPost(
            storage=CloudStorageCorePost(
                storage_type="doi",
                configuration={"type": "doi", "doi": "10.16904/12"},
                source_path="/",
                target_path="/",
                readonly=True,
            )
        )
        validator = RCloneValidator()
>       res = await core.prevalidate_unsaved_global_data_connector(body, validator)

test/bases/renku_data_services/data_api/test_data_connectors.py:2529: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

body = GlobalDataConnectorPost(storage=CloudStorageCorePost(storage_type='doi', configuration={'type': 'doi', 'doi': '10.16904/12'}, source_path='/', target_path='/', readonly=True))
validator = <renku_data_services.storage.rclone.RCloneValidator object at 0x7f6da803d810>

    async def prevalidate_unsaved_global_data_connector(
        body: apispec.GlobalDataConnectorPost, validator: RCloneValidator
    ) -> models.PrevalidatedGlobalDataConnector:
        """Pre-validate an unsaved data connector."""
        # TODO: allow admins to create global data connectors, e.g. s3://giab
        if isinstance(body.storage, apispec.CloudStorageUrlV2):
            raise errors.ValidationError(message="Global data connectors cannot be configured via a URL.")
        storage, doi = await validate_unsaved_storage_doi(body.storage, validator=validator)
        if storage.storage_type not in ALLOWED_GLOBAL_DATA_CONNECTOR_PROVIDERS:
            raise errors.ValidationError(message="Only doi storage type is allowed for global data connectors")
        if not storage.readonly:
            raise errors.ValidationError(message="Global data connectors must be read-only")
    
        rclone_metadata: RCloneDOIMetadata | None = None
        doi_uri = f"doi:{doi}"
        if storage.storage_type == "doi":
            # This means that the storage is most likely supported by Rclone, by calling the get_doi_metadata we confirm
            rclone_metadata = await validator.get_doi_metadata(configuration=storage.configuration)
            if not rclone_metadata:
>               raise errors.ValidationError(message="The provided DOI is not supported.")
E               renku_data_services.errors.errors.ValidationError: ValidationError: The provided DOI is not supported.

components/renku_data_services/data_connectors/core.py:232: ValidationError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions