on 01-13-2022 7:25 PM
Hello colleagues,
I'm developing a multitenancy application in nodeJS and I want to run my integration tests against a real hana database instead of a in-memory (current configuration).
I saw in this blog https://blogs.sap.com/2021/02/15/the-hidden-life-of-servicemanager-handled-containers/ how to fetch the hana credentials for a specific tenant which I aim to connect to run the tests. Also I'm able to test the connection against the HANA SQL console and I can to query in the DB
.But whenever I set the configuration in the `.cdsrc.json` the application fails with the following error messages:
[hana] - Could not establish connection for tenant "anonymous". Existing pool will be drained.[hana] - Error: Could not establish connection for tenant "anonymous" due to error: Could not connect to any host: [ my-host-prod-us10.hanacloud.ondemand.com:443 - unable to get local issuer certificate ]<br>[...]<br>TimeoutError: Acquiring client from pool timed out. Please review your system setup, transaction handling, and pool configuration.
I saw that this tenant issue could be related to my mocked users not having it set properly, so I did the following (without success)
{ "admin": { "password": "xxxxxxx", "tenant": "my-tenant" }}
Regarding the `unable to get local issuer certificate` I tried with both sslValidateCertificate false and true but the issue kept the same
In my `.cdsrc.json` I have the following configuration:
"dbtesthana": {<br> "kind": "hana",<br> "schema": "xxxx",<br> "credentials": {<br> "host": "xxxx",<br> "port": 443,<br> "user": "xxx", <br> "password": "xxxx",<br> "initializationTimeout": "60000",<br> "sslValidateCertificate": false,<br> "certificate": "-----BEGIN CERTIFICATE-----xxxxxx----END CERTIFICATE-----"<br> } <br>}<br>}
Am I missing something?Changing the configuration to `default-env.json` always results in malformated authentication error.
Thanks a ton for your help!
[Edit1]: formatting issues
[Edit 2]: Hana is already configured to accept all incoming requests as described in SAP Hana Cloud Central: https://help.sap.com/viewer/9ae9104a46f74a6583ce5182e7fb20cb/hanacloud/en-US/770d34deb86d4eb49dc944c...
Hi igor.lauxen ,
You just need to make sure that the correct tenant is set and that multitenancy is enabled. The rest is done automatically.
https://cap.cloud.sap/docs/guides/deployment/as-saas
Best regards,
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Based on this comment I reverted my changes in cdsrc.json and connected to my services hosted in BTP by authenticating using OAuth during test execution.
I'm following this process in the tests because it's how I "define" in which tenant I'm going to access when testing against postman for instance.
The challenge with this approach is that it will only work for previous created entities, if I create a new table called XYZ and and add automation tests for it, it will break in the pipeline because the services for this entity are not yet deployed.
david.kunz2 do you trigger the deployment of the tenant prior the testing/static code checks when testing against a real hana db?
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.