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

Add some useful commands to test output when folders differ #349

Open
crankydillo opened this issue Mar 24, 2020 · 3 comments
Open

Add some useful commands to test output when folders differ #349

crankydillo opened this issue Mar 24, 2020 · 3 comments
Assignees

Comments

@crankydillo
Copy link

Related issue: #296

When a folder comparison assertion fails in butterfly-test, I was taking the output and constructing this command:

diff super-long-base-path/relative-concatenated-path  super-long-base-path2/relative-concatenated-path

I got tired constructing this command and made a local hack that adds the above to the output and would like to contribute. I know not every OS will have diff, but many will and hopefully the rest have some equivalent. Anyhow, this was a huge time saver for me.

May want to look at what diff options we have that work against folders.

I really use the awesome vimdiff, but I realize most won't want that:)

@fabiocarvalho777
Copy link
Member

Awesome Sam, thank you very much!! I know exactly where you are coming from, this is something I have thought about too. It would be nice to make it configurable though, so it is not ON for people using OSs that don't support it. Looking forward for your PR!

@crankydillo
Copy link
Author

Fabio, do you have any current strategy for doing this? I can think of several ways, the most obvious being using CLI argument. That doesn't feel right though. I really think that this type of thing goes into a config file. Something like:

test.diff.output=diff {} {}

I don't want to reinvent the wheel if you already have a strategy/plan for such configuration.

@fabiocarvalho777
Copy link
Member

Please take at look at issue #41. If that was implemented already, it could help now.

However, when I first thought about an automatic diff tool being triggered after a test, I thought about having it configured from the IDE. I don't see this diff tool being applicable to a regular Butterfly execution from the CLI.

Maybe that is because I am used to always run Butterfly from the IDE when developing an extension (which is when a diff would be helpful after a test execution).

Do you run it from the CLI when developing an extension?

So, considering this issue here would be implemented without the help of #41 being done first, here are some options:

  1. Turn the diff output ON programmatically (by adding a new boolean parameter to the test method)
  2. Turn the diff output ON by setting a System.property (also helpful when running from the IDE)

I think number 2 is more appropriate, so user can control that without changing source code (when running it from different OSes, in case diff tool is OS specific)

One more important thing to consider. IntelliJ lets you configure an external diff tool, and lets you pass the path to the diff tool binary, and is able to direct to it its inputs (original, modified, and merge).

Instead of hardcoding a diff tool integration into Butterfly, maybe we could make it configurable, so it can detach to the user favorite diff tool, like IntellJ does. What do you think about this?

@fabiocarvalho777 fabiocarvalho777 removed this from the 3.1.0 milestone Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants