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 -o doesn't work anymore)
  • Remove command config init mockup and implement it in config init when --mode mockup is 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 init can be given as input and that config initing again yields the same file as the original one.
  • The previous test revealed than field password_filename of --config-file was being ignored. Hence fix that too.
  • Remove command config show mockup and implement it in config 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

Merge request reports

Loading