cancel
Showing results for 
Search instead for 
Did you mean: 

CAP - Hybrid Testing against a app with subscription and multitenancy

christopher_ket
Explorer

Hello,

we want to write test for a CAP app that is subscription and multitenancy enabled. Because of subscription were are not able to define a connection to a db instance like described in the CAP documentation - see below. Do we need to connect to the subscription manager and how can we provide the tenant id?

Example package.json/ cdsrc.json extension for Hybrid testing from https://cap.cloud.sap/docs/advanced/hybrid-testing:

{
"requires": {
"[hybrid]": {
"db": {
"kind": "hana",
"binding": {
"type": "cf",
"apiEndpoint": "https://api.sap.hana.ondemand.com",
"org": "your-cf-org",
"space": "your-cf-space",
"instance": "my-hana",
"key": "my-hana-key",
"vcap": {
"label": "hana",
"plan": "hdi-shared"
},
"resolved": false
}
}
}
}
}

cds.test:

https://cap.cloud.sap/docs/node.js/cds-test

Hybrid Testing:

https://cap.cloud.sap/docs/advanced/hybrid-testing

Accepted Solutions (0)

Answers (1)

Answers (1)

martinfrick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi christopher.ket,

while missing the insights on what exactly you are trying to test (so there might be an easier/more appropriate way to achieve things) maybe checking out the following link might help you for now!

https://cap.cloud.sap/docs/node.js/events#cds-context

AFAIK, you can just set/overwrite the respective tenant in the cds context while your CAP app definitely needs a binding to the respective service manager (container plan) handling your tenant HDI containers.

alperdedeoglu - Feel free to add your 2 cents...

Best regards,

Martin