Skip to content

Commit 9676f70

Browse files
committed
fix(dms): skip integration tests when ECM repository connection is unavailable
1 parent 279bfb1 commit 9676f70

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

tests/dms/integration/conftest.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from sap_cloud_sdk.dms import create_client
2+
from sap_cloud_sdk.dms.exceptions import DMSError
23
from sap_cloud_sdk.dms.model import InternalRepoRequest
34
import pytest
45
import logging
@@ -33,22 +34,25 @@ def _setup_test_repositories(dms_client):
3334
created_repos = []
3435

3536
logger.info("Onboarding test repositories")
36-
repo = dms_client.onboard_repository(
37-
InternalRepoRequest(
38-
displayName=f"{_SDK_TEST_REPO_PREFIX}standard",
39-
description="Auto-created by SDK integration tests",
37+
try:
38+
repo = dms_client.onboard_repository(
39+
InternalRepoRequest(
40+
displayName=f"{_SDK_TEST_REPO_PREFIX}standard",
41+
description="Auto-created by SDK integration tests",
42+
)
4043
)
41-
)
42-
created_repos.append(repo.id)
44+
created_repos.append(repo.id)
4345

44-
repo = dms_client.onboard_repository(
45-
InternalRepoRequest(
46-
displayName=f"{_SDK_TEST_REPO_PREFIX}versioned",
47-
description="Auto-created by SDK integration tests (versioning)",
48-
isVersionEnabled=True,
46+
repo = dms_client.onboard_repository(
47+
InternalRepoRequest(
48+
displayName=f"{_SDK_TEST_REPO_PREFIX}versioned",
49+
description="Auto-created by SDK integration tests (versioning)",
50+
isVersionEnabled=True,
51+
)
4952
)
50-
)
51-
created_repos.append(repo.id)
53+
created_repos.append(repo.id)
54+
except DMSError as e:
55+
pytest.skip(f"DMS ECM repository connection not available — skipping DMS integration tests: {e}")
5256

5357
yield
5458

0 commit comments

Comments
 (0)