verifytests / diffengine Goto Github PK
View Code? Open in Web Editor NEWManages launching and cleanup of diff tools
License: MIT License
Manages launching and cleanup of diff tools
License: MIT License
So the buildArguments
parameter is a BuildArguments
instead of a Func<string,string,string>
I recently came across a problem where a Verify test failed in our docker build process (tests being executed as part of our Dockerfile) where it tried to start the diffengine from within the docker daemon (hope I'm using these terms correctly :-)) Setting the environment variable DiffEngine_Disabled
in our test when running in docker solves the problem as explained here: https://github.com/VerifyTests/DiffEngine#buildserverdetector. However, I'm wondering if it would be a good idea to also detect if a test run is being executed as part of the docker build in a similar way as I assume is the case for for instance TeamCity, Azure Devops etc and set BuildServerDetector.Detected
automatically?
Not sure if this is even possible or how to go about fixing it but before trying to look for a solution I thought that I'd ask if this is something that's desirable to try to find a solution to before creating a PR for it?
This blog post https://www.hanselman.com/blog/detecting-that-a-net-core-app-is-running-in-a-docker-container-and-skippablefacts-in-xunit mentions an environment variable named DOTNET_RUNNING_IN_CONTAINER
, maybe that one is still around to be used?
The alternative solution to this is most probably to set the DiffEngine_Disabled
variable manually but if this is possible to avoid I think it would be a good idea.
KDiff3 v1.8.2 64b installed under %ProgramFiles%\kdiff3\bin\kdiff3.exe
for me (I just used the default installation options). This is not a path DiffEngine searches under, since that's %ProgramFiles%\KDiff3\kdiff3.exe
(note the difference in casing and the bin
folder). While the casing difference wouldn't cause any issues on NFTS, the subfolder difference does, and thus DiffEngine can't find KDiff.
I expected DiffEngine to look under the mentioned path too. Note that KDiff3 v0.9.98 64b (i.e. an older version) is actually installed under the path DiffEngine searches under.
One workaround is to add a symlink under %ProgramFiles%\KDiff3
.
I'm using DiffEngine via Shouldly.
var result = await DiffRunner.LaunchAsync(DiffTool.KDiff3, "a.txt", "b.txt");
The scan paths are also mentioned in the docs.
I can't build the solution since I can't install the .NET 6 SDK yet (and retargeting it doesn't seem to suffice for some reason) but I think this should be sufficient (I don't really know what could be tested on this, also given that the current KDiff3 definition is not tested): #266
I'd also suggest adding alternates that only differ in casing just to be sure.
Hi
When I install WinMerge
using winget
(winget install WinMerge.WinMerge
) then the installation path is "C:\Users\%username%\AppData\Local\Programs\WinMerge\WinMergeU.exe"
which is different than the hardcoded one. Is it possible to handle that use case?
When running tests using verify from JetBrains Rider on Linux, a diff tool is selected with lower priority than Rider. I noticed the paths were changed in PR #377 because of the JetBrains Toolbox v2 update, however it looks like the path for Linux wasn't updated.
The rider.sh file is located for me in ~/.local/share/JetBrains/Toolbox/apps/rider/bin/rider.sh
, but it seems to be looking at ~/.local/share/JetBrains/Toolbox/apps/Rider/*/*/bin/rider.sh
, which is presumably the previous location including the version number (also note the difference in casing "rider" vs "Rider", as Linux file systems are case-sensitive).
On any Linux distro, install JetBrains Rider from the JetBrains Toolbox. Open a project in rider and run tests using Verify from it, it will not open the diff view of Rider but of a tool with lower priority. (I'm on Arch Linux, but assume it's the same for any other distro, and using the latest version of Rider 2023.2.2)
Yes - As part of RazorLight, I want to figure out the best way to compare a snapshot of a Razor compiler output to the latest output. Rob D. Moore of MRCollective suggested this is called "approval testing", and that Shoudly and ApprovalTests.Net both support launching a file diff tool. DiffEngine seems like it could be useful here.
Let's discuss what you're building this project for and whether it makes sense to adopt an ecosystem around DiffEngine.
Use ApprovalTests.Net or Shoudly.
Would it be possible to configure the default click action for items in the diff engine tray? Currently it requires a lot of clicking and fine mouse work:
Using DiffEngine 8.5.1 (which, by the way, doesn't have a tag on this repository) through Verify.Xunit 14.9.1 I sometimes get this exception when running tests on macOS (in Rider, but that's not relevant).
System.TypeInitializationException
The type initializer for 'DiffEngine.ProcessCleanup' threw an exception.
at DiffEngine.ProcessCleanup.Kill(String command)
at DiffEngine.DiffRunner.Kill(String tempFile, String targetFile) in C:\projects\diffengine\src\DiffEngine\DiffRunner_Kill.cs:line 32
at VerifyEngine.ProcessEquals() in /_/src/Verify/Verifier/VerifyEngine.cs:line 218
at VerifyEngine.ThrowIfRequired(String message) in /_/src/Verify/Verifier/VerifyEngine.cs:line 117
at InnerVerifier.VerifyInner(Object target, Func`1 cleanup, IEnumerable`1 targets) in /_/src/Verify/Verifier/InnerVerifier_Inner.cs:line 30
at InnerVerifier.Verify[T](T target) in /_/src/Verify/Verifier/InnerVerifier_Json.cs:line 65
at VerifyXunit.Verifier.<>c__DisplayClass1_0.<<Verify>b__0>d.MoveNext() in /_/src/Verify.Xunit/Verifier.cs:line 32
--- End of stack trace from previous location ---
at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\Runners\TestInvoker.cs:line 264
--- End of stack trace from previous location ---
at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\ExecutionTimer.cs:line 48
at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in C:\Dev\xunit\xunit\src\xunit.core\Sdk\ExceptionAggregator.cs:line 90
The underlying exception is either one of those exception:
System.ArgumentOutOfRangeException
Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'chunkLength')
at System.Text.StringBuilder.ToString()
at System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted[T](T value)
at LinuxOsxProcess.RunPs() in C:\projects\diffengine\src\DiffEngine\Process\LinuxOsxProcess.cs:line 108
at LinuxOsxProcess.FindAll()+MoveNext() in C:\projects\diffengine\src\DiffEngine\Process\LinuxOsxProcess.cs:line 31
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at DiffEngine.ProcessCleanup.Refresh() in C:\projects\diffengine\src\DiffEngine\Process\ProcessCleanup.cs:line 37
at DiffEngine.ProcessCleanup..cctor() in C:\projects\diffengine\src\DiffEngine\Process\ProcessCleanup.cs:line 30
or
System.Exception
Process timed out. Command line: ps -o pid,command -x.
Output: PID COMMAND
455 /System/Library/Frameworks/LocalAuthentication.framework/Support/coreauthd
456 /usr/sbin/cfprefsd agent
460 /usr/libexec/UserEventAgent (Aqua)
462 /usr/sbin/distnoted agent
465 /System/Library/PrivateFrameworks/CloudServices.framework/Helpers/com.apple.sbd
466 /usr/libexec/knowledge-agent
467 /usr/libexec/trustd --agent
468 /usr/libexec/lsd
469 /usr/libexec/secd
470 /System/Library/PrivateFrameworks/CloudKitDaemon.framework/Support/cloudd
[…]
The ArgumentOutOfRangeException
is baffling, is there a bug in the new String Interpolation in C# 10 and .NET 6? 🤯 Note that this execption occurs while creating the interpolated string serving as message of the System.Exception
. Eventually it fails inside StringBuilder.ToString()!
Anyway, when the ArgumentOutOfRangeException
does not occur, the System.Exception
occurs because of ps -o pid,command -x
timing out after 500 ms occurs.
500 ms is a really long time for the ps
command to timeout but it occurs, I've witnessed it several times but it's unfortunately impossible to reproduce reliably. I have run a quick experiment with hyperfine and I was only able to measure ps -o pid,command -x
to last 388.2 ms:
hyperfine -m 1000 'ps -o pid,command -x'
Benchmark 1: ps -o pid,command -x
Time (mean ± σ): 89.4 ms ± 23.1 ms [User: 21.1 ms, System: 64.9 ms]
Range (min … max): 64.8 ms … 388.2 ms 1000 runs
Maybe the best solution is simply to increase the timeout? But what would be a reasonable value? 1 second, more?
It's too bad the System.Diagnostics.Process
did not get much love in .NET Core and that iterating over Process.GetProcesses()
and accessing its StartInfo
property throws System.InvalidOperationException: Process was not started by this object, so requested information cannot be determined.
. Using System.Diagnostics.Process
would have been a cleaner solution than having to rely on the ps
command!
First of all, I'm not sure whether this is a bug or behavior as expected but I think it's a bug.
I'm working on a repository containing the following initialization of VerifyTest:
[ModuleInitializer]
public static void Initialize()
{
// more code here
DiffRunner.MaxInstancesToLaunch(int.MaxValue);
// more code here
}
and I have created an environment variable DiffEngine_MaxInstances
with the value 2
.
I expect at most two instances of my compare tool (in this case Beyond Compare) to open but it seems that the MaxInstancesToLaunch
method precedes the environment variable value.
Possible solutions:
Math.Min(env variable DiffEngine_MaxInstances, DiffRunner.MaxInstancesToLaunch value)
DiffRunner.MaxInstancesToLaunch
.DiffRunner.MaxInstanceToLaunch
(ie, environment variable DiffEngine_ForcedMaxInstances
).System.InvalidOperationException: No process is associated with this object.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.get_Id()
at Tracker.KillProcess(TrackedMove move, Process process) in C:\projects\diffengine\src\DiffEngineTray\Tracker.cs:line 239
at Tracker.<HandleScanMove>g__RemoveAndKill|8_0(KeyValuePair`2 keyValuePair) in C:\projects\diffengine\src\DiffEngineTray\Tracker.cs:line 60
at Tracker.HandleScanMove(KeyValuePair`2 pair) in C:\projects\diffengine\src\DiffEngineTray\Tracker.cs:line 79
at AsyncTimer.RunLoop(CancellationToken cancellation) in C:\projects\diffengine\src\DiffEngineTray\AsyncTimer.cs:line 38
I have a .NET 6 Xunit test project that uses the package Verify.Xunit
(version 19.10.0).
Other relevant versions:
Microsoft Visual Studio Enterprise 2022 (ARM 64-bit)
17.4.4xunit
2.4.2xunit.runner.visualstudio
2.4.5I'm running on Windows ARM64 (under Parallels, M1 MacBook Pro).
I'm using a basic test:
[UsesVerify]
public class VerifyTests
{
[Fact]
public async Task TestVerify()
{
var result = true;
await Verifier.Verify(result);
}
}
It fails with the following exception:
Message:
System.TypeInitializationException : The type initializer for 'DiffEngine.ProcessCleanup' threw an exception.
---- System.TypeInitializationException : The type initializer for 'System.Management.ManagementPath' threw an exception.
-------- System.TypeInitializationException : The type initializer for 'System.Management.WmiNetUtilsHelper' threw an exception.
------------ System.ComponentModel.Win32Exception : Failed to load required native library 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\wminet_utils.dll'.
I cannot find information regarding the compatibility with the ARM64 architecture
Using version 9.0.5 of DiffEngineTray, installed via dotnet tool install -g DiffEngineTray
Problem also exists in Rider's Verify Support
plugin, version 2021.3.1.
Rider version 2021.2.1
When comparing received/verified (opening the diff tool), visual studio is used as the diff tool. According to tool order documentation, I expected Rider to be used, or at least VS code.
Rider is located:
C:\Program Files\JetBrains\JetBrains Rider 2021.2.1\bin\rider64.exe
VS Code is located:
C:\Users\user_name\AppData\Local\Programs\Microsoft VS Code\code.exe
@"%ProgramFiles%\JetBrains\JetBrains Rider *\bin\rider64.exe"
found in Rider.cs should have matched (assuming * is used as a wildcard
@"%LocalAppData%\Programs\Microsoft VS Code\code.exe""
found in VsCode.cs should have matched vs code.
I attempted to debug, but I never cause breakpoints in those 2 files to get hit.
After running the tests from Rider, a breakpoint in PipeServer.Handle is hit with a payload like:
{
"Type":"Move",
"Temp":"C:\\Users\\user_name\\source\\path\\to\\tests\\testclass.execute.received.txt",
"Target":"C:\\Users\\user_name\\source\\path\\to\\tests\\testclass.execute.verified.txt",
"CanKill":false,
"Exe":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\Common7\\IDE\\devenv.exe",
"Arguments":"/diff \"C:\\Users\\user_name\\source\\path\\to\\tests\\testclass.execute.received.txt\" \"C:\\Users\\user_name\\source\\path\\to\\tests\\testclass.execute.verified.txt\" \"testclass.execute.received.txt\" \"testclass.execute.verified.txt\"",
"ProcessId":60484
}
Hi @SimonCropp ,
Feel free to close this if you don't have interest. I found https://github.com/WalkingCat/ today via Twitter, and he has a ton of good diff tools:
More features 🗡️ ❤️
I am not familiar with how to implement a new DiffEngine provider.
Doing nothing.
Alternatively, for some of these, there may be Roslyn APIs and it may be better to write Verify snapshots for Roslyn API dumps instead.
This issue is related to the environment variable path for diff tools.
DiffEngine stopped working for me after the recent update.
I think that the issue is related to this line:
$
. Why is this the behavior?System.UnauthorizedAccessException: Access to the path is denied.
at System.IO.FileSystem.MoveFile(String sourceFullPath, String destFullPath, Boolean overwrite)
at FileEx.SafeMove(String temp, String target) in C:\projects\diffengine\src\DiffEngineTray\FileEx.cs:line 82
Updating ApiApprover, the BeyondCompareReporter is no longer displaying beyond compare.
Discussed some on Twitter.
I am trying to repro and submit a PR.
I installed DiffEngineTry 9.1.0 with dotnet tool install -g DiffEngineTray
. I try to run the tool from command line, but it does not appear. However, no error message is displayed. I found a logs folder at '.dotnet\tools.store\diffenginetray\9.1.0\diffenginetray\9.1.0\tools\net6.0\any\logs\log.txt'. In that I can see logs like:
2022-06-22 18:31:28.944 +01:00 [FTL] Failed at startup
System.IO.FileLoadException: Could not load file or assembly 'System.Windows.Forms, Version=6.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'System.Windows.Forms, Version=6.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
at Program.Inner()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Program.Inner()
at Program.Main() in C:\projects\diffengine\src\DiffEngineTray\Program.cs:line 11
I'm using Windows 10 Pro (Version 10.0.19043 Build 19043).
Periods will be supported for backwards compat until the next major release.
When an env variables with a period is detected a log entry will be written to Trace.WriteLine
>= net5/netstandard2.1
.NET SDK or .NET Core SDKIt would possibly make sense to verify whether or not the dependecy on Microsoft.Windows.Compatibility must be applied to all crosscompile versions. This is not necessairily a bug, but a potentially unnecessary dependency tree for some versions.
PR will be worked on shortly - One question though: Is it ok to base it off the code for 6.4.9 so shouldly can pull the change with little worries?
Windows 11 Pro
Visual Studio Enterprise 2022 (17.6.5)
DiffEngineTray 12.0.0
I ran my test (MSTest) and when I accept the change manually line endings stay constant but if I click the accept all button in DiffEnfineTray it changes all the line endings of the doc.verified.txt from CRLF to LF.
I'd prefer it just detects line endings for me or jsut uses CRLF automatically because it should know I'm on a Windows OS but another option would be to add a line ending option to the DiffEnfineTray settings.
In the past this never mattered to me because I always ignored whitespace when comparing files but recently I submitted a PR to a to someone else's repo and they rejected it due to me changing spaces to tabs inadvertently so now I've been leaving it on. That's how I just noticed this now.
The DiffEngine tool in NuGet is not listed as a dotnet tool in NuGet.
This means that it does not display the proper install commands, which I often use to copy/paste when installing or updating to the latest version. (Currently the .NET CLI tab shows dotnet add package DiffEngine --version 8.2.0
.)
It should show a .NET CLI Global and Local tabs like this.
I believe that this can be remedied by adding the following to the .csproj file:
<PackAsTool>true</PackAsTool>
The DiffTools.TryFind
is a bit confusing.
Spot the issue:
// Add if not already there
if (!DiffTools.TryFind(name, out _))
{
DiffTools.AddTool(name, ... );
}
The issue is here that:
public static bool TryFind(DiffTool tool, out ResolvedTool? resolvedTool)
, while the other (with string parameter), searches by extension: public static bool TryFind(string extension, out ResolvedTool? tool)
There are multiple solutions, those could be technical or semantic breaking. See the "or"s below ;)
TryFindByExtension(string extension, ...
)TryFind(DiffTool tool, ...)
to TryFindByName(DiffTool tool, ...)
TryFindByName(string name, ...)
TryFind(string extension, ...)
obsolete (breaking change!)TryFind(DiffTool tool, ...)
obsolete (breaking change!)TryFind
rename to TryFindTool
etc for consistency with AddTool
Current work around (ugly, need Equals? Needs dictionary lookup?):
// Add if not already there
if (!DiffTools.Resolved.Any(c => c.Name == name))
{
DiffTools.AddTool(name, ... );
}
I have a custom installation folder for both VS Code and Visual studio. The search paths for these diff tools don't match with the ones hard-coded inside DiffEngine.
One should be able to set a custom path for diff tools, for example with the help of environment variables.
For example: DiffEngine_<DiffToolName>_Path
= D:\My\Folder\
As alternative, consider reading a configuration file in the home directory of the user or in the project folder.
If necessary ask me.
When running a verification using
await Verifier.Verify(result).UseExtension("png");
With P4Merge installed, the following error is displayed:
Image files cannot be merged
The P4Merge Implementation takes four command line arguments which works correctly for text based merge operations but for binaries/images only two file paths can be passed in it seems. Additionally there doesn't currently seem to be a way to actually merge the received into the verified...
Wondering if the binary image extensions should be disabled in P4merge?
P4merge Version: r21.3
The command for Beyond Compare on Linux is bcompare
not bcomp
as currently defined:
This can be verified via the following documentation which shows bcompare
as being available on Linux and Mac but bcomp
only on Mac: https://www.scootersoftware.com/v4help/command_line_reference.html
Simple validation on Debian with a fresh install of BeyondCompare from https://www.scootersoftware.com/files/bcompare-4.4.7.28397_amd64.deb
$ which bcomp
bcomp not found
1
$ which bcompare
/usr/bin/bcompare
internal sealed class DiffToolsTests
{
[TestCase(DiffTool.BeyondCompare)]
[Explicit("Requires tools to be installed")]
public void DiffTools_Resolved(DiffTool tool)
{
// Arrange
// Act
ResolvedTool[] tools = DiffTools.Resolved.ToArray();
// Assert
Assert.That(tools, Is.Not.Empty);
}
}
[Test]
[Explicit("Requires tools to be installed")]
public void DiffTools_AddTool_BeyondCompare()
{
// Arrange
LaunchArguments launchArguments = new(
Left: (temp, target) => $"--diff \"{target}\" \"{temp}\"",
Right: (temp, target) => $"--diff \"{temp}\" \"{target}\"");
OsSupport osSupport = new(
Windows: null,
Linux: new OsSettings(
"bcompare",
launchArguments
),
Osx: null);
DiffTools.AddTool(
name: "BeyondCompareLinux",
autoRefresh: true,
isMdi: true,
supportsText: true,
requiresTarget: true,
osSupport: osSupport,
binaryExtensions: Array.Empty<string>());
// Act
ResolvedTool[] tools = DiffTools.Resolved.ToArray();
string[] toolNames = tools.Select(x => x.Name).ToArray();
// Assert
Assert.That(toolNames, Does.Contain("BeyondCompareLinux"));
}
Submit a Pull Request (PR) that fixes the bug. Include in this PR a test that verifies the fix. If you were not able to fix the bug, a PR that illustrates your partial progress will suffice.
System.InvalidOperationException: No process is associated with this object.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
at System.Diagnostics.Process.Kill()
at Tracker.KillProcess(TrackedMove move, Process process) in C:\projects\diffengine\src\DiffEngineTray\Tracker.cs:line 229
No problem prior to latest Windows update.
Using Visual Studio 2022
Approvaltests 5.7.3
Windows version now running:
Versjon Windows 10 Pro
Versjon 21H2
Installert den 12.03.2021
Operativsystembygg 19044.2130
Opplevelse Windows Feature Experience Pack 120.2212.4180.0
Error log from test:
Message:
System.TypeInitializationException : Typeinitialiseringen for DiffEngine.ProcessCleanup forårsaket et unntak.
----> System.Management.ManagementException : Invalid class
Stack Trace:
ProcessCleanup.TryGetProcessInfo(String command, ProcessCommand& process)
DiffRunner.InnerLaunch(TryResolveTool tryResolveTool, String tempFile, String targetFile) line 108
DiffRunner.Launch(String tempFile, String targetFile) line 43
DiffReporter.Report(String approved, String received) line 14
FileApprover.ReportFailure(IApprovalFailureReporter reporter) line 65
Approver.Verify(IApprovalApprover approver, IApprovalFailureReporter reporter) line 13
Approvals.Verify(IApprovalApprover approver, IApprovalFailureReporter reporter) line 71
Approvals.Verify(IApprovalWriter writer, IApprovalNamer namer, IApprovalFailureReporter reporter) line 52
Approvals.Verify(IApprovalWriter writer) line 124
Approvals.VerifyWithExtension(String text, String fileExtensionWithDot, Func2 scrubber) line 189 Approvals.Verify(String text, Func2 scrubber) line 176
ApprovalTests1.CreatedIntrumAssignmentsIsCorrect() line 85
--ManagementException
ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
ManagementObjectEnumerator.MoveNext()
d__3.MoveNext() line 38
List1.ctor(IEnumerable1 collection)
Enumerable.ToList[TSource](IEnumerable`1 source)
ProcessCleanup.Refresh() line 36
ProcessCleanup.cctor() line 30
System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
at System.IO.StreamReader.ReadBufferAsync(CancellationToken cancellationToken)
at System.IO.StreamReader.ReadToEndAsyncInternal(CancellationToken cancellationToken)
at PiperServer.Handle(TcpListener listener, Action`1 move, Action`1 delete, CancellationToken cancellation) in C:\projects\diffengine\src\DiffEngineTray\PiperServer.cs:line 61
at PiperServer.Handle(TcpListener listener, Action`1 move, Action`1 delete, CancellationToken cancellation) in C:\projects\diffengine\src\DiffEngineTray\PiperServer.cs:line 85
at PiperServer.Start(Action`1 move, Action`1 delete, CancellationToken cancellation) in C:\projects\diffengine\src\DiffEngineTray\PiperServer.cs:line 27
System.InvalidOperationException: No process is associated with this object.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
at System.Diagnostics.Process.Kill()
at Tracker.KillProcess(TrackedMove move, Process process) in C:\projects\diffengine\src\DiffEngineTray\Tracker.cs:line 229
so the menus show in consistent location
Yes, many of my diff tools are installed in their non-standard location and cannot be located
In the list of paths to check for each diff tool, include one that is parsed from an environment variable
e.g. vscode's last search path could be something like System.Environment.GetEnvironmentVariable("VERIFY_DIFFENGINE_VSCODE_PATH") ?? string.Empty
I could add a new diff tool based on an existing, however I want this to be generic enough that anyone running the Verify test suite can.
If you think this is a viable option I would be happen to submit a PR for it.
DiffEngineTray Version: 6.5.7+28a5e68674f0a855bad0beb587c61058a62f978f
OS: Microsoft Windows NT 10.0.14393.0
Exception:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.IOException: The process cannot access the file because it is being used by another process.
at System.IO.FileSystem.MoveFile(String sourceFullPath, String destFullPath, Boolean overwrite)
at Tracker.InnerMove(TrackedMove move) in C:\projects\diffengine\src\DiffEngineTray\Tracker.cs:line 205
at Tracker.AcceptAllMoves() in C:\projects\diffengine\src\DiffEngineTray\Tracker.cs:line 295
at Tracker.AcceptAll() in C:\projects\diffengine\src\DiffEngineTray\Tracker.cs:line 278
at MenuButton.<>c__DisplayClass0_0.<.ctor>b__0(Object <p0>, EventArgs <p1>) in C:\projects\diffengine\src\DiffEngineTray\Controls\MenuButton.cs:line 13
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
System.Private.CoreLib
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Private.CoreLib.dll
----------------------------------------
DiffEngineTray
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0
CodeBase: file:///C:/Users/ascropp/.dotnet/tools/.store/diffenginetray/6.5.7/diffenginetray/6.5.7/tools/net5.0/any/DiffEngineTray.dll
----------------------------------------
System.Runtime
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Runtime.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 5.0.3.0
Win32 Version: 5.0.321.7302
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.3/System.Windows.Forms.dll
----------------------------------------
System.Threading
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Threading.dll
----------------------------------------
System.Windows.Forms.Primitives
Assembly Version: 5.0.3.0
Win32 Version: 5.0.321.7302
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.3/System.Windows.Forms.Primitives.dll
----------------------------------------
System.ComponentModel.Primitives
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.ComponentModel.Primitives.dll
----------------------------------------
System.Runtime.InteropServices
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Runtime.InteropServices.dll
----------------------------------------
System.Drawing.Primitives
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Drawing.Primitives.dll
----------------------------------------
System.Collections.Specialized
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Collections.Specialized.dll
----------------------------------------
System.Drawing.Common
Assembly Version: 5.0.0.1
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.3/System.Drawing.Common.dll
----------------------------------------
Serilog
Assembly Version: 2.0.0.0
Win32 Version: 2.10.0.0
CodeBase: file:///C:/Users/ascropp/.dotnet/tools/.store/diffenginetray/6.5.7/diffenginetray/6.5.7/tools/net5.0/any/Serilog.dll
----------------------------------------
netstandard
Assembly Version: 2.1.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/netstandard.dll
----------------------------------------
System.IO.FileSystem
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.IO.FileSystem.dll
----------------------------------------
Serilog.Sinks.File
Assembly Version: 2.0.0.0
Win32 Version: 4.1.0.0
CodeBase: file:///C:/Users/ascropp/.dotnet/tools/.store/diffenginetray/6.5.7/diffenginetray/6.5.7/tools/net5.0/any/Serilog.Sinks.File.dll
----------------------------------------
System.Text.Encoding
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Text.Encoding.dll
----------------------------------------
System.Collections
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Collections.dll
----------------------------------------
System.Memory
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Memory.dll
----------------------------------------
System.Linq
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Linq.dll
----------------------------------------
System.Runtime.Extensions
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Runtime.Extensions.dll
----------------------------------------
System.Text.RegularExpressions
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Text.RegularExpressions.dll
----------------------------------------
System.Reflection.Emit.ILGeneration
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Reflection.Emit.ILGeneration.dll
----------------------------------------
System.Reflection.Emit.Lightweight
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Reflection.Emit.Lightweight.dll
----------------------------------------
System.Reflection.Primitives
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Reflection.Primitives.dll
----------------------------------------
System.Private.Uri
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Private.Uri.dll
----------------------------------------
System.Text.Json
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Text.Json.dll
----------------------------------------
System.Collections.Concurrent
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Collections.Concurrent.dll
----------------------------------------
System.Text.Encodings.Web
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Text.Encodings.Web.dll
----------------------------------------
System.Runtime.Intrinsics
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Runtime.Intrinsics.dll
----------------------------------------
System.Numerics.Vectors
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Numerics.Vectors.dll
----------------------------------------
System.Runtime.CompilerServices.Unsafe
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Runtime.CompilerServices.Unsafe.dll
----------------------------------------
System.Text.Encoding.Extensions
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Text.Encoding.Extensions.dll
----------------------------------------
System.Diagnostics.TraceSource
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Diagnostics.TraceSource.dll
----------------------------------------
Microsoft.Win32.Primitives
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/Microsoft.Win32.Primitives.dll
----------------------------------------
System.Buffers
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Buffers.dll
----------------------------------------
System.Net.Sockets
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Net.Sockets.dll
----------------------------------------
System.Net.Primitives
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Net.Primitives.dll
----------------------------------------
System.Diagnostics.Tracing
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Diagnostics.Tracing.dll
----------------------------------------
System.Net.NameResolution
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Net.NameResolution.dll
----------------------------------------
System.Threading.Overlapped
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Threading.Overlapped.dll
----------------------------------------
System.ComponentModel.TypeConverter
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.ComponentModel.TypeConverter.dll
----------------------------------------
Microsoft.Win32.SystemEvents
Assembly Version: 5.0.0.0
Win32 Version: 5.0.20.51904
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.3/Microsoft.Win32.SystemEvents.dll
----------------------------------------
System.Threading.Thread
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Threading.Thread.dll
----------------------------------------
System.ComponentModel.EventBasedAsync
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.ComponentModel.EventBasedAsync.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 5.0.321.7302
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/5.0.3/Accessibility.dll
----------------------------------------
System.ComponentModel
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.ComponentModel.dll
----------------------------------------
System.Threading.ThreadPool
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Threading.ThreadPool.dll
----------------------------------------
System.Diagnostics.Process
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Diagnostics.Process.dll
----------------------------------------
System.Globalization
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Globalization.dll
----------------------------------------
System.IO
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.IO.dll
----------------------------------------
System.IO.FileSystem.Primitives
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.IO.FileSystem.Primitives.dll
----------------------------------------
System.Diagnostics.StackTrace
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Diagnostics.StackTrace.dll
----------------------------------------
System.Reflection.Metadata
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Reflection.Metadata.dll
----------------------------------------
System.Collections.Immutable
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.Collections.Immutable.dll
----------------------------------------
System.IO.MemoryMappedFiles
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.IO.MemoryMappedFiles.dll
----------------------------------------
System.IO.Compression
Assembly Version: 5.0.0.0
Win32 Version: 5.0.321.7212
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/5.0.3/System.IO.Compression.dll
----------------------------------------
************** JIT Debugging **************
When running unit tests that utilise Verify under an EAP Rider version on macOS, when there is another version available results in inconsistent version selection. My hope is that when I run the tests, the current instance of Rider will be used to shell out the diff to (this is an unreasonable request), however it seems that the Rider selection is sorted by last write timestamp, which on my machine is constant flipping between the EAP and non-EAP instances. I can run two test runs, and have it pick a different version both times, seconds after the previous.
I suspect I can customize the tool selection somehow, but I would expect Verify to first resolve rider
from my PATH and use that first, as that is what I personally use to indicate my main instance that I'm using day-to-day.
Install an EAP & non-EAP version of Rider, and run a test suite with differing contents. For me it happens quite inconstantly, I haven't figured out exactly when the timestamps are getting updated.
If I have multiple instances of Visual Studio open and my Verify test fails, the diff seems to always open in the first instance of Visual Studio.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.