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 or similar tool to compare snapshots #106

Merged
merged 10 commits into from
Sep 2, 2023
Merged

Conversation

lukfor
Copy link
Collaborator

@lukfor lukfor commented Aug 25, 2023

This PR improves comparing huge and complex snapshots. (closes #67)

nf-test checks if diff is installed on the system and use it to compare the snapshots side by side. The arguments can be changed with the environment variable NFT_DIFF_ARGS (default arguments: -y -W 200).

To change to a different tool, the env variable NFT_DIFF can be used.

Example to use icdiff (it supports colors etc..):

export NFT_DIFF="icdiff"
export NFT_DIFF_ARGS="-N --cols 200 -L expected -L observed -t"

Output of icdiff:

Screenshot 2023-08-25 at 12 45 18

Open tasks:

  • test on ubuntu
  • add to documentation

@lukfor lukfor merged commit fb9fb64 into main Sep 2, 2023
2 checks passed
@lukfor lukfor deleted the features/snapshot-diff branch September 2, 2023 16:01
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.

Diffing on snapshot failure
1 participant