mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-29 13:52:01 +08:00

* feat: cloud service integrations: get model and repo interface started * feat: cloud service integrations: flesh out more of cloud services model * feat: cloud integrations: reorganize things a little * feat: cloud integrations: get svc controller started * feat: cloud integrations: add stubs for EC2 and RDS postgres services * feat: cloud integrations: add validation for listing and getting available svcs and some cleanup * feat: cloud integrations: refactor helpers in existing integrations code for reuse * feat: cloud integrations: parsing of cloud service definitions * feat: cloud integrations: impl for getCloudProviderService * feat: cloud integrations: some reorganization * feat: cloud integrations: some more cleanup * feat: cloud integrations: add validation for listing available cloud provider services * feat: cloud integrations: API endpoint for listing available cloud provider services * feat: cloud integrations: add validation for getting details of a particular service * feat: cloud integrations: API endpoint for getting details of a service * feat: cloud integrations: add controller validation for configuring cloud services * feat: cloud integrations: get serviceConfigRepo started * feat: cloud integrations: service config in service list summaries when queried for cloud account id * feat: cloud integrations: only a supported service for a connected cloud account can be configured * feat: cloud integrations: add validation for configuring services via the API * feat: cloud integrations: API for configuring services * feat: cloud integrations: some cleanup * feat: cloud integrations: fix broken test --------- Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
35 lines
817 B
Go
35 lines
817 B
Go
package cloudintegrations
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"go.signoz.io/signoz/pkg/query-service/model"
|
|
)
|
|
|
|
func TestAvailableServices(t *testing.T) {
|
|
require := require.New(t)
|
|
|
|
// should be able to list available services.
|
|
_, apiErr := listCloudProviderServices("bad-cloud-provider")
|
|
require.NotNil(apiErr)
|
|
require.Equal(model.ErrorNotFound, apiErr.Type())
|
|
|
|
awsSvcs, apiErr := listCloudProviderServices("aws")
|
|
require.Nil(apiErr)
|
|
require.Greater(len(awsSvcs), 0)
|
|
|
|
// should be able to get details of a service
|
|
_, apiErr = getCloudProviderService(
|
|
"aws", "bad-service-id",
|
|
)
|
|
require.NotNil(apiErr)
|
|
require.Equal(model.ErrorNotFound, apiErr.Type())
|
|
|
|
svc, apiErr := getCloudProviderService(
|
|
"aws", awsSvcs[0].Id,
|
|
)
|
|
require.Nil(apiErr)
|
|
require.Equal(*svc, awsSvcs[0])
|
|
}
|