Skip to content
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

ILLink CodeFixer tests are failing #88278

Closed
vitek-karas opened this issue Jun 30, 2023 · 2 comments · Fixed by #88492
Closed

ILLink CodeFixer tests are failing #88278

vitek-karas opened this issue Jun 30, 2023 · 2 comments · Fixed by #88492
Assignees
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers
Milestone

Comments

@vitek-karas
Copy link
Member

For example the UncoditionalSuppressMessageCodeFixTests.FixInCtor is failing with:

    Context: Iterative code fix application
content of '/0/Test0.cs' did not match. Diff shown with expected as baseline:
 
 using System;
 using System.Diagnostics.CodeAnalysis;
 
 public class C
 {
     [RequiresUnreferencedCodeAttribute("message")]
     public int M1() => 0;
 
     [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
+    [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
     public C () => M1();
 }

Expected: True
Actual:   False

  Stack Trace: 
XUnitVerifier.Fail(String message) line 87
IVerifierExtensions.EqualOrDiff(IVerifier verifier, String expected, String actual, String message) line 67
CodeFixTest`1.VerifyProjectAsync(ProjectState newState, Project project, IVerifier verifier, CancellationToken cancellationToken) line 531
CodeFixTest`1.VerifyFixAsync(String language, ImmutableArray`1 analyzers, ImmutableArray`1 codeFixProviders, SolutionState oldState, SolutionState newState, Int32 numberOfIterations, Func`10 getFixedProject, IVerifier verifier, CancellationToken cancellationToken) line 509
CodeFixTest`1.VerifyFixAsync(SolutionState testState, SolutionState fixedState, SolutionState batchFixedState, IVerifier verifier, CancellationToken cancellationToken) line 471
CodeFixTest`1.RunImplAsync(CancellationToken cancellationToken) line 310
AnalyzerTest`1.RunAsync(CancellationToken cancellationToken) line 188

But the underlying issue seems to be that the analyzer is reporting two warnings where it should be reporting only one.
I don't know when this started to happen.

@vitek-karas vitek-karas added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Jun 30, 2023
@vitek-karas vitek-karas added this to the 8.0.0 milestone Jun 30, 2023
@ghost
Copy link

ghost commented Jun 30, 2023

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas
See info in area-owners.md if you want to be subscribed.

Issue Details

For example the UncoditionalSuppressMessageCodeFixTests.FixInCtor is failing with:

    Context: Iterative code fix application
content of '/0/Test0.cs' did not match. Diff shown with expected as baseline:
 
 using System;
 using System.Diagnostics.CodeAnalysis;
 
 public class C
 {
     [RequiresUnreferencedCodeAttribute("message")]
     public int M1() => 0;
 
     [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
+    [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
     public C () => M1();
 }

Expected: True
Actual:   False

  Stack Trace: 
XUnitVerifier.Fail(String message) line 87
IVerifierExtensions.EqualOrDiff(IVerifier verifier, String expected, String actual, String message) line 67
CodeFixTest`1.VerifyProjectAsync(ProjectState newState, Project project, IVerifier verifier, CancellationToken cancellationToken) line 531
CodeFixTest`1.VerifyFixAsync(String language, ImmutableArray`1 analyzers, ImmutableArray`1 codeFixProviders, SolutionState oldState, SolutionState newState, Int32 numberOfIterations, Func`10 getFixedProject, IVerifier verifier, CancellationToken cancellationToken) line 509
CodeFixTest`1.VerifyFixAsync(SolutionState testState, SolutionState fixedState, SolutionState batchFixedState, IVerifier verifier, CancellationToken cancellationToken) line 471
CodeFixTest`1.RunImplAsync(CancellationToken cancellationToken) line 310
AnalyzerTest`1.RunAsync(CancellationToken cancellationToken) line 188

But the underlying issue seems to be that the analyzer is reporting two warnings where it should be reporting only one.
I don't know when this started to happen.

Author: vitek-karas
Assignees: sbomer
Labels:

area-Tools-ILLink

Milestone: 8.0.0

@vitek-karas
Copy link
Member Author

@sbomer could you please take a look?

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 6, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 7, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants