Skip to content

Improve System.Reflection.Context.Tests code coverage (~35%) #26506

Closed

Description

@ViktorHofer

Currently at ~35% line coverage.

To test and measure coverage run dotnet build src/System.Reflection.Context/tests/ /t:Test /p:Coverage=true.

Activity

  1. changed the title [-]Improve System.Reflection.Context.Tests code coverage[/-] [+]Improve System.Reflection.Context.Tests code coverage (~35%)[/+] on Jun 15, 2018
  2. mbrameld commented on Aug 14, 2018

    @mbrameld

    I'd like to take this one on and add some tests. I'm following this guide to build and run the tests. Everything works fine from the command line, but when I try to run the tests in Visual Studio 2017 by setting the test project as startup and running it, I get an error saying a project with an output type of class library can't be started. The tests all show up in the test explorer, but when I try to run them it tells me: No test is available in corefx\bin\AnyOS.AnyCPU.Debug\System.Reflection.Context.Tests\netcoreapp\System.Reflection.Context.Tests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

    Am I missing a step somewhere?

  3. ViktorHofer commented on Aug 14, 2018

    @ViktorHofer
    MemberAuthor

    Debugging is currently broken in VS: https://github.com/dotnet/corefx/issues/30913

    But should be back in a few days (finger crossed).

  4. mbrameld commented on Aug 14, 2018

    @mbrameld

    Ah, thanks! I'll keep an eye on that issue and come back to this one.

  5. ViktorHofer commented on Aug 14, 2018

    @ViktorHofer
    MemberAuthor

    Yeah, sure. Thanks a lot for the help! I'll keep you updated. But you don't really need VS. The easiest way to test is:

    cd src/System.Reflection.Context/tests
    dotnet msbuild /t:RebuildAndTest /p:Coverage=true
    
  6. mbrameld commented on Aug 14, 2018

    @mbrameld

    That does run the tests for me, but I could benefit from stepping through things. I'm not familiar with how System.Reflection.Context all works yet and I'm struggling a little without the debugger!

  7. ViktorHofer commented on Aug 14, 2018

    @ViktorHofer
    MemberAuthor

    Understandable. I suggest to wait a few days then 👍

  8. danmoseley commented on Aug 14, 2018

    @danmoseley
    Contributor

    Or add while(!Debugger.IsAttached) Thread.Sleep(1000) to a test them attach VS at leisure?

  9. ViktorHofer commented on Aug 14, 2018

    @ViktorHofer
    MemberAuthor

    Or add while(!Debugger.IsAttached) Thread.Sleep(1000) to a test them attach VS at leisure?

    Or simply a Debugger.Break();

  10. ViktorHofer commented on Aug 14, 2018

    @ViktorHofer
    MemberAuthor

    @mbrameld I sent you a collabor invite so that I can assign you to the issue. Please respond when you accepted it. Make sure to unfollow all the repos as they will be followed by default after you accepted. Otherwise you will get A LOT of emails 😁

  11. mbrameld commented on Aug 14, 2018

    @mbrameld

    I accepted it, thank you!

  12. ViktorHofer commented on Aug 14, 2018

    @ViktorHofer
    MemberAuthor

    I flagged it as easy but it could me more of an intermediate level of work. If you have questions / need help, reach out :)

  13. Adam25T commented on Nov 27, 2018

    @Adam25T

    Hello, in the coming week a group of people trying to gain experience with open source are going to be contributing to corefx. Issues that focus on increasing test coverage seem like a good place to start. How do I become a collaborator on this repo?

  14. ViktorHofer commented on Nov 27, 2018

    @ViktorHofer
    MemberAuthor

    Hi @Adam25T. Awesome, great to hear!! Few things:

    1. If you tell me all the github handles of people who are going to contribute I can add them now. Please make sure to unsubscribe from all the repos as being a members means auto-subscribing to 50+ repos which results in ~500 emails a day.
    2. If you are looking for issue that are relatively easy for first-time-contributors, not just code-coverage, then I can make sure to label all appropriate issues till next week with the easy and up-for-grabs label. If your group is part of a Hackathon we can probably also support you in our Gitter channel to unblock you and make sure that you can work in a productive way. Our docs should be self-explanatory but some advanced topics like System.Private.CoreLib work in coreclr requires tend to cause troubles.

    cc @karelz @danmosemsft

  15. 26 remaining items

  16. ViktorHofer commented on Aug 12, 2022

    @ViktorHofer
    MemberAuthor

    Those are generated by the fantastic ReportGenerator tooling 👍

  17. JosieBigler commented on Sep 16, 2022

    @JosieBigler
    Contributor

    I'm still planning on working on this. Life has gotten busy >_>

    Maybe I can PR what I have done so far? i've uped the code coverage to ~50% ish.

  18. karelz commented on Sep 16, 2022

    @karelz
    Member

    @JosieBigler definitely ok to submit PRs with more tests even if you plan to add more later. You will at least see feedback and potentially avoid some patterns/things that would not pass in code review in future.
    In issues like these we do not shoot for PRs to "have it all".

  19. steveharter commented on Nov 7, 2022

    @steveharter
    Contributor

    @JosieBigler I see that there was a PR for this that you closed -- was it incomplete?

    If you are unable to finish that PR, we may use that as a base for this issue. Thanks

  20. JosieBigler commented on Nov 8, 2022

    @JosieBigler
    Contributor

    @steveharter I pushed the PR, but got failures on different System Architectures that I wasn't expecting. And wanted to correct, and then got busy again. Let me do a pull from main again and push a draft PR to see the results.

  21. JosieBigler commented on Nov 8, 2022

    @JosieBigler
    Contributor

    The current draft PR: #77999

  22. aturnbul commented on Sep 10, 2024

    @aturnbul

    Is this still an open issue? If so, I'd like to help but with the caveat that I'm completely new to Open Source and to Testing in .NET.

  23. added
    in-pr
    on Jan 9, 2026
  24. added a commit that references this issue on Feb 27, 2026
    de761a5
  25. locked and limited conversation to collaborators on Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-System.Reflectiongood first issuehelp wantedin-princrease-code-coveragetest-enhancement

Type

No type

Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions