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

Potential collaboration using checksumdir and diff-rs crates in Torchbear environment #21

Open
naturallymitchell opened this issue Mar 6, 2019 · 5 comments

Comments

@naturallymitchell
Copy link

Hi!

This crate looks very similar to what we did in checksumdir, which is a straight port of python's checksumdir, and diff-rs in order to make those functions available to Torchbear's scripting environment - just announced in r/rust.

Perhaps someone here would like to try out this new Rust project that makes it possible to produce useful apps from powerful libraries in simple scripts.

@naturallymitchell naturallymitchell changed the title Potential collaboration using checksumdir and diff crates in Torchbear environment Potential collaboration using checksumdir and diff-rs crates in Torchbear environment Mar 6, 2019
@epage
Copy link
Collaborator

epage commented Mar 6, 2019

#11 is the type of direction I'd like to take this project.

One use case is to make testing as dead simple as possible while giving the user as much information as they need. I'd like get dir-diff to report what is different, integrate it into predicates, and then it'd have integration in assert_fs. I'm wanting both subset assertion (everything in my "expected" folder is in my "actual" folder) and exact assertion ("expected" and "actual" folders completely match).

You can find a hand-rolled version of this in cobalt's tests. The fun part is coming up with an API that is general enough but not so general it can't ever be implemented or used :)

Looking at checksumdir, it looks like it takes a checksum of a directory which would make quick checks over time, etc. Is this correct?

From these comparisons, any potential you see in collaboration?

@naturallymitchell
Copy link
Author

hmm.. well what's your main goal? what are you ultimately building?

@epage
Copy link
Collaborator

epage commented Mar 7, 2019

I felt like I had said that but I guess I wasn't clear. Let me try another way.

I've been working on a crate, assert_fs, that tries to make it more trivial to write tests that deal with filesystems. With minimal boilerplate, you can write a test and on failure, it reports a lot of helpful information to make the debug process easier. A big use case not covered is making sure an output directory matches a "golden" or "snapshot" directory. cobalt-bins tests are one example of this need.

To help accomplish this, I need a directory diffing API that doesn't just return a pass / fail but will tell you why it failed, e.g. what file was missing or which file had unexpected content and what the content was. That is what #11 is about. #6 complicates it a little bit.

@naturallymitchell
Copy link
Author

for Cobalt?

@epage
Copy link
Collaborator

epage commented Mar 7, 2019

Cobalt is one example of the need. I want to generalize what cobalt has so anyone can take advantage of it.

epage added a commit to epage/dir-diff that referenced this issue Jul 26, 2024
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

No branches or pull requests

2 participants