-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
System.Configuration.ConfigurationManager needs more test coverage (51.8%) #20040
Comments
I don't know the process of taking an issue, but I volunteer to increase the test coverage. |
@dhoehna collaborator invite sent. Please ping us when you accept and we will assign it to you. Assigning to @JeremyKuhne in the meantime ;-) |
@JeremyKuhne ca you please add issue type? (I assume test enhancement) |
@karelz I have accepted and enabled two-factor authentication. |
@karelz Now I have accepted the invitation. |
Reassigned to you @dhoehna, thanks for your contribution in the space! |
@karelz Thank you. What is the priority for this issue and what does the priority mean? Also, is there a deadline when this issue has to be resolved? |
Milestone is Future, which means we (.NET team) don't plan to invest into it during 2.0 timeframe. Other than that, no priority or deadline. |
Okay. Thank you. |
Another question. I only see a folder called System.Configuration.ConfigurationManager. Is this the folder that needs better test coverage, or am I looking in the wrong spot? |
@dhoehna can I join this issue? It looks like a great start point to dive into corefx contribution. |
@FireAlkazar I don't mind. Once you are added, we can divvy up the work. @karelz Is it possible to add another contributor? |
@dhoehna System.Configuration.ConfigurationManager is where all of the code is. We couldn't use the same exact assembly name as an existing .NET assembly, this was our best compromise. :) |
@FireAlkazar added, please coordinate the work and/or tell us (me and @JeremyKuhne) if you need help or guidance. |
@FireAlkazar How to you want to divvy it up? I'm thinking of alphabetically. |
@dhoehna I want to try at first to cover ConnectionStrings property of Configuration. Write some simple tests and check if they are ok. And move forward after getting some feedback. |
Okay. I'll start from the beginning than. |
Am I doing something wrong? I can't build System.Configuration.ConfigurationManager. I get errors like "Missing compiler required member 'System.ParamArrayAttribute..ctor'" and "Predefined type System.Enum is not defined or imported" and "Predefined type System.Int32 is not defined or imported" Here is what I have done
I've done 4 years of development on VS and I've done VS development on my current computer, so I don't know what is wrong. Also, I am using Visual Studio 2015. EDIT: I'm assuming the project builds successfully from master. EDIT2: +@karelz |
@dhoehna you need to run the build.cmd from the root once. In order to run the tests you'll need to run the build-tests.cmd once. After that you'll be able to build with the projects directly either through the command line (e.g. msbuild.exe) or in VS. To run all of the tests from VS you need to set the test project as the startup project. We don't have things set up to use the test explorer yet. |
Oh. I thought I did run build.cmd. I am running it now. I'll let you know if I have any problems. |
@JeremyKuhne I am still having issues. Build.cmd ran to completion. I opened visual studio and got the errors as described above but I was able to build all projects in System.Configuration.ConfigurationManager. I do get an error when I try to run the test class though. I pasted the image from my command prompt. |
It would be better if you pasted the output rather than an image. (Just block it in ```.) What solution configuration is active? You should try building the test project from the command line. Run the developer command prompt and in the test directory run If things are messed up it is also worth trying If you can run tests fine from the command line that would mean VS is in the way. Possibly the configuration isn't set right. The spew from my command line run is:
It is also possible you're in a bad state in general (with all of the constant build changes we're making this can happen). Run Here is my console when running in VS:
|
I understand what you're saying, but we're checking for a type, and said type is a concrete type, and we have an object of that type, and I'm confused why it's still returning null |
Hey all, an update. I am still working on this, but took a small Hiatus (I moved and everything has been crazy!) Just wanted to give everyone an update. I hope to send our a PR next week |
Thanks for the update. |
@stephentoub Question for you. Trying to Test AppSettingsReader and some other of the bigger classes that read from the config xml's. I'm struggling to figure out how to create a test app config. I created an app config in the test assembly, but A. it doesn't read from it's appsettings, and B that doesn't feel like a good way to 'mock' a test app config at all. Any Ideas? |
Thanks @JeremyKuhne |
@JeremyKuhne So still some questions. App settings reader's constructor references ConfigurationManager.AppSettings directly, how should I create a temporary config for ConfigurationManager to reference. I was hoping incorrectly that the using block would temporarily change the underlying ConfigurationManager app config, but I was wrong. So I'm still stuck. |
It is no different than hitting the Configuration.AppSettings property- ConfigurationManager simply has a specific Configuration object that it creates based off of it's own path heuristics. You should be able to test everything in AppSettings off the Configuration object explicitly loaded as per the example I gave you. |
Since the PR to fix this is already merged, shall we close this or do we need to increase more coverage? |
There is still more room for improvement. dotnet/corefx#29896 is a step forward, but we have more steps to make. :) |
Hey @JeremyKuhne might want to unassign me to this. Had to change my past time focuses a little bit. Had the luck of getting hit by a car biking, and lately I've been dedicating more time to getting fit again after my hiatus. Plus it'll give someone entry to the project! |
@Jlalond no problem- you're always welcome to come back to this or any other issue |
Hi @JeremyKuhne I want to give a shot to up the code coverage for this issue :). Any pointers which parts are the big wins ? Or should I just look at https://ci.dot.net/job/dotnet_corefx/job/master/job/code_coverage_windows/Code_Coverage_Report/ and pick the ones with the biggest blocks uncovered? |
@Rutix Great! Pick whatever seems interesting to you off of that list. One other suggestion is to go through the docs and try to make sure we have tests covering the described scenarios there. |
Since it would be handy to see what impact my tests have on the code coverage I tried to get coverage working locally. When I do
Any ideas of whats going wrong? |
Just letting you know that your efforts is helping me build this now. :) I'm following the conversation and fixing issues I encounter. |
Hi @FireAlkazar @vnwonah are you folks still working on this one? Also do either of you know the current coverage %? |
I'm going to close this as it seems like a low priority given we plan to make no changes to this library and recommend against its use in new code. |
#19296 ported the code for System.Configuration to facilitate porting existing .NET code. Test coverage is relatively sparse as this effort was meant to be demand driven. Adding additional tests (unit and scenario) is a good opportunity to get one's feet wet in CoreFX.
ConfigurationPermission
is the only class that wasn't ported (Code Access Security isn't supported in CoreFX). The only known non-working class isRsaProtectedConfigurationProvider
which is dependent on System.Security.Cryptography.Xml working (#14950).The text was updated successfully, but these errors were encountered: