Skip to content

Commit fc0ebb8

Browse files
authored
test(destination): enable multi-tenant BDD scenarios (#160)
1 parent 12465ba commit fc0ebb8

7 files changed

Lines changed: 547 additions & 504 deletions

File tree

.env_integration_tests.example

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
11
CLOUD_SDK_OTEL_DISABLED=true
22

3-
CLOUD_SDK_CFG_AUDITLOG_DEFAULT_URL=https://your-auditlog-api-url-here
4-
CLOUD_SDK_CFG_AUDITLOG_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret"}'
5-
6-
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_HOST=your-objectstore-host-here
7-
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_ACCESS_KEY_ID=your-access-key-id-here
8-
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_SECRET_ACCESS_KEY=your-secret-access-key-here
9-
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_BUCKET=your-bucket-name-here
10-
11-
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTID=your-destination-client-id-here
12-
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTSECRET=your-destination-client-secret-here
13-
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URL=https://your-destination-auth-url-here
14-
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URI=https://your-destination-configuration-uri-here
15-
CLOUD_SDK_CFG_DESTINATION_DEFAULT_IDENTITYZONE=your-identity-zone-here
16-
17-
CLOUD_SDK_CFG_DATA_ANONYMIZATION_DEFAULT_URL=https://your-data-anonymization-api-url-here
18-
CLOUD_SDK_CFG_DATA_ANONYMIZATION_DEFAULT_CERT=your-base64-encoded-client-certificate-pem
19-
CLOUD_SDK_CFG_DATA_ANONYMIZATION_DEFAULT_KEY=your-base64-encoded-client-private-key-pem
20-
# Alternative to inline base64 cert/key values:
21-
# CLOUD_SDK_CFG_DATA_ANONYMIZATION_DEFAULT_DESTINATION_NAME=your-client-certificate-destination-name
22-
23-
CLOUD_SDK_CFG_SDM_DEFAULT_URI=https://your-sdm-api-uri-here
24-
CLOUD_SDK_CFG_SDM_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret","identityzone":"your-identity-zone"}'
25-
26-
CLOUD_SDK_CFG_HANA_AGENT_MEMORY_DEFAULT_APPLICATION_URL=https://your-agent-memory-api-url-here
27-
CLOUD_SDK_CFG_HANA_AGENT_MEMORY_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret"}'
28-
29-
# ADMS (Advanced Document Management Service) — integration tests against
30-
# a deployed ADM instance. Tests are skipped when any of these are missing.
3+
# ADMS
314
CLOUD_SDK_CFG_ADMS_DEFAULT_CLIENTID=your-adms-client-id-here
325
CLOUD_SDK_CFG_ADMS_DEFAULT_CLIENTSECRET=your-adms-client-secret-here
336
CLOUD_SDK_CFG_ADMS_DEFAULT_URL=https://your-tenant.accounts.ondemand.com
347
CLOUD_SDK_CFG_ADMS_DEFAULT_URI=https://your-adm-host.cfapps.eu20.hana.ondemand.com
358
CLOUD_SDK_CFG_ADMS_DEFAULT_RESOURCE=urn:sap:identity:application:provider:name:your-adm-app-name
369

37-
CLOUD_SDK_CFG_AGW_DEFAULT_TENANT_SUBDOMAIN=your-tenant-subdomain-here
10+
# AGENT GATEWAY
3811
CLOUD_SDK_CFG_AGW_DEFAULT_LANDSCAPE=your-landscape-here
39-
AGW_USER_TOKEN=your-user-jwt-here
12+
CLOUD_SDK_CFG_AGW_DEFAULT_TENANT_SUBDOMAIN=your-tenant-subdomain-here
13+
CLOUD_SDK_CFG_AGW_DEFAULT_USER_TOKEN=your-user-jwt-here
14+
15+
# AGENT MEMORY
16+
CLOUD_SDK_CFG_HANA_AGENT_MEMORY_DEFAULT_APPLICATION_URL=https://your-agent-memory-api-url-here
17+
CLOUD_SDK_CFG_HANA_AGENT_MEMORY_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret"}'
4018

41-
# AI Core — required for Traceloop/LangGraph integration tests
19+
# AI CORE (required for Traceloop/LangGraph integration tests)
4220
AICORE_CLIENT_ID=your-aicore-client-id-here
4321
AICORE_CLIENT_SECRET=your-aicore-client-secret-here
4422
AICORE_AUTH_URL=https://your-aicore-auth-url-here/oauth/token
4523
AICORE_BASE_URL=https://your-aicore-api-url-here/v2
4624
AICORE_RESOURCE_GROUP=default
4725
AICORE_MODEL=anthropic--claude-3-5-haiku
26+
27+
# AUDITLOG
28+
CLOUD_SDK_CFG_AUDITLOG_DEFAULT_URL=https://your-auditlog-api-url-here
29+
CLOUD_SDK_CFG_AUDITLOG_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret"}'
30+
31+
# DATA ANONYMIZATION
32+
CLOUD_SDK_CFG_DATA_ANONYMIZATION_DEFAULT_URL=https://your-data-anonymization-api-url-here
33+
CLOUD_SDK_CFG_DATA_ANONYMIZATION_DEFAULT_CERT=your-base64-encoded-client-certificate-pem
34+
CLOUD_SDK_CFG_DATA_ANONYMIZATION_DEFAULT_KEY=your-base64-encoded-client-private-key-pem
35+
# Alternative to inline base64 cert/key values:
36+
# CLOUD_SDK_CFG_DATA_ANONYMIZATION_DEFAULT_DESTINATION_NAME=your-client-certificate-destination-name
37+
38+
# DESTINATION
39+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTID=your-destination-client-id-here
40+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTSECRET=your-destination-client-secret-here
41+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URL=https://your-destination-auth-url-here
42+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URI=https://your-destination-configuration-uri-here
43+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_IDENTITYZONE=your-identity-zone-here
44+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_TENANT_SUBDOMAIN=your-subscriber-tenant-subdomain-here
45+
46+
# DMS
47+
CLOUD_SDK_CFG_SDM_DEFAULT_URI=https://your-sdm-api-uri-here
48+
CLOUD_SDK_CFG_SDM_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret","identityzone":"your-identity-zone"}'
49+
50+
# OBJECT STORE
51+
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_HOST=your-objectstore-host-here
52+
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_ACCESS_KEY_ID=your-access-key-id-here
53+
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_SECRET_ACCESS_KEY=your-secret-access-key-here
54+
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_BUCKET=your-bucket-name-here

docs/INTEGRATION_TESTS.md

Lines changed: 64 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -26,42 +26,42 @@ uv sync --all-extras
2626

2727
Integration tests require specific environment variables to be configured. These are managed through the `.env_integration_tests` file in the project root.
2828

29-
### ObjectStore Integration Tests
30-
31-
For ObjectStore integration tests, configure the following variables in `.env_integration_tests`:
32-
33-
```bash
34-
# ObjectStore Configuration
35-
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_HOST=your-host-here
36-
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_ACCESS_KEY_ID=your-access-key-id-here
37-
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_SECRET_ACCESS_KEY=your-secret-access-key-kere
38-
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_BUCKET=your-bucket-here
39-
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_SSL_ENABLED=false
40-
```
41-
42-
### AuditLog Integration Tests
29+
### ADMS Integration Tests
4330

44-
For AuditLog integration tests, configure the following variables in `.env_integration_tests`:
31+
For ADMS (Advanced Document Management Service) integration tests, configure the following variables in `.env_integration_tests`:
4532

4633
```bash
47-
# AuditLog Configuration
48-
CLOUD_SDK_CFG_AUDITLOG_DEFAULT_URL=https://your-auditlog-api-url-here
49-
CLOUD_SDK_CFG_AUDITLOG_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret"}'
34+
# ADMS Configuration
35+
CLOUD_SDK_CFG_ADMS_DEFAULT_URL=https://your-tenant.accounts.ondemand.com
36+
CLOUD_SDK_CFG_ADMS_DEFAULT_URI=https://your-adm-instance.cfapps.eu20.hana.ondemand.com
37+
CLOUD_SDK_CFG_ADMS_DEFAULT_CLIENTID=your-ias-client-id
38+
CLOUD_SDK_CFG_ADMS_DEFAULT_CLIENTSECRET=your-ias-client-secret
39+
CLOUD_SDK_CFG_ADMS_DEFAULT_RESOURCE=urn:sap:identity:application:provider:name:your-app
5040
```
5141

52-
**Note**: AuditLog integration tests are cloud-only and require real SAP Audit Log Service credentials. The secret resolver automatically loads configuration from `/etc/secrets/appfnd` or environment variables - no manual configuration parsing needed in test code.
42+
`CLOUD_SDK_CFG_ADMS_DEFAULT_URI` points the tests at the target ADM service. The other `CLOUD_SDK_CFG_ADMS_DEFAULT_*` variables hold the IAS service-binding credentials used by the SDK to fetch Bearer tokens. Tests are skipped automatically when any of these are missing.
5343

54-
### Destination Integration Tests
44+
### Agent Gateway Integration Tests
5545

56-
For Destination integration tests, configure the following variables in `.env_integration_tests`:
46+
Agent Gateway integration tests use the LoB agent flow via the Destination Service. Configure the following variables in `.env_integration_tests`:
5747

5848
```bash
59-
# Destination Configuration
49+
# Destination Service (required by the LoB agent flow)
6050
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTID=your-destination-client-id-here
6151
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTSECRET=your-destination-client-secret-here
6252
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URL=https://your-destination-auth-url-here
6353
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URI=https://your-destination-configuration-uri-here
6454
CLOUD_SDK_CFG_DESTINATION_DEFAULT_IDENTITYZONE=your-identity-zone-here
55+
56+
# Landscape suffix used to resolve the IAS destination name
57+
CLOUD_SDK_CFG_AGW_DEFAULT_LANDSCAPE=your-landscape-here
58+
59+
# Tenant subdomain for multi-tenant lookup
60+
CLOUD_SDK_CFG_AGW_DEFAULT_TENANT_SUBDOMAIN=your-tenant-subdomain-here
61+
62+
# User JWT for token exchange scenarios (get_user_auth)
63+
# If not set, user auth scenarios are automatically skipped
64+
CLOUD_SDK_CFG_AGW_DEFAULT_USER_TOKEN=your-user-jwt-here
6565
```
6666

6767
### Agent Memory Integration Tests
@@ -74,6 +74,18 @@ CLOUD_SDK_CFG_HANA_AGENT_MEMORY_DEFAULT_APPLICATION_URL=https://your-agent-memor
7474
CLOUD_SDK_CFG_HANA_AGENT_MEMORY_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret"}'
7575
```
7676

77+
### AuditLog Integration Tests
78+
79+
For AuditLog integration tests, configure the following variables in `.env_integration_tests`:
80+
81+
```bash
82+
# AuditLog Configuration
83+
CLOUD_SDK_CFG_AUDITLOG_DEFAULT_URL=https://your-auditlog-api-url-here
84+
CLOUD_SDK_CFG_AUDITLOG_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret"}'
85+
```
86+
87+
**Note**: AuditLog integration tests are cloud-only and require real SAP Audit Log Service credentials. The secret resolver automatically loads configuration from `/etc/secrets/appfnd` or environment variables - no manual configuration parsing needed in test code.
88+
7789
### Data Anonymization Integration Tests
7890

7991
For Data Anonymization integration tests, configure the following variables in `.env_integration_tests`:
@@ -96,6 +108,24 @@ CLOUD_SDK_CFG_DATA_ANONYMIZATION_DEFAULT_DESTINATION_NAME=your-client-certificat
96108

97109
The destination must be configured with `ClientCertificateAuthentication` and reference a certificate bundle containing the client certificate and private key.
98110

111+
### Destination Integration Tests
112+
113+
For Destination integration tests, configure the following variables in `.env_integration_tests`:
114+
115+
```bash
116+
# Destination Configuration
117+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTID=your-destination-client-id-here
118+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTSECRET=your-destination-client-secret-here
119+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URL=https://your-destination-auth-url-here
120+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URI=https://your-destination-configuration-uri-here
121+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_IDENTITYZONE=your-identity-zone-here
122+
123+
# Optional: subscriber tenant subdomain for multi-tenant scenarios
124+
# When set, scenarios using SUBSCRIBER_FIRST, SUBSCRIBER_ONLY, and PROVIDER_FIRST are executed.
125+
# When not set, those scenarios are automatically skipped.
126+
CLOUD_SDK_CFG_DESTINATION_DEFAULT_TENANT_SUBDOMAIN=your-subscriber-tenant-subdomain-here
127+
```
128+
99129
### DMS Integration Tests
100130

101131
For DMS (Document Management Service) integration tests, configure the following variables in `.env_integration_tests`:
@@ -108,42 +138,17 @@ CLOUD_SDK_CFG_SDM_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-c
108138

109139
**Note**: The test fixture automatically onboards test repositories (standard and version-enabled) at session start and cleans them up on teardown. No pre-existing repositories are required.
110140

111-
### ADMS Integration Tests
112-
113-
For ADMS (Advanced Document Management Service) integration tests, configure the following variables in `.env_integration_tests`:
114-
115-
```bash
116-
# ADMS Configuration
117-
CLOUD_SDK_CFG_ADMS_DEFAULT_URL=https://your-tenant.accounts.ondemand.com
118-
CLOUD_SDK_CFG_ADMS_DEFAULT_URI=https://your-adm-instance.cfapps.eu20.hana.ondemand.com
119-
CLOUD_SDK_CFG_ADMS_DEFAULT_CLIENTID=your-ias-client-id
120-
CLOUD_SDK_CFG_ADMS_DEFAULT_CLIENTSECRET=your-ias-client-secret
121-
CLOUD_SDK_CFG_ADMS_DEFAULT_RESOURCE=urn:sap:identity:application:provider:name:your-app
122-
```
123-
124-
`CLOUD_SDK_CFG_ADMS_DEFAULT_URI` points the tests at the target ADM service. The other `CLOUD_SDK_CFG_ADMS_DEFAULT_*` variables hold the IAS service-binding credentials used by the SDK to fetch Bearer tokens. Tests are skipped automatically when any of these are missing.
125-
126-
### Agent Gateway Integration Tests
141+
### ObjectStore Integration Tests
127142

128-
Agent Gateway integration tests use the LoB agent flow via the Destination Service. Configure the following variables in `.env_integration_tests`:
143+
For ObjectStore integration tests, configure the following variables in `.env_integration_tests`:
129144

130145
```bash
131-
# Destination Service (required by the LoB agent flow)
132-
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTID=your-destination-client-id-here
133-
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTSECRET=your-destination-client-secret-here
134-
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URL=https://your-destination-auth-url-here
135-
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URI=https://your-destination-configuration-uri-here
136-
CLOUD_SDK_CFG_DESTINATION_DEFAULT_IDENTITYZONE=your-identity-zone-here
137-
138-
# Landscape suffix used to resolve the IAS destination name
139-
APPFND_CONHOS_LANDSCAPE=your-landscape-here
140-
141-
# Tenant subdomain for multi-tenant lookup
142-
TENANT_SUBDOMAIN=your-tenant-subdomain-here
143-
144-
# User JWT for token exchange scenarios (get_user_auth)
145-
# If not set, user auth scenarios are automatically skipped
146-
AGW_USER_TOKEN=your-user-jwt-here
146+
# ObjectStore Configuration
147+
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_HOST=your-host-here
148+
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_ACCESS_KEY_ID=your-access-key-id-here
149+
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_SECRET_ACCESS_KEY=your-secret-access-key-kere
150+
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_BUCKET=your-bucket-here
151+
CLOUD_SDK_CFG_OBJECTSTORE_DEFAULT_SSL_ENABLED=false
147152
```
148153

149154
## Running Integration Tests
@@ -153,14 +158,14 @@ AGW_USER_TOKEN=your-user-jwt-here
153158
uv run pytest tests/ -m integration -v
154159

155160
# Run specific module integration tests
161+
uv run pytest tests/adms/integration/ -v
162+
uv run pytest tests/agentgateway/integration/ -v
163+
uv run pytest tests/agent_memory/integration/ -v
156164
uv run pytest tests/core/integration/auditlog -v
157165
uv run pytest tests/core/integration/data_anonymization -v
158-
uv run pytest tests/objectstore/integration/ -v
159166
uv run pytest tests/destination/integration/ -v
160167
uv run pytest tests/dms/integration/ -v
161-
uv run pytest tests/agent_memory/integration/ -v
162-
uv run pytest tests/adms/integration/ -v
163-
uv run pytest tests/agentgateway/integration/ -v
168+
uv run pytest tests/objectstore/integration/ -v
164169
```
165170

166171
### BDD Scenarios

tests/agentgateway/integration/test_agw_bdd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
55
CLOUD_SDK_CFG_AGW_DEFAULT_TENANT_SUBDOMAIN=<tenant-subdomain> \\
66
CLOUD_SDK_CFG_AGW_DEFAULT_LANDSCAPE=<landscape> \\
7+
CLOUD_SDK_CFG_AGW_DEFAULT_USER_TOKEN=<user-jwt> \\
78
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTID=... \\
89
CLOUD_SDK_CFG_DESTINATION_DEFAULT_CLIENTSECRET=... \\
910
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URL=... \\
1011
CLOUD_SDK_CFG_DESTINATION_DEFAULT_URI=... \\
1112
CLOUD_SDK_CFG_DESTINATION_DEFAULT_IDENTITYZONE=... \\
12-
AGW_USER_TOKEN=<user-jwt> \\
1313
pytest tests/agentgateway/integration/ -v
1414
"""
1515

@@ -72,9 +72,9 @@ def agent_gateway_client_available(agw_client: AgentGatewayClient):
7272
@given("I have a valid user token")
7373
def have_valid_user_token(context: ScenarioContext):
7474
"""Load user token from environment variable."""
75-
token = os.environ.get("AGW_USER_TOKEN", "")
75+
token = os.environ.get("CLOUD_SDK_CFG_AGW_DEFAULT_USER_TOKEN", "")
7676
if not token:
77-
pytest.skip("AGW_USER_TOKEN is not set — skipping user auth scenario")
77+
pytest.skip("CLOUD_SDK_CFG_AGW_DEFAULT_USER_TOKEN is not set — skipping user auth scenario")
7878
context.user_token = token
7979

8080

0 commit comments

Comments
 (0)