-
Notifications
You must be signed in to change notification settings - Fork 933
Purge test warnings #671
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
Purge test warnings #671
Conversation
private int id; | ||
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely most of those cases could have been fixed by using a setter instead. But this would require analyzing each test case for ensuring their current way of mapping the property was not having any bound with the tested feature.
// Test uses an obsolete .Net feature, changing the private path of an ongoing AppDomain. | ||
// If that feature is dropped, the tests will likely need to be dropped too. (Or heavily changed | ||
// for running in a newly created AppDomain.) | ||
#pragma warning disable CS0618 // Type or member is obsolete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not found a way to do that with non-obsolete methods and without spawning a new app domain for the test. It seems the used methods have been obsoleted precisely because they were altering private path for already created app domain, which the .Net designers seem to advise against.
@@ -2,11 +2,9 @@ | |||
using System.Collections.Generic; | |||
using System.Diagnostics; | |||
using System.Data; | |||
using System.Diagnostics; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated namespace probably due to a rebase miss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise
@@ -12,6 +12,11 @@ | |||
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn> | |||
</PropertyGroup> | |||
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good to treat warnings as errors for all configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to give it a try with only the release build checking that. If that generates frequently PR failing at this but detected a bit too late (especially already merged), it would be easy and fast to change that.
For more easily avoiding adding new compilation warnings to any project, better avoid letting any anywhere.
This PR removes compilations warning from the test project.
An additional commit enables "warnings as errors" for release build. So the release build should detect if any warning is added back. I have not enabled it for debug for avoiding hindering debug session and temporarily fiddling with code.
It appears the Hql.g warnings are not considered by this setting, so they should not block the release build.