Raj Kamal Singh 9ace374855
Feat: QS: Log Pipelines for installed integrations (#4674)
* chore: refactor: inject sqlx.DB into opamp.initDB instead of DB file name

* chore: reorganize test utils a little

* chore: add test validating pipelines for installed integrations show up in pipelines list

* chore: get basic integration pipelines testcase passing

* chore: reconcile experimental changes with latest state of develop

* chore: add integration test for reordering of pipelines

* chore: marker for integration pipelines using Id

* chore: hookup propagation of installed integration pipelines by opamp

* chore: add util for mapping slices

* chore: add support for reordering integration pipelines

* chore: exclude user saved integration pipelines if no longer installed

* chore: flesh out rest of intgeration pipelines scenarios

* chore: handle scenario when an integration is installed before any pipelines exist

* chore: notify agentConf of update after uninstalling an integration

* chore: some minor cleanup

* chore: some more cleanup

* chore: update ee server for changed controllers

* chore: some more cleanup

* chore: change builtin integration id prefix to avoid using colons that break yaml

* chore: update builtin integration id in test
2024-03-11 14:15:11 +05:30

33 lines
681 B
Go

package integrations
import (
"context"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestBuiltinIntegrations(t *testing.T) {
require := require.New(t)
repo := BuiltInIntegrations{}
builtins, apiErr := repo.list(context.Background())
require.Nil(apiErr)
require.Greater(
len(builtins), 0,
"some built in integrations are expected to be bundled.",
)
nginxIntegrationId := "builtin-nginx"
res, apiErr := repo.get(context.Background(), []string{
nginxIntegrationId,
})
require.Nil(apiErr)
nginxIntegration, exists := res[nginxIntegrationId]
require.True(exists)
require.False(strings.HasPrefix(nginxIntegration.Overview, "file://"))
}