Skip to content

Raise the default warning level in tests#47077

Merged
RikkiGibson merged 43 commits intodotnet:masterfrom
Youssef1313:patch-19
Oct 17, 2020
Merged

Raise the default warning level in tests#47077
RikkiGibson merged 43 commits intodotnet:masterfrom
Youssef1313:patch-19

Conversation

@Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Aug 23, 2020

Fixes #46976

@RikkiGibson Could you have a look if what I'm doing until now is the correct thing?

@Youssef1313 Youssef1313 requested a review from a team as a code owner August 23, 2020 11:58
@Youssef1313 Youssef1313 marked this pull request as draft August 23, 2020 12:01
@jcouv jcouv added Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee. labels Aug 23, 2020

public class AnalyzerFileReferenceAppDomainTests : TestBase
{
private const int MaxWarningLevel = 9999;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this project doesn't have a reference to TestOptions, I created this const. But I don't feel this approach is good. This const is defined in a few other tests in this project.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it would be reasonable to define it next to

internal const int DefaultWarningLevel = 4;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't max warning level just int.MaxValue ?

Copy link
Member Author

@Youssef1313 Youssef1313 Aug 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should work, but it was documented here as 9999 so I matched that.

@Youssef1313
Copy link
Member Author

@jaredpar @RikkiGibson I've addressed your feedback and also updated more tests (there are still a few other tests that needs to be updated too).

@Youssef1313 Youssef1313 marked this pull request as ready for review September 21, 2020 16:49
@Youssef1313
Copy link
Member Author

Pinging @RikkiGibson
If this is still needed, can you have a look at #47077 (comment)

@RikkiGibson
Copy link
Member

#47077 (comment)

I think we should include the new warning in CS0722ERR_ReturnTypeIsStaticClass01--however I don't have a strong opinion about this.

@Youssef1313
Copy link
Member Author

@RikkiGibson I included it. Can you re-run the failed jobs? the current failures seem unrelated to the changes.

If this is ready to go, you may want consider a squash/merge. The number of commits here is unnecessarily large

@Youssef1313
Copy link
Member Author

@RikkiGibson Build is green now.

@RikkiGibson RikkiGibson self-assigned this Oct 5, 2020
@RikkiGibson
Copy link
Member

@dotnet/roslyn-compiler for another review. It's a test only change, but sweeping enough that it feels like getting another pair of eyes on it would be good.

Suggest starting with the following files:

Then skimming the rest of it.

@jcouv
Copy link
Member

jcouv commented Oct 16, 2020

Looking

@jcouv jcouv self-assigned this Oct 16, 2020
@Youssef1313
Copy link
Member Author

Note: commit-by-commit review is not recommended at all, the commits here are messy. I'd also recommend a squash/merge to not pollute the master history.

/// <param name="optimizationLevel">The optimization level of the created compilation options.</param>
/// <param name="allowUnsafe">A boolean specifying whether to allow unsafe code. Defaults to false.</param>
/// <returns>A CSharpCompilationOptions with the specified <paramref name="outputKind"/>, <paramref name="optimizationLevel"/>, and <paramref name="allowUnsafe"/>.</returns>
internal static CSharpCompilationOptions CreateTestOptions(OutputKind outputKind, OptimizationLevel optimizationLevel, bool allowUnsafe = false)
Copy link
Member

@jcouv jcouv Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal [](start = 8, length = 8)

private? Never mind. Somehow did a bad search ;-) #Closed

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks (iteration 43). I'll re-run CI to make sure we didn't introduce new conflicts this the PR was last run.

@Youssef1313
Copy link
Member Author

@jcouv That was already done. The current CI run was succeeded 2 hours ago in 1h 44m 11s

@RikkiGibson RikkiGibson merged commit b43d165 into dotnet:master Oct 17, 2020
@ghost ghost added this to the Next milestone Oct 17, 2020
@RikkiGibson
Copy link
Member

Thanks for the contribution @Youssef1313!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raise the default WarningLevel to latest in tests

6 participants