-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude from generated code from code coverage #123
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Refitted the CodeCov workflow for simplicity. The 'Build' step was removed because it was redundant as 'dotnet test' also builds the project. Also, the 'Test' command was modified to directly target the test project, which makes it more precise and potentially speeds up the process. Redundant commands listing files were also eliminated.
The refit interface generators have been updated to include the GeneratedCode attribute in the interface declarations. This has been done to clearly mark automatically generated code and provide clarity about its source and version.
New tests have been added to the 'SwaggerPetstoreTests' in 'Refitter.Tests' to verify the functionality of the 'GenerateCode' method with respect to different versions and formats of the SwaggerPetstore specification (both JSON and YAML, V2 and V3), and different settings of the 'MultipleInterfaces' property. The aim is to ensure that the generated code includes the proper 'GeneratedCode' attribute.
A new test file named MultipleInterfacesByTagsTests.cs was added in Refitter.Tests/Examples. The test ensures that the Refitter API generator creates the correct interfaces when the API specification contains multiple tags. The tests also verify that generated code can be built successfully. The addition of this test improves the code coverage and assure the functionality of MultipleInterfaces.
Added a new test file 'MultipleInterfacesByEndpointTests.cs' in the 'Refitter.Tests' project to verify the multiple interfaces' handling. Tests ensure the correctness of the system in generating different endpoints like 'IGetAllFoosEndpoint' and 'IGetAllBarsEndpoint', ensuring the handling of different operations for every endpoint.
Codecov Report
@@ Coverage Diff @@
## main #123 +/- ##
===========================================
+ Coverage 86.21% 98.25% +12.03%
===========================================
Files 34 31 -3
Lines 1030 972 -58
===========================================
+ Hits 888 955 +67
+ Misses 131 6 -125
Partials 11 11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Kudos, SonarCloud Quality Gate passed! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The changes here add the
[GeneratedCode]
attribute to the generated types