Aspnetcore.docs: gRPC testing page

Created on 21 Feb 2020  路  8Comments  路  Source: dotnet/AspNetCore.Docs

New page proposition for testing in gRPC

I have been working with gRPC for .NET recently and using microsoft documentation about this topic. I have noticed that gRPC has articles that covers, logging, loar balancing, authorization. However documentation is missing testing documentation for gRPC. I think that testing is a key element of nowadays software development and it should get covered. I can prepare both content and code examples. Approach that I propose base on already existing capabilities of in-memory test server used for testing MVC controllers.

What I mean is a new page with following subchapters

  • unit testing (similar to already existing page for MVC: https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/testing )
  • integration testing (similar to already existing page for MVC: https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests )

Suggested location in the Table of Contents

  • below Remote Procedure Call apps node,

    • next to gRPC authorization article (https://docs.microsoft.com/en-us/aspnet/core/grpc/authn-and-authz)

Suggested title
Testing

Abstract
Following article present recommended approach for unit testing and integration testing in gRPC for ASP.NET Core. There are two types of testing for gRPC services. Unit tests involve testing single method of a gRPC service in isolation from its infrastructure and dependencies. Integration tests ensure that an app's components function correctly at a level that includes the app's supporting infrastructure. ASP.NET Core for gRPC supports integration tests using a test web host and an in-memory test server.

Outline for the new topic

  • Introduction
  • Unit testing for gRPC services

    • Code samples

  • Integration testing for gRPC services

    • Relation to ASP.NET MVC integration testing

    • Code samples

  • Additional resources

Regards
Pawe艂 Wichary

gRPC needs-more-info

All 8 comments

@Rick-Anderson do you need something specific from me or you are looking for somebody to review this topic?

My guess is we'll close this as a suggestion but probably won't create the topic anytime soon.

May I ask what is the point of closing it as suggestion when contribution was offered?

It takes considerable resources to review and get into a publishing state. It's been our experience we need to maintain the new topics. I'll let the gRPC team make the decision.

The best chance of getting this approved is to create the topic in your GitHub repo, similar to https://github.com/blowdart/AspNetSameSiteSamples

@Rick-Anderson thank you for sharing your opinion. Sure, I will prepare something similar, or at least I will give it a my best shoot.

Because of other duties, preparing samples will take me a bit longer than expected.

Unfortunately, I haven't found time to write a document, but it is possible that I will do so in the near future. If anyone needs an example of this approach, here is a link https://github.com/wicharypawel/net-core-grpc-integration-tests

We'll take a look at this when/if you have time.

Was this page helpful?
0 / 5 - 0 ratings