[ 
https://issues.apache.org/jira/browse/AVRO-3415?focusedWorklogId=738883&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-738883
 ]

ASF GitHub Bot logged work on AVRO-3415:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Mar/22 15:57
            Start Date: 09/Mar/22 15:57
    Worklog Time Spent: 10m 
      Work Description: KyleSchoonover commented on a change in pull request 
#1565:
URL: https://github.com/apache/avro/pull/1565#discussion_r814907216



##########
File path: lang/csharp/src/apache/test/Avro.test.csproj
##########
@@ -47,7 +47,7 @@
 
   <ItemGroup>
     <PackageReference Include="Microsoft.NET.Test.Sdk" 
Version="$(MicrosoftNETTestSdkVersion)" />
-    <PackageReference Include="ReportGenerator" Version="5.0.4" />
+    <PackageReference Include="ReportGenerator" Version="$(ReportGenerator)" />

Review comment:
       Is it really needed? No.  It's not needed at all unless you want to 
generate the report.  This makes it easier so that the local nuget cache has 
the required files to generate the report.  So no manual install.  As for 
private that would only matter if someone specifically references the test 
project.

##########
File path: lang/csharp/CODECOVERAGE.md
##########
@@ -0,0 +1,8 @@
+# C# Avro Code Coverage
+
+The following instructions should be followed in order to create a code 
coverage report locally.  Please note that this assumes you are running on 
Windows OS and that your local nuget cache is under you user profile.
+
+1. Open a command prompt
+2. Navigate to the test project `avro\lang\csharp\src\apache\test`
+3. Run the following test command `dotnet test --results-directory 
./TestResults --collect:"XPlat Code Coverage"`
+4. Generate the report with the following command `dotnet 
%USERPROFILE%\.nuget\packages\reportgenerator\5.0.4\tools\net6.0\ReportGenerator.dll
 "-reports:./TestResults/*/coverage.cobertura.xml" "-targetdir:./Coverage/" 
-reporttypes:HTML`

Review comment:
       You can add it as an option to the documentation later.  Trying to stick 
with what we can control without a contributor having to run a special install 
instruction.

##########
File path: lang/csharp/CODECOVERAGE.md
##########
@@ -0,0 +1,8 @@
+# C# Avro Code Coverage
+
+The following instructions should be followed in order to create a code 
coverage report locally.  Please note that this assumes you are running on 
Windows OS and that your local nuget cache is under you user profile.
+
+1. Open a command prompt
+2. Navigate to the test project `avro\lang\csharp\src\apache\test`
+3. Run the following test command `dotnet test --results-directory 
./TestResults --collect:"XPlat Code Coverage"`
+4. Generate the report with the following command `dotnet 
%USERPROFILE%\.nuget\packages\reportgenerator\5.0.4\tools\net6.0\ReportGenerator.dll
 "-reports:./TestResults/*/coverage.cobertura.xml" "-targetdir:./Coverage/" 
-reporttypes:HTML`

Review comment:
       That assumes someone sets their path via command line to run.  I gave 
the simple copy paste.

##########
File path: lang/csharp/CODECOVERAGE.md
##########
@@ -0,0 +1,8 @@
+# C# Avro Code Coverage

Review comment:
       None of the other MD files have it. Are we sure we want to add it here?

##########
File path: lang/csharp/src/apache/test/Avro.test.csproj
##########
@@ -32,13 +32,22 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <PackageReference Include="coverlet.collector" 
Version="$(CoverletCollectorVersion)">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; 
buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="coverlet.msbuild" 
Version="$(CoverletMSBuildVersion)">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; 
buildtransitive</IncludeAssets>
+    </PackageReference>
     <PackageReference Include="NUnit" Version="$(NUnitVersion)" />
     <PackageReference Include="NUnit3TestAdapter" 
Version="$(NUnit3TestAdapterVersion)" />
     <PackageReference Include="NUnit.ConsoleRunner" 
Version="$(NUnitConsoleRunnerVersion)" />
   </ItemGroup>
 
   <ItemGroup>
     <PackageReference Include="Microsoft.NET.Test.Sdk" 
Version="$(MicrosoftNETTestSdkVersion)" />
+    <PackageReference Include="ReportGenerator" 
Version="$(ReportGeneratorVersion)" />

Review comment:
       I disagree.  And since you didn't point me to the code coverage 
standards I'm still not changing the dependency to generate the report.

##########
File path: lang/csharp/src/apache/test/Avro.test.csproj
##########
@@ -47,7 +47,7 @@
 
   <ItemGroup>
     <PackageReference Include="Microsoft.NET.Test.Sdk" 
Version="$(MicrosoftNETTestSdkVersion)" />
-    <PackageReference Include="ReportGenerator" Version="5.0.4" />
+    <PackageReference Include="ReportGenerator" Version="$(ReportGenerator)" />

Review comment:
       Can you send a link to your best practices?  This is exactly what my 
team does to integrate the reports into the CI/CD pipeline.

##########
File path: lang/csharp/versions.props
##########
@@ -57,5 +57,8 @@
     <NUnitConsoleRunnerVersion>3.14.0</NUnitConsoleRunnerVersion>
     <NUnit3TestAdapterVersion>4.2.1</NUnit3TestAdapterVersion>
     <StyleCopAnalyzersVersion>1.1.118</StyleCopAnalyzersVersion>
+    <CoverletCollectorVersion>3.1.2</CoverletCollectorVersion>

Review comment:
       Alphabetical?  Would you also like me to make a comment in there to say 
that it should be sorted in a certain way?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 738883)
    Time Spent: 3h 50m  (was: 3h 40m)

> Add C# code coverage support
> ----------------------------
>
>                 Key: AVRO-3415
>                 URL: https://issues.apache.org/jira/browse/AVRO-3415
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: csharp
>            Reporter: Kyle Schoonover
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> This will add the following dependencies to the test project:
> coverlet.collector version 3.1.2
> coverlet.msbuild version 3.1.2
> ReportGenerator version 5.0.4



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to