-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
run unit tests in CI against dotnet 8 #306
Conversation
…atch a conflict with System.Diagnostics.PerformanceCounter
…InvalidFileNameChars
…dotnet does not define a default algorithm
…d to the output directory
…ation set so the output path is consistent.
…s that IcuData will be copied to the output directory for dotnet 8 projects that depend on SIL.LCModel.Core
…ncluding Newtonsoft.Json.dll. Use TestContext.Out instead of Console.WriteLine. Fix assertion in CustomIcuFallbackTests.InitIcuDataDir_NoIcuLibrary due to how the error is different between .NET Framework and .NET Core.
…opying the LICENSE file, this avoids the strong name issues with the NuGet package.
… tests were failing because '<' is valid in a path but not a file name
@jasonleenaylor |
@hahn-kev yes, we can do that. I will want to get some other changes merged first so I can delay the corresponding work in FieldWorks until the next sprint. |
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.
These changes look good. Thanks for removing the netstandard target for the test projects -- I don't think we have any realistic reason to keep that.
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.
Reviewed 3 of 11 files at r1, 3 of 12 files at r2, 7 of 7 files at r3, all commit messages.
Reviewable status: 13 of 23 files reviewed, all discussions resolved
src/SIL.LCModel.Utils/SIL.LCModel.Utils.csproj
line 13 at r3 (raw file):
<PackageReference Include="GitVersion.MsBuild" Version="5.6.10" PrivateAssets="All" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> <PackageReference Include="SIL.Core" Version="14.2.0-beta0021" />
Here, and elsewhere I'd like to keep the wildcard, I accept the risk of a breaking library change in the same version over constant update maintenance churn. Basically, I trust me/us on our core libraries.
tests/SIL.LCModel.Tests/RhinoMocksToMoq/Expect.cs
line 1 at r3 (raw file):
using System;
🤮
We should discuss, this may be the best solution but I prefer to avoid inlining 3rd party code.
Previously, jasonleenaylor (Jason Naylor) wrote…
Yeah I tried using the library but was getting errors due to the Nuget dlls not being signed, so I decided to inline it. I'd be happy to use the package if you know what we should do about that. |
… expects it to be, just disabled GitVersion for TestHelper since it's not published.
@jasonleenaylor when I run with the nuget package to sub RhinoMocks for Moq I get this error at runtime in dotnet framework:
in addition the default configuration of Moq doesn't match the default config of RhinoMocks (automatically setting up all properties) and the nuget replacment does not configure that properly, so we'd have to touch every place that uses MockRepository to get a mock or stub. If you can figure out the strongly named assembly issue then I'll take the time to get the tests working by making sure setup is called before the test code uses the mock. I've pushed the version that uses the nuget package. |
2b32055
to
7a67c5a
Compare
@jasonleenaylor I inlined the helper lib for RhinoMocks like we talked about on Friday/Thursday, I'm ready to merge this in. Not sure why that PR check is failing but I don't think it's related to this PR |
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.
Reviewed 1 of 11 files at r1, 1 of 12 files at r2, 5 of 5 files at r4, 9 of 9 files at r6, 1 of 1 files at r7, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @hahn-kev)
Our team is planning to use LCM on dotnet 8, so I decided it would be good to run tests against dotnet 8. In doing so I found a few issues with some paths which would cause errors during build or clean.
Prevously RhinoMocks was being used however it does not support modern dotnet, Moq is the suggested replacement and I found a library that works as a shim, so I didn't need to rewrite any of the test code (with one exception).
Lastly I had to make Core and TestHelper target net8.0 also as tests would not get the desired IcuData and other dependancies otherwise.
Actual code changes:
There's currently some failing tests due to NHunspell not supporting anything but .Net framework and it's last update was 2015. I suggest we go to https://github.com/aarondandy/WeCantSpell.Hunspell as it's been updated in the last year and supporst .net standard 2.0. However I think that's out of scope for this PR.
This change is