Arquillian Cube Extension 1.0.0.Alpha17 Released

The Arquillian team is proud to announce the 1.0.0.Alpha17 release of the Arquillian Cube Extension component!

New version of Arquillian Cube 1.0.0.Alpha17 has been released!

What’s new

Graphene URL auto resolution

In previous versions, Graphene URL auto resolution was based on rather complex algorithm with absolute or relative URLs to detect which was the real URL in Docker space (Old auto resolution). This has been simplified so now only full URLs are permitted.

In this version if URL contains dockerHost, it’s resolved to docker host IP. If it contains an IP then this IP is used. If a string is provided, this is considered as the container name and Arquillian Cube resolves it to the internal container IP.

Support for @CubeIp in Container Objects

Now a Container Object can also be enriched with internal IP of the given container.

Thanks Ramon Rivas for providing this feature!

Provide URL enrichment for standalone mode

New enrichment is provided to construct an URL for black-box tests pointing to a given docker host and resolved exposed port.

@DockerUrl(protocol="http", containerName = "helloworld", exposedPort = "8080", context = "/hello")
@ArquillianResource
URL url;

In the example above URL is the docker host IP pointing to binding port of exposed port 8080 of the container helloworld and using /hello as context.

Set Environment variables for Container Objects

Now you can set environment variables to defined container objects.

@Cube(“tomee”)
@Image("tomee:8-jre-1.7.2-webprofile")
@Environment(key = "A", value = "a")
@Environment(key = "B", value = "b")
public static class ImageContainerObject {
}

Annotation can also be used on the field definition.

Create Volumes for Container Objects

@Cube(“tomee”)
@Image("tomee:8-jre-1.7.2-webprofile")
@Volume(hostPath = "/mypath", containerPath = "/containerPath")
@Volume(hostPath = "/mypath2", containerPath = "/containerPath2")
public static class ImageContainerObject {
}

Annotation can also be used on the field definition.

Add @DockerUrl support for RestAssured enricher

Now you can configure URL for REST-Assured integration using @DockerUrl annotation.

@DockerUrl(containerName = "pingpong", exposedPort = 8080)
@ArquillianResource
RequestSpecBuilder requestSpecBuilder;

RequestSpecBuilder is configured with docker host IP, and resolving port binding from container pingpong and exposed port 8080.

Provide a new URL ResourceProvider for Kubernetes and Openshift

Now you can get URL to connect to a Kubernetes/OpenShift service with ease.

@Named("hello-world-service")
@PortForward
@ArquillianResource
URL url;

In this case the URL is provided pointing directly to the service hello-world so you can easily query it.

Kudos to Ioannis Canellos for providing this feature.

What is Arquillian Cube Extension?

With Arquillian Cube you can control the lifecycle of Docker images as part of the test lifecyle, either automatically or manually. This gives you the chance to scale up from a integration/functional test level all the way up to the system test level.

Release details

Component Arquillian Cube Extension
Version 1.0.0.Alpha17 view tag
Release date 2017-02-01
Released by Alex Soto
Compiled against

Published artifacts org.arquillian.cube

  • org.arquillian.cube » arquillian-cube-api jar javadoc pom
  • org.arquillian.cube » arquillian-cube-spi jar javadoc pom
  • org.arquillian.cube » arquillian-cube-core jar javadoc pom
  • org.arquillian.cube » arquillian-cube-containerless jar javadoc pom
  • org.arquillian.cube » assertj-docker-java jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-drone jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-recorder jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-restassured jar javadoc pom
  • org.arquillian.cube » arquillian-cube-openshift jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes-fabric8 jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes-reporter jar javadoc pom
  • org.arquillian.cube » arquillian-cube-requirement jar javadoc pom

Release notes and resolved issues 8

Enhancement
Bug
Other

Thanks to the following list of contributors: Alex Soto, Dipak Pawar, Ramon Rivas, Ioannis Canellos

Arquillian Cube Extension 1.0.0.Alpha16 Released

The Arquillian team is proud to announce the 1.0.0.Alpha16 release of the Arquillian Cube Extension component!

New version of Arquillian Cube 1.0.0.Alpha16 has been released with quite a bunch of enhancements and bugfixes.

