Fix that `config init -o file` fails + fix `--config-file` `password_filename` handling + add tests
Fixes https://gitlab.com/nomadic-labs/tezos/-/issues/202
Branch: https://gitlab.com/nomadic-labs/tezos/-/commits/smelc-issue-202-config-init-cli-fix
Here's what this MR does:
-
Add a test witnessing the issue 202 ( config init -odoesn't work anymore) -
Remove command config init mockupand implement it inconfig initwhen--mode mockupis specified. This is possible because the two configurations and the two modes are orthogonal to each other. Check that the test passes, hereby fixing issue 202. -
Add a roundtrip test that checks that the file generated by config initcan be given as input and thatconfig initing again yields the same file as the original one. -
The previous test revealed than field password_filenameof--config-filewas being ignored. Hence fix that too. -
Remove command config show mockupand implement it inconfig show, for consistency. -
Add tests of config show, because well, I was on the way🐱
Note that, compared to the original report, we don't do any change to the baker. As @igarnier mentioned, the baker's options cannot be easily separated from the main client's options. However, because this MR changes config init mockup to --mode mockup config init, the baker should not be disturbed by the mockup mode anymore in its normal operations; since the baker is not supposed to pass --mode mockup in the first place.
Suggested reviewers: @igarnier @richard.bonichon @rafoo_ @bidinger
Edited by Clément Hurlin