(t *testing.T)
| 531 | } |
| 532 | |
| 533 | func 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 | |
| 546 | func sessionWithPluginVersion(version string) func(http.ResponseWriter, *http.Request) { |
| 547 | return func(w http.ResponseWriter, _ *http.Request) { |
nothing calls this directly
no test coverage detected