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

[meta] better sharness coverage #4841

Open
Stebalien opened this issue Mar 20, 2018 · 10 comments
Open

[meta] better sharness coverage #4841

Stebalien opened this issue Mar 20, 2018 · 10 comments
Labels
kind/test Testing work topic/meta Topic meta

Comments

@Stebalien
Copy link
Member

This list is a work in progress. Suggestions appreciated.

General

For all commands, we should:

  • Check that --help works.
  • Check that bad flags are correctly detected.

CID formatting

For all commands that have CID formatting options (add, block put, dag put, etc.), we check that:

  • --mhtype=notSha256 --cid-version=0 fails (--cid-version=0 is sometimes written as --format=v0).
  • --mhtype=notSha256 defaults to CIDv1.
  • --mhtype=sha256 --cid-version=0 works.
  • --mhtype=anyHash --cid-version=1 works.

Get directory

Check the directories:

  • ipfs get /ipfs/QmDir/
  • ipfs get /ipfs/QmDir
  • ipfs get /ipfs/QmDir/otherDir/
  • ipfs get /ipfs/QmDir/otherDir
  • ipfs get /ipfs/QmDir/otherDir/secondDir
  • ipfs get /ipfs/QmDir/otherDir/secondDir/

Containing:

  • Nothing
  • A single file
  • A hidden file.
  • A directory.
  • A hidden directory.
  • Some tree of files.

(and ensure that we actually get the right output).

Get file

Check that the following fail:

  • ipfs get /ipfs/QmFile/
  • ipfs get /ipfs/QmDir/QmFile/
@Stebalien Stebalien added kind/test Testing work topic/meta Topic meta labels Mar 20, 2018
@whyrusleeping
Copy link
Member

Hey @chriscool, wanna help us out a bit?

@chriscool
Copy link
Contributor

@whyrusleeping Yeah sure I will take a look at this later today.

@chriscool
Copy link
Contributor

@Stebalien about all commands accepting --help, there is such a test already:

https://github.com/ipfs/go-ipfs/blob/master/test/sharness/t0010-basic-commands.sh#L64-L75

@Stebalien
Copy link
Member Author

about all commands accepting --help, there is such a test already:

Ah, nice! However, we need to not pipe /dev/null to stdin. See #4837.

@chriscool
Copy link
Contributor

chriscool commented Mar 20, 2018

@Stebalien do you mean that there should be the same tests with echo stuff | $cmd --help >/dev/null or just $cmd --help >/dev/null?

@Stebalien
Copy link
Member Author

Both might actually be a good idea.

@kevina
Copy link
Contributor

kevina commented Mar 20, 2018

I would add:

  • --cid-version=1 enabled raw-leaves by default when applicable

@chriscool
Copy link
Contributor

@Stebalien please take a look at:

#4849
#4848

@chriscool
Copy link
Contributor

@whyrusleeping please take a look at merging the above 2 PRs!

@whyrusleeping
Copy link
Member

@chriscool merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/test Testing work topic/meta Topic meta
Projects
None yet
Development

No branches or pull requests

4 participants