diff --git a/lang/csharp/.gitignore b/lang/csharp/.gitignore index 80304575bd8..4218bd59d51 100644 --- a/lang/csharp/.gitignore +++ b/lang/csharp/.gitignore @@ -52,5 +52,7 @@ obj/ #Test results TestResult.xml +Coverage +TestResults .vs/ diff --git a/lang/csharp/CODECOVERAGE.md b/lang/csharp/CODECOVERAGE.md new file mode 100644 index 00000000000..c06cc5af7f1 --- /dev/null +++ b/lang/csharp/CODECOVERAGE.md @@ -0,0 +1,31 @@ + +# C# Avro Code Coverage + +The following instructions should be followed in order to create a code coverage report locally. + +1. Open a command prompt +2. Install ReportGenerator globally\ + a. Run the following command line: `dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.1.4 --add-source https://www.nuget.org/packages/`\ + b. The latest version can be found at [Nuget ReportGenerator](https://www.nuget.org/packages/dotnet-reportgenerator-globaltool/) +3. Navigate to the test project `avro\lang\csharp\src\apache\test` +4. Run the following test command `dotnet test --results-directory ./TestResults --collect:"XPlat Code Coverage"` +5. Generate the report with the following command `ReportGenerator "-reports:./TestResults/*/coverage.cobertura.xml" "-targetdir:./Coverage/" -reporttypes:HTML` +6. Open Report under `avro\lang\csharp\src\apache\test\Coverage\index.html` diff --git a/lang/csharp/src/apache/test/Avro.test.csproj b/lang/csharp/src/apache/test/Avro.test.csproj index 18b5dd8a31f..24fa4b31fc6 100644 --- a/lang/csharp/src/apache/test/Avro.test.csproj +++ b/lang/csharp/src/apache/test/Avro.test.csproj @@ -32,6 +32,14 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/lang/csharp/versions.props b/lang/csharp/versions.props index d1c39164f5e..170e609db36 100644 --- a/lang/csharp/versions.props +++ b/lang/csharp/versions.props @@ -52,9 +52,12 @@ 0.13.1 + 3.1.2 + 3.1.2 17.1.0 17.1.0 4.1.0