Status: Unstable | Not ready for production use
This is an experimental plugin for running Java language plugin for gauge in a Docker container.
This plugin appears to Gauge as a language runner. Gauge has no knowledge about Docker usage. The plugin is responsible for bringing up Docker and executing the test code in the container.
When a new project is initialized, this plugin builds a Docker image from the Dockerfile shipped with the plugin. The image has Gauge Java installed in it.
When gauge tests are run, the plugin brings up a container from the image that was built previously, mounts the current project root in the container, sets Gauge's API ports as environment variables and invokes the Gauge Java runner inside the container. The Gauge Java runner in the container connects to Gauge running on the host through TCP.
- Works only on Linux at the moment. OSX needs further abstractions using
docker-manager
. - Docker is invoked using
--net=host
option. This does not isolate the network interface of the container from the host. This is necessary because both Gauge and Gauge-Java try to listen and connect onlocalhost
for now. - Currently, Gauge commands need to be run as the same user that runs the Docker daemon. By default, it needs
root
. So, you may need to dosudo gauge --init docker-java
andsudo gauge specs/
unless you run Docker manager as a different user. gauge-java
in the container is not able to figure out the classpaths. So,jar
s have to explicitly copied over from.gauge/plugins/java
to the./libs
directory in the current project.
go run make.go
After compilation:
go run make.go --install
Run after compiling:
go run make.go --distro
gauge --init docker-java
This will build a docker image with Gauge Java and create a sample implementation in the current directory.
Write your tests the way you would write for Gauge Java.
gauge specs/
This will start Gauge, Gauge will trigger the docker-java
runner,
which will in turn bring up a container with the image compiled
previously.
Gauge-Ruby is released under GNU Public License version 3.0
Copyright 2016 ThoughtWorks, Inc.