What’s new

RestAssured configuration done via RequestSpecBuilder

In the previous version of Arquillian Cube, all parameters were set using internal RestAssured static method. This approach made test methods unable to be ran in parallel.
To address this issue we provide injection of RequestSpecBuilder class which lets you specify parameters such as host, port or HTTP headers on a test basis.

@ArquillianResource
RequestSpecBuilder requestSpecBuilder;

@Test
public void should_receive_ok_message() {
      RestAssured
          .given()
            .spec(requestSpecBuilder.build())
          .when()
            .get()
          .then()
            .assertThat().body("status", equalTo("OK"));
}

Arquillian Recorder/Reporter integration with Kubernetes

We have enhanced integration of Arquillian Recorder/Reporter in Cube by providing Kubernetes module. By using it you can easily get access to all configuration parameters used for test execution, as well as the session status which include Pods, Services, Replication Controllers, Namespaces, …

Kubernetes namespace prefix are fully configurable

namespace.prefix configuration parameter has been added to configure the namespace prefix.

Creates an AssertJ custom assertions for Docker

Now you can use AssertJ custom assertions for validating Docker containers.

@ArquillianResource
DockerClient docker;
assertThat(docker).hasImage("myimage");
assertThat(docker).container("myinstancename").hasExposedPorts(8080);
assertThat(docker).container("myinstancename").hasBindPorts(8080)

Creates stop/kill attribute

It may happen that certain docker image takes a lot of time to shutdown. For example shutting down selenium server in standalone debug mode might take ~10 seconds on the modern machine. These images are not really relavant for your test logic, they simply provide browsers to exercise our app against.

At the end of the tests, you spend 10 seconds waiting that this instance is stopped without a real need. We can simply kill such an image and save time during the build.

For this purpose boolean attribute killContainer in CUBE format has been added to set that an image should be killed. By default it is false which means that container is stopped normally.

Support for IP address management

Add support for adding IPAM options in network section in docker-compose files.

Add cleanBuildImage attribute

Configuration boolean cleanBuildImage parameter has been added so you can choose if all build images should be removed from docker host or not after finishing the build. By default build images are removed.

Reporting improvements

Arquillian Recorder Reporter now also displays information about containers like IO, Network or disk usage.

Port forwarding

Make possible to configure the port forwarder server bind address. This way you can run more than one instance of the port forwarder on the same machine.

UI videos in MP4 format

In the previous version of Cube, videos recorded during UI tests were stored in flv format. As Flash is slowly disappearing we decided to switch to format supported by HTML5 <video> tag.

What is Arquillian Cube Extension?

With Arquillian Cube you can control the lifecycle of Docker images as part of the test lifecyle, either automatically or manually. This gives you the chance to scale up from a integration/functional test level all the way up to the system test level.

Release details

Component Arquillian Cube Extension
Version 1.0.0.Alpha16 view tag
Release date 2017-01-10
Released by Alex Soto
Compiled against

Published artifacts org.arquillian.cube

  • org.arquillian.cube » arquillian-cube-api jar javadoc pom
  • org.arquillian.cube » arquillian-cube-spi jar javadoc pom
  • org.arquillian.cube » arquillian-cube-core jar javadoc pom
  • org.arquillian.cube » arquillian-cube-containerless jar javadoc pom
  • org.arquillian.cube » assertj-docker-java jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-drone jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-recorder jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-restassured jar javadoc pom
  • org.arquillian.cube » arquillian-cube-openshift jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes-fabric8 jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes-reporter jar javadoc pom
  • org.arquillian.cube » arquillian-cube-requirement jar javadoc pom

Release notes and resolved issues 30

Enhancement
Bug
Other
Docker

Thanks to the following list of contributors: Alex Soto, Dipak Pawar, Ioannis Canellos, Jonh Wendell, Filippe, Eddú Meléndez Gonzales, Rob Cernich, Hemani, Bartosz Majsak

Arquillian Cube Extension 1.0.0.Alpha15 Released

The Arquillian team is proud to announce the 1.0.0.Alpha15 release of the Arquillian Cube Extension component!

Apart from bug fixes in the openshift module, we brought very anticipated new feature – support for Kubernetes. This was a joint effort with the amazing fabric-8 team.

New Features

Kubernetes Support

The kubernetes extension helps you write and run integration tests for your Kubernetes/Openshift application.

This extension will run tests in a black-box fashion, creating and managing a temporary namespace for your tests, apply all Kubernetes resources required to create your environment and once everything is ready it will run your tests. The tests will be enriched with resources required to access services. Finally when testing is over it will cleanup everything.

The test cases are meant to interact with the provided services and assert that the environment is in the expected state.

@RunWith(Arquillian.class)
public class HelloWorldTest {

    @Named("hello-world-service")
    @ArquillianResource
    Service helloWorld;

    @Test
    public void shouldShowHelloWorld() throws IOException {
        assertNotNull(helloWorld);
        assertNotNull(helloWorld.getSpec());
        assertNotNull(helloWorld.getSpec().getPorts());
        assertFalse(helloWorld.getSpec().getPorts().isEmpty());
    }
}

In this example, test reads for kubernetes.json file form the root of the classpath, deploys everything and injects Kubernetes components into the test. Notice that you can assert that elements are correctly configured as well as getting information for connecting to the services and validate they have been deployed correctly.

You can also import io.fabric8:kubernetes-assertions, which is built on top of excellent assertj project, you’ll be able to write assertions like:

@RunWith(Arquillian.class)
public class ExampleTest {

  @ArquillianResource
  KubernetesClient client;

  @ArquillianResource
  Session session;

  @Test
  public void testAtLeastOnePod() throws Exception {
    assertThat(client).pods()
                      .runningStatus()
                      .filterNamespace(session.getNamespace())
                      .hasSize(1);
  }
}

You can read more about Kubernetes integration at http://arquillian.org/arquillian-cube/#_kubernetes and full example at https://github.com/arquillian/arquillian-cube/tree/master/kubernetes/ftest-kubernetes

Fabric8 Support

The Fabric8 extension can be used along with the Kubernetes extension to provide a tighter integration with the Fabric8 Microservices Platform.

It provides Fabric8Label provider and Fabric8Annotation provider.

You can read more about Fabric 8 integration at http://arquillian.org/arquillian-cube/#_fabric8

What is Arquillian Cube Extension?

With Arquillian Cube you can control the lifecycle of Docker images as part of the test lifecyle, either automatically or manually. This gives you the chance to scale up from a integration/functional test level all the way up to the system test level.

Release details

Component Arquillian Cube Extension
Version 1.0.0.Alpha15 view tag
Release date 2016-09-01
Released by Alex Soto
Compiled against

Published artifacts org.arquillian.cube

  • org.arquillian.cube » arquillian-cube-api jar javadoc pom
  • org.arquillian.cube » arquillian-cube-spi jar javadoc pom
  • org.arquillian.cube » arquillian-cube-core jar javadoc pom
  • org.arquillian.cube » arquillian-cube-containerless jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-drone jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-recorder jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-restassured jar javadoc pom
  • org.arquillian.cube » arquillian-cube-openshift jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes-fabric8 jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes jar javadoc pom
  • org.arquillian.cube » arquillian-cube-requirement jar javadoc pom

Release notes and resolved issues 1

Enhancement

Thanks to the following list of contributors: Alex Soto, Jonh Wendell, Ioannis Canellos, Ales Justin

Arquillian Cube Extension 1.0.0.Alpha14 Released

The Arquillian team is proud to announce the 1.0.0.Alpha14 release of the Arquillian Cube Extension component!

What is Arquillian Cube Extension?

With Arquillian Cube you can control the lifecycle of Docker images as part of the test lifecyle, either automatically or manually. This gives you the chance to scale up from a integration/functional test level all the way up to the system test level.

Release details

Component Arquillian Cube Extension
Version 1.0.0.Alpha14 view tag
Release date 2016-08-18
Released by Alex Soto
Compiled against

Published artifacts org.arquillian.cube

  • org.arquillian.cube » arquillian-cube-api jar javadoc pom
  • org.arquillian.cube » arquillian-cube-spi jar javadoc pom
  • org.arquillian.cube » arquillian-cube-core jar javadoc pom
  • org.arquillian.cube » arquillian-cube-containerless jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-drone jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-recorder jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-restassured jar javadoc pom
  • org.arquillian.cube » arquillian-cube-openshift jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes-fabric8 jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes jar javadoc pom
  • org.arquillian.cube » arquillian-cube-requirement jar javadoc pom

