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

Use diff engine #644

Merged
merged 9 commits into from Aug 4, 2020
Merged

Use diff engine #644

merged 9 commits into from Aug 4, 2020

Conversation

SimonCropp
Copy link
Contributor

@josephwoodward @jnm2 @slang25 thoughts on this one? i know it adds a dependency, but this is the purpose i build diffengine for. I have not added process cleanup yet. i figured i would check if the dependency was something that is acceptable first.

@@ -818,7 +818,6 @@ public static class ShouldlyConfiguration
public static double DefaultFloatingPointTolerance;
public static System.TimeSpan DefaultTaskTimeout;
public static System.Collections.Generic.List<string> CompareAsObjectTypes { get; }
public static Shouldly.Configuration.DiffToolConfiguration DiffTools { get; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

How will existing code using Shouldly v3 know what to do upon upgrading to v4?

Copy link
Collaborator

@jnm2 jnm2 Jul 11, 2020

Choose a reason for hiding this comment

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

Is it possible in principle to preserve Shouldly's existing API and delegate to DiffEngine for the implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How will existing code using Shouldly v3 know what to do upon upgrading to v4?

I added obsoletes

Is it possible in principle to preserve Shouldly's existing API and delegate to DiffEngine for the implementation

i would prefer not to. reasons:

  • many of the diff APIs should not have been made public. eg KnownDoNotLaunchStrategies, DoNotLaunchWhenPlatformIsNotWindows
  • there is a mismatch between the APIs. for example shouldly is hard coded to expect that a single tool has the same args for different OS. this is not correct eg https://github.com/VerifyTests/DiffEngine/blob/master/docs/diff-tool.md#windows-settings so that cant be properly represented in the existing shouldly api. The may be other examples i have not found, and future changes in DiffEngine could result in more of a mismatch
  • most of the shouldly Diff api should be very rarely used required by people. for example given the tools supported by DiffEngine people should rarely need to add a custom tool
  • shouldly lack opinion on if settings should be personal or shared
  • the shouldly API docs would need be continually maintained

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have toyed with the idea of avoiding a nuget ref. submodules or a source package. but ultimately the docs was too difficult to replicate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thoughts on the above? this PR changes enough that i am holding of on the next few things

Copy link
Collaborator

@jnm2 jnm2 Jul 14, 2020

Choose a reason for hiding this comment

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

That answers my question, thanks. I was thinking it could ease the transition, but if we want the obsoleted APIs to continue working in v4, we should just leave the v3 impl intact. If we don't, I think I'm good with that with the caveat that I haven't used diffing so I don't have a good sense of what people might expect.

@slang25
Copy link
Member

slang25 commented Jul 11, 2020

I like this in principle, the overhead of properly wrapping diff tools on different platforms is quite significant. I'm convinced the issues that have been raised over the last couple of years around this is only the tip of the iceberg.

If we are bumping the major version then changing the API seems to make sense, can we cover off the same sort of configuration points? For example, being able to influence what diff tools to search for. How is the DiffEngine config exposed?

@SimonCropp
Copy link
Contributor Author

@slang25

can we cover off the same sort of configuration points? For example, being able to influence what diff tools to search for. How is the DiffEngine config exposed?

I added obsoletes https://github.com/shouldly/shouldly/pull/644/files#diff-70e3573de61136ab637e3d710244ccdaR849

@SimonCropp
Copy link
Contributor Author

@josephwoodward any more thoughts on this one?

@josephwoodward
Copy link
Member

josephwoodward commented Jul 25, 2020

Are there any changes in behaviour users will/may see between v3 (the old way) and this? Initial ones that come to mind are:

  • Will the filenames remain the same (the whatever.approved.cs file)?
  • Changes in the contents of the approved file?

@SimonCropp
Copy link
Contributor Author

Will the filenames remain the same (the whatever.approved.cs file)?

yes

Changes in the contents of the approved file?

no

Are there any changes in behaviour users will/may see between v3 (the old way) and this? I

Not that i can see

Diff engine does not touch the files. just handles passing them to a diff tool

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.

None yet

4 participants