Commit graph

25 commits

Author SHA1 Message Date
Fletcher Haynes
5c39a49285 Sync from private repo to commit 12d608c80d 2022-12-12 09:01:20 -08:00
Lory Cloutier
b6ae088f24 FB-1766: cleaning up the CmdIO objects passing alternate stdin/
stdout/stderr around

A lot of functions in the cmd and ctl packages were passing these
around and barely using them. Replaced them with a logger for most
functions. Some functions get an io.Writer instead so that their
tests can find the output they're looking for.

More cleanup on fb-1766: reworked the tests that were using io.Pipe
or os.Pipe to check their results so they now use a bytes.Buffer.

Unexported some variables that didn't need to be exported.
Fixed NewConfigCommand to use the provided stderr, not os.Stderr.
Added tests for rbf_dump, rbf_page, and keygen, since those weren't
being tested at all.

Added chksum_test, final cleanup.

(cherry picked from commit f627199acb)
2022-12-12 09:01:20 -08:00
Seebs
3c05f1ff37 Distinguish between usage errors and other errors
Cobra automatically displays usage messages, and also a gratuitous
"Error: [...]" line in some cases, when any error at all occurs
running a command. To suppress the usage message, you have to set
cmd.SilenceUsage to true. But the code that would do this doesn't
have access to it. To address this, we introduce a category of
"usage error", implemented with stdlib error wrapping (%w) and
use errors.Is to check for it. There's also utility functions
to do this checking automatically, or indeed, to handle wrapping
of the ctl.SomethingCommand and handle running it with a suitable
context and everything.

In fact, several of the places we're checking for usage errors,
we can never actually report one, but we're checking consistently
so that if we want to report usage errors, we can.

For instance, server.Start and (dax)server.Start don't ever
return usage errors, right now, but we're checking their responses
anyway.

(cherry picked from commit c681642734)
2022-12-12 09:01:20 -08:00
Fletcher Haynes
da9b57bd45 Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
Fletcher Haynes
eb06bb50ae Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
Ben Johnson
c7c9c1e1d7
v2.0.0
Co-authored-by: Cody Soyland <codysoyland@gmail.com>
2019-10-08 14:56:17 -06:00
Matt Jaffee
9e6662fb00
send POSTed schema to all nodes in cluster
also fix a *bunch* of tests that weren't closing the clusters they
created. Cleaned up one test to use t.Run instead of just checking
everything in a loop
2019-04-29 19:31:23 -05:00
Seebs
77d49ded64 so much lint
So with the switch to a new linter, we get a lot of new warnings,
and the majority of them are harmless probably, but a few might be
real. Variously just use _ to suppress warnings, or report errors.
There's probably things here that deserve better fixes, but we can
always revisit it.
2019-04-16 12:07:18 -05:00
Matt Jaffee
5ff77c816a
get rid of unecessary server stuff and export node and uri 2018-07-03 13:26:51 -05:00
Cody Soyland
824474160e Enhance test utilities (introduce Cluster type, improve naming) 2018-06-28 13:34:58 -05:00
Cody Soyland
e2512ec58d Use test.MustRunMainWithCluster in ctl tests 2018-06-21 16:26:34 -05:00
Cody Soyland
c6db3974bc WIP API refactor 2018-06-21 13:51:31 -05:00
Travis Turner
2a9b1e9e5b
final Frame to Field rename 2018-06-06 01:27:12 -05:00
Travis Turner
3531c128c4
GoRename Frame to Field in index.go 2018-06-05 22:33:48 -05:00
Matt Jaffee
47f7beaecc
WIP removing inverse 2018-05-25 17:18:38 -05:00
Travis Turner
43ec69d08b
API.URI was not being used. removed it. 2018-05-09 09:32:18 -05:00
Matthew Jaffee
f8cb579187
get tests passing 2018-04-09 14:29:43 -05:00
Yuce Tekol
c36dd395e6
All tests pass 2018-04-03 15:20:33 -07:00
Travis Turner
216ba7a41e
Use NodeID instead of URI for node identification 2018-02-02 15:58:46 -06:00
Travis Turner
a8871ada6a
Convert Host to URI.
Fix all compile errors.
2017-10-25 11:52:55 -05:00
Yuce Tekol
e223ec3f9a
Rename Host -> URI 2017-10-12 15:49:34 +03:00
Yuce Tekol
a95b09d30d
more host string to uri changes 2017-10-04 15:29:00 +03:00
Matthew Jaffee
3d6dbcfc7b
use context everywhere instead of golang.org version 2017-08-30 10:36:28 -05:00
Cody Soyland
85b1a73b73 Refactor test utilities into importable package.
Remove duplicate instances of test utilities from pilosa.ctl.
Now subpackages such as pilosa.ctl may import test utilities.
2017-06-23 09:10:15 -05:00
Linh Vo
a79e170256 more ctl tests 2017-05-29 13:41:23 -10:00