-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Consider allowing property to add to file filters for code coverage #37416
Comments
We might consider an item group of file patterns to exclude - easier to get right - and then use item transforms to inject the proper syntax. That said, I worry that a broad filter might explode the command line to the point it's excessive and errs. /cc @hallipr |
@annelo-msft is this still necessary when all of the shared code is moved to public types in |
@heaths, I'm not sure I understand the question -- can you help me understand what the lines of code referenced in the issue are doing and why they're needed today? That will help me extrapolate to a later time when public types are in Azure.Core to say whether it would be needed in that world. Thanks! |
Shared code - code we linked in .csproj files - wasn't getting covered if not tested by individual SDKs' test assemblies. But since you have been moving shared code to publicly exposed code in |
Ah, cool, thanks for the explanation! I expect it will take a while to move everything to public types, but you are correct that this wouldn't be needed once we get to that point. It's also true that once we have #38304, we would expect to have good test coverage of any remaining shared types in Core, so that coverage shouldn't be needed in the service library projects themselves. An alternative to consider to get higher code coverage numbers for shared source files in service libraries might be to include the test files for the shared source files in the projects that reference them, but that could get messy from a dependency perspective, so probably not something we'd want to pursue. |
That's exactly the problem: lack of actual tests for shared files, and we don't want to put The biggest issue is that most of code coverage configuration is through files (XML, if that gives you some idea of age), so a "one size fits all" approach for any given track 2 SDK in a monorepo doesn't really work i.e., the configuration isn't scalable. One thing that might help is just to exclude any types with a namespace prefix of |
Is the top-level goal of this effort to improve code coverage numbers for all libraries, and this piece with shared source is one of the items standing in the way of that goal? |
That's correct. A naive - or perhaps temporary (but maybe more work than it's worth) - is to |
We discussed this in our team today and because shared source is most of the legitimate reason to exclude files and because those should be migrated to publicly exported types in 6-12 months as needed, do not feel additional investment is necessary at this time. We also feel code coverage metrics can be misleading, as briefly described in the associated PR to update our CONTRIBUTING.md with our "soft policy" on this. |
* Add policy statement about code coverage Resolves #37416 * Resolve PR feedback
* Add policy statement about code coverage Resolves Azure#37416 * Resolve PR feedback
https://github.com/Azure/azure-sdk-for-net/blob/2cfa587f85f734fc7da3573a7349b5f642e73e44/eng/CodeCoverage.targets#L63C90-L63C90
We could modify the line above to also take filters from test projects that would ignore shared code, which a lot of libraries use. Ideally, this shared code is tested elsewhere e.g., Azure.Core.TestFramework does this, so every project that uses it doesn't have to.
The text was updated successfully, but these errors were encountered: