MCPcopy Index your code
hub / github.com/cloudquery/cloudquery / TestCleanInitError

Function TestCleanInitError

cli/internal/platform/inject_test.go:533–544  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

531}
532
533func TestCleanInitError(t *testing.T) {
534 // gRPC-wrapped plugin-init chain → strip the rpc + plugin-sdk prefixes,
535 // leaving the destination's own message.
536 wrapped := status.Error(codes.Internal,
537 "failed to init plugin: failed to initialize client: failed to start sync with CloudQuery Platform: unsupported source plugin version(s): aws (supported version: v33.28.0) (HTTP 422)")
538 require.Equal(t,
539 "failed to start sync with CloudQuery Platform: unsupported source plugin version(s): aws (supported version: v33.28.0) (HTTP 422)",
540 CleanInitError(wrapped))
541
542 // A plain (non-gRPC) error passes through unchanged.
543 require.Equal(t, "boom", CleanInitError(errors.New("boom")))
544}
545
546func sessionWithPluginVersion(version string) func(http.ResponseWriter, *http.Request) {
547 return func(w http.ResponseWriter, _ *http.Request) {

Callers

nothing calls this directly

Calls 2

CleanInitErrorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected