Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capture stdout #4

Open
Geal opened this issue Sep 27, 2018 · 8 comments
Open

capture stdout #4

Geal opened this issue Sep 27, 2018 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@Geal
Copy link
Member

Geal commented Sep 27, 2018

there's probably a way to get what's written on stdout in the sozu container, but also in the client and backend containers. This output should be displayed in case the test fails

@NotBad4U
Copy link
Contributor

We can use a ToStringConsumer provide by testcontainers: https://www.testcontainers.org/usage/options.html#following-container-output

@NotBad4U NotBad4U added the enhancement New feature or request label Oct 5, 2018
@NotBad4U
Copy link
Contributor

NotBad4U commented Oct 5, 2018

WIP in branch follow-ouput-container

@NotBad4U NotBad4U self-assigned this Oct 5, 2018
@NotBad4U NotBad4U added the wip label Oct 5, 2018
@Geal
Copy link
Member Author

Geal commented Oct 9, 2018

can we get the output from the other containers as well?
Side question: since the node backend and sozu containers are reused for every test, how can we get the log messages specific to each test? For sozu we might be able to filter on the app id, but not for all of its log messages.

@NotBad4U
Copy link
Contributor

NotBad4U commented Oct 9, 2018

can we get the output from the other containers as well?

Yes with same method

Side question: since the node backend and sozu containers are reused for every test

I was wrong about how @Rule work. A fresh container is spawn between each @Test.
So you'll get only the log message for your test which is what we want.

I did this here.
So follow-ouput-container is no longer useful anymore. I think we can close this issue now we know how to do it.

@NotBad4U NotBad4U removed the wip label Oct 9, 2018
@Geal
Copy link
Member Author

Geal commented Oct 10, 2018

can you add output capture to all tests?

@NotBad4U
Copy link
Contributor

Maybe we can try a trick with @BeforeEach where we create the Consumer and @AfterEach where we print the logs.

@NotBad4U
Copy link
Contributor

NotBad4U commented Nov 2, 2018

Done in #26

@NotBad4U NotBad4U closed this as completed Nov 2, 2018
@Geal
Copy link
Member Author

Geal commented Nov 3, 2018

reopening it because it's missing some code

@Geal Geal reopened this Nov 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants