On Thu, Apr 25, 2019 at 7:06 PM Ullrich Hafner <
ullrich...@gmail.com> wrote:
> Is someone already writing integration tests that use agents that are provided by a docker container and has an example to share?
Various plugins use the `docker-fixtures` library for this. For
example, with `DockerClassRule<JavaContainer>` it is straightforward
to start a simple SSH agent in a container. Of course you can create a
subclass with specialized tools installed in the image. This is the
same library ATH uses, by the way.
> Since my plugins interact with Git I want to create a Git Repository in the test setup with fake data. Do we have a kind of API to fill a Git repository (like GitRepo in ATH)?
`GitSampleRepoRule` is available with a dep on the `tests` classifier
of the `git` plugin. This is used widely in Pipeline-related plugins.
It does not look like either this nor `TestGitRepo` are currently set
up to handle remote repositories (in a Docker container) like
`GitRepo.transferToDockerContainer` does, so that would be an obstacle
if you had a single test which needed to run an agent in a container
_and_ have that agent access a sample Git repository.