Release notes and resolved issues 2

Bug
Other

Thanks to the following list of contributors: Alex Soto

Arquillian Cube Extension 1.0.0.Alpha13 Released

The Arquillian team is proud to announce the 1.0.0.Alpha13 release of the Arquillian Cube Extension component!

Apart from bug fixes and components upgrades that you can see in issues list at the bottom of this post, this release also contains a lot of new feature:

Important Change from Previous Releases

Changed default definition format

In Cube Alpha12 and below the default definition format was CUBE. This was in that way because at time of writing first version of Cube there was no docker-compose format. Now that docker-compose is the default format, Arquillian Cube interprets by default any orchestration file as docker-compose format.

If you are using CUBE format instead of docker-compose you will need to update your arquillian.xml file with next parameter:

<extension qualifier="docker">
  <property name="definitionFormat">CUBE</property>
</extension>

This change is important if you are updating from Alpha12 to Alpha13 and NOT using docker-compose. Of course if you’ve already using docker-compose format you can remove the definitionFormat entry from arquillian.xml file.

New Features

Arquillian Recorder integration

Arquillian Recorder project brings neat reports of your Arquillian tests. Now we are providing an integration to the project so that generated report contains also information about Cube and Docker such as Docker version used, Docker containers definition or an schema of the organization of each container.

p.To use it you only need to import recorder and cube-docker-recorder dependencies:

<dependency>
  <groupId>org.arquillian.extension</groupId>
  <artifactId>arquillian-recorder-reporter-impl</artifactId>
  <version>${version.arquillian.recorder}</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.arquillian.cube</groupId>
  <artifactId>arquillian-cube-docker-recorder</artifactId>
  <version>${version.arquillian.cube}</version>
  <scope>test</scope>
</dependency>

You can read more about Arquillian Recorder integration in the recorder section of the Cube documentation.

Added manual attribute at CUBE format

Sometimes you don’t want that Cube starts a Docker container. You only want to have registered and start it when you need it inside test using CubeController. In these cases set manual attribute to true in the container definition.

tomcat:
  image: tutum/tomcat:7.0
  manual: true

In previous configuration you are setting that tomcat container will be started manually in the test (or Cube extension).

You can read more about manual attribute in the config section.

Integration with Arquillian Drone

Arquillian Drone is an Arquillian extension that basically manages Selenium WebDriver instances. Selenium community provides official Docker images with browser (Firefox or Chrome) and VNC server installed. This integration manages this integration automatically for you providing a correct configured WebDriver instance as well as Selenium container and VNC client for recording the session up and running. Finally it also integrates with Arquillian Recorder to provide link to the recording of the test.

To use it, apart from Arquillian Drone dependencies you only need to provide cube-docker-drone dependency:

<dependency>
  <groupId>org.arquillian.cube</groupId>
  <artifactId>arquillian-cube-docker-drone</artifactId>
  <scope>test</scope>
  <version>${version.arquillian.cube}</version>
</dependency>

You can read more about Arquillian Drone integration right here.

Integration with Arquillian Graphene

Arquillian Graphene is a wrapper around Arquillian Drone to provide a simplification in Page Object patter, AJAX testing or High Level find elements.

To use it, apart from Arquillian Graphene (and Arquillian Drone) dependencies you only need to add cube-docker-drone dependency. Cube will be smart enough to inspect classpath and decide to provide Graphene integration or not.

<dependency>
  <groupId>org.arquillian.cube</groupId>
  <artifactId>arquillian-cube-docker-drone</artifactId>
  <scope>test</scope>
  <version>${version.arquillian.cube}</version>
</dependency>

You can read more about Arquillian Graphene integration at http://arquillian.org/arquillian-cube/#_graphene.

Allow parallel execution of tests

One of the main problems when running Cube tests in parallel against same Docker host is that you cannot instantiate twice the same container due a conflict name (you cannot instantiate two containers with same name). To avoid this, star operator has been created for CUBE format.

