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

Net6launch #297

Merged
merged 47 commits into from
Sep 22, 2022
Merged

Net6launch #297

merged 47 commits into from
Sep 22, 2022

Conversation

josephmyers
Copy link
Collaborator

@josephmyers josephmyers commented Sep 16, 2022

This change is Reviewable

josephmyers and others added 12 commits September 9, 2022 11:04
Seeing what happens when the hgrc always points to ChorusMerge.exe over the script. Based on the comment, it would appear chorusmerge was only necessary for Mono. It would be really nice to be able to eliminate that extra piece from the equation, but it's near impossible to test without pushing packages to Nuget. Also not clear is why the hgrc is even using the chorusmerge script, when that set lies in IsMono code. Is Platform.IsMono true when on .NET6?
currently run conditions are still master or manual run
This is an effort to reproduce the chorusmerge script failure on .NET6. The script may be being called by LfMerge, but something about the ChorusMerge executable has changed between Framework and .NET6. It could be a pathing issue. I noticed that when I mangled the executable name in the hgrc, the "hg merge" command failed silently, as it does in production. Now, I seem to remember verifying chorusmerge wasn't even being launched in the lfmerge container. However, with the changes in ExecutionEnvironment, we don't use chorusmerge in the first place, which would be a great improvement if it's possible. Sending this to the other computer, since this one's WSL is hosed.
This is required on .NET6 to prevent an exception.
However, instead of triggering off of Platform.IsMono, we trigger off of Platform.IsLinux. It's not Mono that makes the script required, at least apparently. hg isn't able to launch the .exe directly on Linux. Someone with more Linux experience may be able to configure it to do so, but for the current effort I'm re-integrating the chorusmerge script.
is this the easiest way to test linux? ugh
@github-actions
Copy link

github-actions bot commented Sep 16, 2022

Test Results

     10 files  +       2     443 suites  +204   1h 26m 28s ⏱️ + 40m 49s
   973 tests +       1     917 ✔️ ±       0    56 💤 +    1  0 ±0 
4 190 runs  +1 992  3 966 ✔️ +1 887  224 💤 +105  0 ±0 

Results for commit 37e6d0b. ± Comparison against base commit 9549415.

This pull request skips 1 test.
ExternalFileModification_NotifiesIndices_ButSaveDoesNot

♻️ This comment has been updated with latest results.

Got the test failure I was expecting. The test chorusmerge is being called. This is different from how I remember production behaving. I wasn't able to verify chorusmerge is being called in the production environment. But there could've been something else going on.
Plus better print statements for the test chorusmerge
With .IsMono, the test, according to the output statements, is failing like the production environment. So that's a good step
.github/workflows/dotnet.yml Outdated Show resolved Hide resolved
src/LibChorus/Utilities/ExecutionEnvironment.cs Outdated Show resolved Hide resolved
josephmyers and others added 11 commits September 16, 2022 13:29
dotnet run is not working, which is what's in the production code
trying to get dotnet pack to increment. when it's the same name/version, something in the process causes it to be ignored, even though the output dll's are different
One note: System.Diagnostics.Debug no longer exists in .NET Core. System.Diagnostics.Trace is more or less equivalent for the purposes of the test using it. We'll see how the build server responds.
Also only running the corresponding tests on Framework. Technically, this does leave a coverage gap for .NET/Windows.
It's certainly possible this actually specific to Mono, but I think it in fact applies to Linux as a whole, and the previous was a slight oversight. We'll see what the build server thinks.
MergeConflictEmbeddedMessageContentHandler is dependent on WinForms, and as such we shouldn't expect it to be present on .NET6 builds. The Platform("Net-4.0") indicates a run on Windows/net461 and Linux/mono/net461.
This test is supposed to be skipped on the build server. Clearly it is not. Ugh.
it's hanging. maybe due to net6?
super confused. latest changes from develop are breaking on this branch
@josephmyers josephmyers marked this pull request as ready for review September 20, 2022 04:14
@josephmyers
Copy link
Collaborator Author

I'm not sure what's going with the latest changes to dotnet.yml, but they're causing the windows tests (net461) to hang. Before, the command was run: dotnet test -- NUnit.TestOutputXml=TestResults, but now that it's run: dotnet test --no-build -c Release --filter TestCategory!=SkipOnBuildServer -- NUnit.TestOutputXml=TestResults, it hangs during a test.

Here's a snippet from a test run without --no-build:

  Skipped LaunchDialog_SimulatedUsb_USBHasInvalidRepo
  Skipped ShowIt
  Skipped LaunchDialog_CustomAddress
  Skipped LaunchDialog_FullAddress
Warning: Killing Hg Process...

    Syncing...
    Started at 2022-09-20 03:55:53Z
    Local User: bob
    LanguageForge User: 

But with it, it hangs after Skipped LaunchDialog_FullAddress.

Unfortunately, removing --no-build avoids the hang, but now ChorusMerge.Tests fail and LibChorus.Tests are skipped. Ideas, anyone?

@ermshiperete
Copy link
Member

Do you know which tests hang? Did you try to ignore (for the purpose of tracking down the problem) the new HgMergeTests to see if that makes a difference?

@josephmyers
Copy link
Collaborator Author

Even with a diagnostic test run, the current test being run isn't printed (lol), but I figured it out and have the fix pushed. It was related to some Encoding call required for .NET6 but breaking for Framework.

The tests take longer to finish, now that we're running LibChorus on .NET6 as well. I think it's worth it, but I'm open to whatever.

src/ChorusMerge/ChorusMerge.csproj Show resolved Hide resolved
src/ChorusMerge/Program.cs Show resolved Hide resolved
src/ChorusMerge/Program.cs Show resolved Hide resolved
src/LibChorusTests/MiscTests.cs Show resolved Hide resolved
src/LibChorusTests/VcsDrivers/Mercurial/HgMergeTests.cs Outdated Show resolved Hide resolved
var encryptedData = ProtectedData.Protect(Encoding.Unicode.GetBytes(encryptMe), Encoding.Unicode.GetBytes(EntropyValue), DataProtectionScope.CurrentUser);

if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) &&
!RuntimeInformation.FrameworkDescription.Contains("Framework"))
Copy link
Member

@ermshiperete ermshiperete Sep 21, 2022

Choose a reason for hiding this comment

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

This doesn't work when testing on my local machine. When running with Mono RuntimeInformation.FrameworkDescription returns Mono 6.12.0.182 (tarball Tue Jun 14 22:35:00 UTC 2022).

When running the net6.0 tests in Rider things don't work either. I created a libpalaso PR (sillsdev/libpalaso#1227) that makes things behave correctly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, I'm unable to see this on my Linux box. Should I replace Framework with something? Maybe Mono? Do I need another condition? Or I could try deleting it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What command are you using to run with Mono? It's quite possible I'm not using the right thing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reverted this code. It's unrelated to the core bug, which was just Platform.IsMono -> .IsLinux, and created a separate issue for it.

Copy link
Member

Choose a reason for hiding this comment

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

I was stepping through the net461 tests in the debugger in Rider on Ubuntu 22.04.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok. Yeah I have less of a pure Linux environment, being on WSL, so I trust your PC more than mine

josephmyers and others added 3 commits September 22, 2022 10:45
I noticed they weren't running on the build server, and we have precedent for the Mono keyword on other Platform attributes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chorus fails to resolve merge conflict when syncing in Language Forge
2 participants