pyinfra-dev / pyinfra

pyinfra turns Python code into shell commands and runs them on your servers. Execute ad-hoc commands and write declarative operations. Target SSH servers, local machine and Docker containers. Fast and scales from one server to thousands.
https://pyinfra.com
MIT License
3.91k stars 382 forks source link

Mention end-to-end tests in `contributing.md`/Tests #856

Closed phlummox closed 2 weeks ago

phlummox commented 2 years ago

Is your feature request related to a problem? Please describe

Running the end-to-end tests when doing development on pyinfra seems like a good idea, but they're not enabled by default - so contributors may be missing bugs that don't get caught until the Github "workflows" are run. Perhaps the contributing.md file could include a mention of how to run them?

Describe the solution you'd like

I'd suggest just adding a second paragraph to the "Tests" section of contributing.md, with details on how to run the end-to-end tests - see here. Happy to create a pull request if desired.

phlummox commented 2 years ago

As an aside: running the end-to-end tests as a developer is much more pleasant if you can actually see what they're doing as they progress, i.e. logging the output as well as capturing it. For my own use, I amended conftest.py to do this, here —

https://github.com/phlummox-dev/pyinfra/commit/be35c458518e02300f8d11d73d5225f7fa8141cc

— but that might have unexpected effects on the tests. (e.g. some of the end-to-end tests seem to make use of a very short timeout, and just logging the output of pyinfra seems to cause them to fail.)

Fizzadar commented 2 years ago

Hi @phlummox thank you for raising this, will definitely add to the contributing doc ASAP!

Also thank you for the changes to show the output; this is actually very similar to pyinfra's own gevent buffer reading used by connectors (https://github.com/Fizzadar/pyinfra/blob/87fb7a0f936f605484355bd1547c0fccfacdc246/pyinfra/connectors/util.py#L94) :) Will also incorporate a way to do that because it's extremely useful for debugging.