gauge-docker-java

command module
v0.0.0-...-16856b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2019 License: GPL-3.0 Imports: 18 Imported by: 0

README

Gauge-Docker-Java

Contributor Covenant

Status: Unstable | Not ready for production use

This is an experimental plugin for running Java language plugin for gauge in a Docker container.

How it works

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.

Caveats

  • 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 on localhost 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 do sudo gauge --init docker-java and sudo 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, jars have to explicitly copied over from .gauge/plugins/java to the ./libs directory in the current project.

Build from source

Requirements
Compiling
go run make.go
Installing

After compilation:

go run make.go --install
Creating distributable

Run after compiling:

go run make.go --distro

Create a project

Initialize
gauge --init docker-java

This will build a docker image with Gauge Java and create a sample implementation in the current directory.

Add tests

Write your tests the way you would write for Gauge Java.

Run
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.

License

GNU Public License version 3.0 Gauge-Ruby is released under GNU Public License version 3.0

Copyright 2016 ThoughtWorks, Inc.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL