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 test to enforce helptext on commands #2648

Merged
merged 3 commits into from Mar 24, 2017
Merged

Conversation

whyrusleeping
Copy link
Member

This is WIP. Not to be merged for a while.

@RichardLitt here you go :)

License: MIT
Signed-off-by: Jeromy why@ipfs.io

@RichardLitt RichardLitt self-assigned this May 10, 2016
@RichardLitt RichardLitt added the topic/docs-ipfs Topic docs-ipfs label May 10, 2016
@RichardLitt
Copy link
Member

Thank you!

@hackergrrl
Copy link
Contributor

pretty excited about this

Kubuxu added a commit that referenced this pull request May 14, 2016
This is the best place for inserting it that I found.

Test in #2648 should be modified to run `Root.ProcessHelp()`.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Kubuxu added a commit that referenced this pull request May 14, 2016
This is the best place for inserting it that I found.

Test in #2648 should be modified to run `Root.ProcessHelp()`.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
@Kubuxu
Copy link
Member

Kubuxu commented May 15, 2016

I rebased and updated this PR with change required by #2694

@Kubuxu
Copy link
Member

Kubuxu commented May 19, 2016

Before this is merged these commits should be squashed as the latter will be fixing some tests.

@chriscool
Copy link
Contributor

There is a test here: https://github.com/ipfs/go-ipfs/blob/master/test/sharness/t0010-basic-commands.sh#L44
I wonder if it is relevant and if it could be improved.

@RichardLitt
Copy link
Member

@Kubuxu Might be cool if we could automatically generate the Synopsis.

@Kubuxu
Copy link
Member

Kubuxu commented Jun 1, 2016

If you point me to exact style we are aiming for with all possible options I will look into it but it might be a bit hard to do it as I am looking at examples inside current code.

@RichardLitt
Copy link
Member

@Kubuxu
Copy link
Member

Kubuxu commented Jun 1, 2016

Problem is that alg wouldn't know where to take peerId, protocol and timeInterval from. I could either use the name of the option (not so good) or for example give option of some mapping.

@RichardLitt
Copy link
Member

@Kubuxu If it is super hard, I can just do them all manually -- what do you think?

@Kubuxu
Copy link
Member

Kubuxu commented Jun 1, 2016

I could introduce something like: SynopsisMapings which would be map optionName->optionValueInSynopsis. How does it sound?

@RichardLitt
Copy link
Member

Can you show me a test? This should be automatic for all of them, or we'll constantly be scrambling around updating it.

@Kubuxu
Copy link
Member

Kubuxu commented Jun 1, 2016

Like in this case of ipfs stats bw:

SynopsisOptionsValues: map[string]string{
  "peer": "peerId",
  "proto": "protocol",
  "interval": "timeInterval",
}

And it would be per command basis.
This allows for something like: ipfs get [(--output | -o) <FILE>] to be generated automagically.

@RichardLitt
Copy link
Member

I love it. Would that be hard to implement?

@Kubuxu
Copy link
Member

Kubuxu commented Jun 1, 2016

I think not at all.

@Kubuxu
Copy link
Member

Kubuxu commented Jun 1, 2016

@RichardLitt see #2785

@RichardLitt
Copy link
Member

@Kubuxu Would it be possible to output a list of all commands that don't have synopses and general helptexts? Something like project-repos?

@Kubuxu
Copy link
Member

Kubuxu commented Sep 28, 2016

It is part of the output of the test.
You can see it here: http://ci.ipfs.team:8111/viewLog.html?buildId=6533&buildTypeId=GoIpfs_CiTests&tab=buildLog#_state=656&focus=932

@Kubuxu
Copy link
Member

Kubuxu commented Sep 28, 2016

Or run locally: go test ./core/commands -run TestHelptexts

@RichardLitt
Copy link
Member

@Kubuxu Any reason why I would only get a one line output from that command?

$ go test ./core/commands -run TestHelptexts
ok      github.com/ipfs/go-ipfs/core/commands   0.013s