The idea behind star operator is that if the name and links of a container contains symbol * then Arquillian Cube will change that part with a random UUID and updating the links accordantly.

For example:

<property name="dockerContainers">
  tomcat*:
    image: tutum/tomcat:8.0
    portBindings: [8080/tcp]
    links:
      - ping*
  ping*:
    image: jonmorehouse/ping-pong
    exposedPorts: [8089/tcp]
</property>

Might be executed to Docker host as:

<property name="dockerContainers">
  tomcat_123456:
    image: tutum/tomcat:8.0
    portBindings: [54678 -> 8080/tcp]
    env: [ping_HOSTNAME=ping_123456]
    links:
      - ping_123456
  ping_123456:
    image: jonmorehouse/ping-pong
    exposedPorts: [8089/tcp]
</property>

Notice that now the name is generated randomly. Now you can run tests in parallel against same Docker host.

Currently we are not providing a way for scaling in docker-compose format, but in next release we will offer this possibility as well.

You can read more about this feature at http://arquillian.org/arquillian-cube/#_parallel_execution.

Provide a mechanism for tests/suites to run if certain assumptions are satisfied

Sometimes you write a test and you want to force user to run a test against an specific docker machine. In these cases, if the machine where you are running the test does not contain a docker machine with this name, the result will be a failing test. But probably what you expect is to simply skip the test. This is what this feature provides.

To do it, you need to use ArquillianConditionalRunner or RequirementRule and import cube-requirement dependency:

<dependency>
  <groupId>org.arquillian.cube</groupId>
  <artifactId>arquillian-cube-requirement</artifactId>
  <scope>test</scope>
  <version>${version.arquillian.cube}</version>
</dependency>

And the test:
@RunWith(ArquillianConditionalRunner.class)
@RequiresDockerMachine(name = "dev")
public class HelloWorldServletTest {
   ...
}

This test is only executed if there is a docker machine named dev. If not, it is skipped.

You can read more about this feature at http://arquillian.org/arquillian-cube/#_requirements_module.

Integration with RestAssured

If you are using Docker and RestAssured for testing REST API, probably you have already faced the problem of having to configure RestAssured in all tests with an IP different than localhost and a port different of 8080. Instead of repeating this configuration code again and again in all your tests, Arquillian Cube can do it for you.

To do it you only need to add (apart from RestAssured dependency) the cube-docker-restassured dependency.

<dependency>
  <groupId>org.arquillian.cube</groupId>
  <artifactId>arquillian-cube-docker-restassured</artifactId>
  <scope>test</scope>
  <version>${version.arquillian.cube}</version>
</dependency>

You can read more about RestAssured integration at http://arquillian.org/arquillian-cube/#_rest_assured_integration.

Enrichment for Internal IP

Now you can enrich your tests with internal IP used in an specific container.

@CubeIp(containerName = “tomcat”)
String ip;

What is Arquillian Cube Extension?

With Arquillian Cube you can control the lifecycle of Docker images as part of the test lifecyle, either automatically or manually. This gives you the chance to scale up from a integration/functional test level all the way up to the system test level.

Release details

Component Arquillian Cube Extension
Version 1.0.0.Alpha13 view tag
Release date 2016-08-17
Released by Alex Soto
Compiled against

Published artifacts org.arquillian.cube

  • org.arquillian.cube » arquillian-cube-api jar javadoc pom
  • org.arquillian.cube » arquillian-cube-spi jar javadoc pom
  • org.arquillian.cube » arquillian-cube-core jar javadoc pom
  • org.arquillian.cube » arquillian-cube-containerless jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-drone jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-recorder jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-restassured jar javadoc pom
  • org.arquillian.cube » arquillian-cube-openshift jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes-fabric8 jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes jar javadoc pom
  • org.arquillian.cube » arquillian-cube-requirement jar javadoc pom

Release notes and resolved issues 21

Docker
Bug
Other
Documentation
Enhancement

Thanks to the following list of contributors: Alex Soto, Ioannis Canellos, Jonh Wendell, Filippe, Eddú Meléndez Gonzales, Stefan Miklosovic, Matous Jobanek, Aslak Knutsen