lotus/cli
Nikola Divic 811bc62d65 test: cli test setup & test chain head
CLI actions lack unit tests. I decided to use the approach similar to
what I found in `send_test.go` using gomock, but I don't rely on custom
"service" implementations but mock the whole FullNode API.
This first commit validates the test setup by testing the simplest method
of the chain category, e.g. `chain head`.

This requires a minor refactor of the CLI action code:
- The constructor (`GetFullNodeAPI`) checks if there's an injected mock
API in the app Metadata and uses that in unit tests.
- Actions shouldn't use raw `fmt.*` but instead write to the `app.Writer`
so the CLI output is testable
2022-02-08 17:15:45 +01:00
..
util test: cli test setup & test chain head 2022-02-08 17:15:45 +01:00
auth.go improve get api error messages 2021-08-16 14:33:08 +03:00
backup.go Plumb contexts through 2021-12-11 17:04:00 -05:00
chain_test.go test: cli test setup & test chain head 2022-02-08 17:15:45 +01:00
chain.go test: cli test setup & test chain head 2022-02-08 17:15:45 +01:00
client_retr.go cli: boolean logic is hard 2021-11-29 21:41:38 +01:00
client.go feat: retrieval-ask - if size param is zero use QueryOffer.Size 2021-12-20 16:03:03 +01:00
cmd.go remove commented code. 2021-08-12 15:38:19 +01:00
disputer.go feat: log dispute rate 2021-05-24 16:31:50 -07:00
filplus.go rename a fil plus cmd upon request 2021-10-20 17:53:16 -07:00
helper.go feat: lite-mode - CLI tests for lotus client commands 2020-10-23 15:02:49 +02:00
init_test.go introduce message prototypes 2021-05-07 15:30:05 +02:00
log.go cli for checking alerts 2021-08-26 15:45:17 +02:00
mpool_manage.go Plug in InteractiveSend to all adopted commands 2021-05-07 15:30:05 +02:00
mpool.go Improve cli docs 2021-07-29 00:29:27 -04:00
multisig.go CLI: Add a lotus multisig cancel command 2021-11-18 19:21:17 -05:00
net.go fix lint 2022-01-20 11:46:39 +02:00
params.go WIP: Integrate FIP0013 2021-05-11 22:10:29 -04:00
paych.go update even more imports 2020-09-28 14:25:58 -07:00
pprof.go improve get api error messages 2021-08-16 14:33:08 +03:00
send_test.go Plug in InteractiveSend to all adopted commands 2021-05-07 15:30:05 +02:00
send.go Plug in InteractiveSend to all adopted commands 2021-05-07 15:30:05 +02:00
sending_ui.go Add function to display nanoFIL 2021-05-07 15:30:05 +02:00
services_send_test.go Fix tests and verifreg 2021-05-07 15:30:05 +02:00
services.go stmgr: drop MethdosMap 2021-09-02 18:58:34 +02:00
servicesmock_test.go remove read task type and run gen and docsgen 2021-06-07 15:03:06 +05:30
state.go stmgr: drop MethdosMap 2021-09-02 18:58:34 +02:00
status.go implement NodeStatus API 2021-05-07 15:30:04 +02:00
sync.go cli: fix build with v1 api changes 2021-04-03 12:55:29 +02:00
util.go Handle the --color flag via proper global state 2021-07-13 12:22:29 +02:00
version.go miner: Command to dump all miner info 2020-08-04 20:57:48 +02:00
wait.go add timeout flag to wait-api command 2021-11-02 17:28:11 +00:00
wallet.go use existing util 2021-10-26 20:53:16 -04:00