shanejansen / touchstone

Touchstone is a testing framework for your services that focuses on component, end-to-end, and exploratory testing.
16 stars 2 forks source link

Log services as they run (start capturing output immediately) #43

Closed ScottFreeCode closed 2 years ago

ScottFreeCode commented 2 years ago

Fixes #36 by asking Docker to pipe the logs to a file as the next action after attempting to start the container.

The disadvantage of this approach is that, as long as we're using docker container logs --follow instead of piping the container run command itself to the file, there's a remote possibility that a startup failure could be missed if it is literally faster than the time it takes for Docker+Python to finish the run CLI command and execute the logs command.

That could theoretically be fixed by changing the strategy internal to __run_image. EDIT: or by combining this with #42! I outsmarted myself apparently.

See also #42