btp-setup-automator icon indicating copy to clipboard operation
btp-setup-automator copied to clipboard

[FEATURE REQUEST] Enhancement of service testing

Open lechnerc77 opened this issue 3 years ago • 2 comments
trafficstars

Which area is mainly impacted

CLI in general

Requested Feature

Currently the btpsa allows to create (and purge) service instances as well as service keys/bindings on the different environments of SAP BTP (cloudfoundry, kyma, others). This validates if the mechanics to provision a service on an environment works. However, a more decent test of the service would be useful to not only create services, but also to make authenticated calls to the services leveraging the service keys/bindings. Currently the workaround is to use the bash steps in the usecase file to implement the requirement.

The requested feature is to make this flow more convenient as an integral part of btpsa. For that the following enhancements are needed:

  • usecase: per service additional parameters are needed to identify which APIs to call (endpoints, way of authentication etc.
  • btpsa core: Enhancement of processing logic to execute the API calls after provisioning the services including logging of results per service call

Use Case/Scenario

The main use case is to test the services on BTP from a more holistic perspective i.e. not only creating services on different environments but also executing an authenticated call to an endpoint that is provided by the service.

Would you like to support us?

  • [X] Yes, I would like to support you

Anything else?

Sample for the usecase enhancement:

{
    "api_resource_uri": [
        {
            "servicename": "auditlog",
            "plan": "standard",
            "testapi": "/",
            "apiBaseUrlPathKey": "data.url",
            "oauthurlPathkey": "",
            "clientId_basicUN_PathKey": "data.user",
            "clientSecret_basicPW_PathKey": "data.password",
            "authMethod": "basic",
            "APITest": "yes",
            "serviceID": "xyz"
        },
        {
            "servicename": "auditlog",
            "plan": "oauth2",
            "testapi": "/",
            "apiBaseUrlPathKey": "data.url",
            "oauthurlPathkey": "",
            "clientId_basicUN_PathKey": "data.user",
            "clientSecret_basicPW_PathKey": "data.password",
            "authMethod": "basic",
            "APITest": "yes",
            "serviceID": "xyz"
        },
        {
            "servicename": "enterprise-messaging",
            "plan": "default",
            "testapi": "/messagingrest/v1/subscriptions",
            "apiBaseUrlPathKey": "data.messaging.2.uri",
            "oauthurlPathkey": "data.uaa.url",
            "clientId_basicUN_PathKey": "data.uaa.clientid",
            "clientSecret_basicPW_PathKey": "data.uaa.clientsecret",
            "authMethod": "oauth",
            "APITest": "yes",
            "serviceID": "xyz"
        }
    ]
}

lechnerc77 avatar Jul 13 '22 13:07 lechnerc77

This sounds great. Let's discuss how best to integrate the requirement into the btpsa.

From my POV I'd rather add an attribute to the usecase.json file and attach all the metadata related to the purpose. I'll share a proposal soon to discuss our options. Thanks for bringing this up!

rui1610 avatar Jul 14 '22 07:07 rui1610

Current contributions to issue in PR #241 As this is a major change, work will be tracked in dedicated branch consumption-test until stable

lechnerc77 avatar Oct 01 '22 08:10 lechnerc77

Closing the issue due to:

  • no capacity
  • no request from community
  • no support from community

lechnerc77 avatar Sep 05 '23 14:09 lechnerc77