@Kubuxu
Copy link
Member

Kubuxu commented Sep 28, 2016

Are you running in on this branch or the mater?

@RichardLitt
Copy link
Member

Sweet. Ok, here is the result. I think that all of these should be dealt with before this should be closed. Sound right to you, @Kubuxu?

  • ipfs has no long description!
  • ipfs has no short description!
  • ipfs block has no synopsis!
  • ipfs block put has no synopsis!
  • ipfs block rm has no synopsis!
  • ipfs block stat has no synopsis!
  • ipfs block get has no synopsis!
  • ipfs bootstrap has no synopsis!
  • ipfs bootstrap rm has no synopsis!
  • ipfs bootstrap rm all has no synopsis!
  • ipfs bootstrap list has no synopsis!
  • ipfs bootstrap add has no synopsis!
  • ipfs bootstrap add default has no synopsis!
  • ipfs get has no synopsis!
  • ipfs ls has no synopsis!
  • ipfs version has no synopsis!
  • ipfs resolve has no synopsis!
  • ipfs log has no synopsis!
  • ipfs log tail has no synopsis!
  • ipfs log level has no synopsis!
  • ipfs log ls has no synopsis!
  • ipfs pin has no long description!
  • ipfs pin has no short description!
  • ipfs pin has no synopsis!
  • ipfs pin add has no synopsis!
  • ipfs pin rm has no synopsis!
  • ipfs pin ls has no synopsis!
  • ipfs ping has no synopsis!
  • ipfs refs has no synopsis!
  • ipfs refs local has no synopsis!
  • ipfs config has no synopsis!
  • ipfs config show has no synopsis!
  • ipfs config edit has no synopsis!
  • ipfs config replace has no synopsis!
  • ipfs files has no synopsis!
  • ipfs files flush has no synopsis!
  • ipfs files read has no synopsis!
  • ipfs files mv has no synopsis!
  • ipfs files cp has no long description!
  • ipfs files cp has no short description!
  • ipfs files cp has no synopsis!
  • ipfs files mkdir has no synopsis!
  • ipfs files stat has no long description!
  • ipfs files stat has no short description!
  • ipfs files stat has no synopsis!
  • ipfs files write has no synopsis!
  • ipfs files ls has no synopsis!
  • ipfs files rm has no synopsis!
  • ipfs update has no tagline!
  • ipfs update has no long description!
  • ipfs update has no short description!
  • ipfs update has no synopsis!
  • ipfs diag has no long description!
  • ipfs diag has no short description!
  • ipfs diag has no synopsis!
  • ipfs diag net has no synopsis!
  • ipfs diag sys has no synopsis!
  • ipfs diag cmds has no synopsis!
  • ipfs diag cmds clear has no long description!
  • ipfs diag cmds clear has no short description!
  • ipfs diag cmds clear has no synopsis!
  • ipfs diag cmds set-time has no long description!
  • ipfs diag cmds set-time has no short description!
  • ipfs diag cmds set-time has no synopsis!
  • ipfs mount has no synopsis!
  • ipfs name has no synopsis!
  • ipfs name publish has no synopsis!
  • ipfs name resolve has no synopsis!
  • ipfs stats has no synopsis!
  • ipfs stats repo has no synopsis!
  • ipfs stats bitswap has no long description!
  • ipfs stats bitswap has no short description!
  • ipfs stats bitswap has no synopsis!
  • ipfs stats bw has no synopsis!
  • ipfs tar has no long description!
  • ipfs tar has no short description!
  • ipfs tar has no synopsis!
  • ipfs tar cat has no synopsis!
  • ipfs tar add has no synopsis!
  • ipfs tour has no synopsis!
  • ipfs tour list has no long description!
  • ipfs tour list has no short description!
  • ipfs tour list has no synopsis!
  • ipfs tour next has no long description!
  • ipfs tour next has no short description!
  • ipfs tour next has no synopsis!
  • ipfs tour restart has no long description!
  • ipfs tour restart has no short description!
  • ipfs tour restart has no synopsis!
  • ipfs dht has no long description!
  • ipfs dht has no short description!
  • ipfs dht has no synopsis!
  • ipfs dht query has no synopsis!
  • ipfs dht findprovs has no synopsis!
  • ipfs dht findpeer has no synopsis!
  • ipfs dht get has no synopsis!
  • ipfs dht put has no synopsis!
  • ipfs dht provide has no long description!
  • ipfs dht provide has no short description!
  • ipfs dht provide has no synopsis!
  • ipfs repo has no synopsis!
  • ipfs repo fsck has no synopsis!
  • ipfs repo version has no synopsis!
  • ipfs repo verify has no long description!
  • ipfs repo verify has no short description!
  • ipfs repo verify has no synopsis!
  • ipfs repo gc has no synopsis!
  • ipfs repo stat has no synopsis!
  • ipfs swarm has no synopsis!
  • ipfs swarm addrs has no synopsis!
  • ipfs swarm addrs local has no synopsis!
  • ipfs swarm connect has no synopsis!
  • ipfs swarm disconnect has no synopsis!
  • ipfs swarm filters has no synopsis!
  • ipfs swarm filters add has no synopsis!
  • ipfs swarm filters rm has no synopsis!
  • ipfs swarm peers has no synopsis!
  • ipfs cat has no synopsis!
  • ipfs id has no synopsis!
  • ipfs bitswap has no long description!
  • ipfs bitswap has no short description!
  • ipfs bitswap has no synopsis!
  • ipfs bitswap wantlist has no synopsis!
  • ipfs bitswap stat has no long description!
  • ipfs bitswap stat has no short description!
  • ipfs bitswap stat has no synopsis!
  • ipfs bitswap unwant has no long description!
  • ipfs bitswap unwant has no short description!
  • ipfs bitswap unwant has no synopsis!
  • ipfs bitswap ledger has no synopsis!
  • ipfs add has no synopsis!
  • ipfs commands has no synopsis!
  • ipfs dns has no synopsis!
  • ipfs object has no synopsis!
  • ipfs object stat has no synopsis!
  • ipfs object data has no synopsis!
  • ipfs object diff has no synopsis!
  • ipfs object get has no synopsis!
  • ipfs object links has no synopsis!
  • ipfs object new has no synopsis!
  • ipfs object patch has no synopsis!
  • ipfs object patch append-data has no synopsis!
  • ipfs object patch add-link has no synopsis!
  • ipfs object patch rm-link has no synopsis!
  • ipfs object patch set-data has no synopsis!
  • ipfs object put has no synopsis!
  • ipfs file has no synopsis!
  • ipfs file ls has no synopsis!

@Kubuxu
Copy link
Member

Kubuxu commented Sep 28, 2016

Yes it has to be dealt with before me merge this as tests have to pass.

@RichardLitt
Copy link
Member

Here I go, then. :)

@whyrusleeping
Copy link
Member Author

Although the synopsis part is a bit off, IMO. We autogenerate synopses when they arent set.

@whyrusleeping whyrusleeping added status/deferred Conscious decision to pause or backlog and removed status/in-progress In progress labels Nov 28, 2016
@whyrusleeping
Copy link
Member Author

@Kubuxu thoughts on rebasing this one, and then marking the test as 'skipped' ? That way we can run it manually as needed, and it doesnt linger in unmerged PR hell forever

whyrusleeping and others added 2 commits March 24, 2017 18:18
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
@Kubuxu
Copy link
Member

Kubuxu commented Mar 24, 2017

@whyrusleeping done

@whyrusleeping whyrusleeping merged commit 7b2d9ad into master Mar 24, 2017
@whyrusleeping whyrusleeping deleted the feat/helptext-test branch March 24, 2017 17:57
@whyrusleeping whyrusleeping removed the status/deferred Conscious decision to pause or backlog label Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/docs-ipfs Topic docs-ipfs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants