|
1 | 1 | from sap_cloud_sdk.dms import create_client |
| 2 | +from sap_cloud_sdk.dms.exceptions import DMSError |
2 | 3 | from sap_cloud_sdk.dms.model import InternalRepoRequest |
3 | 4 | import pytest |
4 | 5 | import logging |
@@ -33,22 +34,25 @@ def _setup_test_repositories(dms_client): |
33 | 34 | created_repos = [] |
34 | 35 |
|
35 | 36 | 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 | + ) |
40 | 43 | ) |
41 | | - ) |
42 | | - created_repos.append(repo.id) |
| 44 | + created_repos.append(repo.id) |
43 | 45 |
|
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 | + ) |
49 | 52 | ) |
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}") |
52 | 56 |
|
53 | 57 | yield |
54 | 58 |
|
|
0 commit comments