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

Add operation to get log from container #90

Closed
lordofthejars opened this issue Feb 1, 2015 · 12 comments
Closed

Add operation to get log from container #90

lordofthejars opened this issue Feb 1, 2015 · 12 comments
Assignees
Milestone

Comments

@lordofthejars
Copy link
Member

Adds operation in Cube interface for getting log info from running container. With this devs will be able to get files from container in the test by using Cube interface.

Also adding anew property in configuration file so before container is stopped by Arquillian Cube logs will be copied in output local directory for manual inspection.

@lordofthejars
Copy link
Member Author

In this issue we can do it two things:

  • The first one by adding logContainerCmd method to DockerClientExecutor
  • The second one by adding an attribute to arquillian.xml which you can set where to copy the log in local disk, so it can be inspected after execution.

To be more explicit, in arquillian.xml in every container definition I will provide next section:

tomcat:
  image: tutum/tomcat:7.0
  exposedPorts: [8089/tcp]
  await:
    strategy: polling
  beforeStop:
    - log:
        to: file path

@aslakknutsen
Copy link
Member

@lordofthejars by DockerClient you mean CubeController?

@lordofthejars
Copy link
Member Author

Sorry I mean by DockerClientExecutor. DockerClient already implements it.

@aslakknutsen
Copy link
Member

I think a configuration option in arq.xml sounds like a good option.

I think we have two scenarios here;

  • arquillian.xml; used to fetch complete logs for debug purpose
  • programatically fetch log at a given time to e.g. assert on log state

@aslakknutsen
Copy link
Member

@lordofthejars see #98 (comment)

@lordofthejars
Copy link
Member Author

arquillian.xml; used to fetch complete logs for debug purpose

We need a way to set which container, all, a comma-separated value of which containers, so I decided to put them inside its own configuration.

programatically fetch log at a given time to e.g. assert on log state

This can be achieved by enriching test with DockerClient.

@aslakknutsen
Copy link
Member

We need a way to set which container, all, a comma-separated value of which containers, so I decided to put them inside its own configuration.

I think this makes sense as a per container config. If you need to configure the same for multiple similar containers you can always use the extends option.

@lordofthejars
Copy link
Member Author

Yes for this reason I suggested to add them in yaml format.

@aslakknutsen
Copy link
Member

Agree on the general solution here, just not sure DockerClientExecutor is the right abstraction level to be exposing to the user.

@lordofthejars
Copy link
Member Author

yes in fact to the user we are going to expose only DockerClient by enricher. But we need DockerclientExecutor to implement this method to be used internally.

@rbattenfeld
Copy link

Cool, I see you have already discussed this. Today, I saw that the docker API supports getting the logs. I can't remember yet from heart exactly if that is a kind of a stream. May you know that already.

@lordofthejars lordofthejars self-assigned this Feb 4, 2015
@lordofthejars lordofthejars added this to the 1.0.0.Alpha4 milestone Feb 4, 2015
@lordofthejars
Copy link
Member Author

yes it is in binary docker raw type.

lordofthejars added a commit that referenced this issue Feb 7, 2015
fixes issue #89 and #90 by implementing log and copy from container.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants