marinasundstrom / CheckedExceptions

Enforce better exception handling in C#/.NET by ensuring exceptions are explicitly handled.
MIT License
4 stars 0 forks source link

CI tests fail in cloud #41

Open marinasundstrom opened 6 days ago

marinasundstrom commented 6 days ago

Tests pass locally, but not in cloud. These used to before.

The exception ArgumentNullException should be excluded from reporting due to nullable context.

Tests connected to nullable context don't pass when run in GitHub Actions.

First guess was that it is an issue with the identified nullable context, but might it be the XML?

[xUnit.net 00:00:04.77]     With nullable enabled and declared ArgumentNullException, assigning null should not trigger diagnostic [FAIL]
[xUnit.net 00:00:04.77]       System.InvalidOperationException : Mismatch between number of diagnostics returned, expected "0" actual "1"
[xUnit.net 00:00:04.77]       
[xUnit.net 00:00:04.77]       Diagnostics:
[xUnit.net 00:00:04.77]       // /0/Test0.cs(21,9): warning THROW001: Exception 'ArgumentNullException' might be thrown but not handled
[xUnit.net 00:00:04.77]       VerifyCS.Diagnostic(CheckedExceptionsAnalyzer.THROW001).WithSpan(21, 9, 21, 14).WithArguments("ArgumentNullException", "might be"),
[xUnit.net 00:00:04.77]       
[xUnit.net 00:00:04.77]       
[xUnit.net 00:00:04.77]       Stack Trace:
[xUnit.net 00:00:04.77]         /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/DefaultVerifier.cs(79,0): at Microsoft.CodeAnalysis.Testing.DefaultVerifier.Equal[T](T expected, T actual, String message)
[xUnit.net 00:00:04.77]         /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs(546,0): at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.VerifyDiagnosticResults(IEnumerable`1 actualResults, ImmutableArray`1 analyzers, DiagnosticResult[] expectedResults, IVerifier verifier)
[xUnit.net 00:00:04.77]         
marinasundstrom commented 4 days ago

There seems to be something that makes it fail every other time. While sometimes succeed.