[go: up one dir, main page]

Tezt/Cloud: Make handling of inputs better

What

First commit ensure that we don't need to press twice <enter> when keep-alive option is used.

Second commit fixes at the same time that 1. With keep alive, only inputs after the end of the test are considered, and 2. For the proxy mode, we can actually detach from it if have input something different from ctrl+d. At the moment, once you press enter, you can't detach from it.

Why

UX issues.

How

For the first commit, we share the input buffer. This higlight the conflict between eof used for the proxy mode and the keep-alive option (two reads on the same input).

The second commit introduces an abstraction via the Input module that reads stdin line by line. Then any consumer can register to get the next input. This solution has the benefit it can be extended to more consumers very easily.

Manually testing the MR

dune exec tezt/tests/cloud/main.exe -- cloud health -v --localhost --website --keep-alive

now requires to press <enter> only once, and only once the test has ended.

dune exec tezt/tests/cloud/main.exe -- cloud dal -v --log-file /tmp/log --proxy

you can press anything, including <enter> and once you press ctrl+d it should detach from the orchestrator.

Merge request reports

Loading