Arquillian Cube throws "Key: [buildImage] is not implemented in Cube." but is described in the documentation

时间:2018-02-01 18:31:46

标签: maven integration-testing jboss-arquillian

I try to run an integration test on a with docker deployed wildfy 10 container with Arquillian-Cube. The first test is a JPA dao test de.bitc.dao.CustomerDaoIT. I want that the test build and deploy a customized wildfly 10 docker container and run the test in it. I followed the Building containers example in the Arquillian Cube documentation.

I start the test with:

mvn -Pintegration-test -Ddocker.server=10.33.33.4 verify

but it fails with:

[INFO] Running de.bitc.dao.CustomerDaoIT
Feb 01, 2018 6:21:29 PM org.arquillian.spacelift.Spacelift$SpaceliftInstance <init>
INFORMATION: Initialized Spacelift from defaults, workspace: ~/src/arquillian-drone-example, cache: ~/.spacelift/cache
Feb 01, 2018 6:21:29 PM org.arquillian.cube.docker.impl.docker.compose.ContainerBuilder logUnsupportedOperations
INFORMATION: Key: [buildImage] is not implemented in Cube.
CubeDockerConfiguration: 
  serverVersion = 1.27
  serverUri = tcp://127.0.0.1:4243
  tlsVerify = false
  dockerServerIp = 127.0.0.1
  definitionFormat = COMPOSE
  autoStartContainers = 
  clean = false
  removeVolumes = true
  dockerContainers = containers:
  wildfly10: {alwaysPull: false, killContainer: false, manual: false, readonlyRootfs: false,
    removeVolumes: true}
networks: {}

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.151 s <<< FAILURE! - in de.bitc.dao.CustomerDaoIT
[ERROR] de.bitc.dao.CustomerDaoIT  Time elapsed: 1.15 s  <<< ERROR!
org.arquillian.cube.spi.CubeControlException: Could not create wildfly10
Caused by: java.lang.IllegalArgumentException: Current configuration file does not contain image nor buildImage parameter and one of both should be provided.

It seems, the reason is INFORMATION: Key: [buildImage] is not implemented in Cube., but why arquillian cube should doesn't know buildImage? I followed the documentation.

I wrote an example project to reproduce the error. I used the arquillian universe bom in my project.

Here is my arquillian.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
    <defaultProtocol type="Servlet 3.0"></defaultProtocol>
  <container qualifier="wildfly10" default="false">
    <configuration>
      <property name="chameleonTarget">wildfly:10.1.0.Final:REMOTE</property>
      <property name="managementAddress">127.0.0.1</property>
      <property name="username">test</property>
      <property name="password">test</property>
    </configuration>
  </container>
  <extension qualifier="docker">
    <property name="autoStartContainers">true</property>
    <property name="serverVersion">1.27</property>
    <property name="serverUri">tcp://127.0.0.1:4243</property>
    <property name="dockerContainersFile">src/test/resources/docker/intergration-test.yml</property>
  </extension>
</arquillian>

The docker compose yaml with the buildImage tag:

wildfly10:
  buildImage:
    dockerfileLocation: src/test/resources/docker/wildfly
    noCache: true
    remove: true

Here is integration test profile section from my maven pom.xml. You find the complete pom in the example project linked above

<profile>
  <id>integration-test</id>
  <properties>
    <docker.server>127.0.0.1</docker.server>
  </properties>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <systemPropertyVariables>
            <arquillian.launch>wildfly10</arquillian.launch>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.arquillian.universe</groupId>
      <artifactId>arquillian-cube-docker</artifactId>
      <scope>test</scope>
      <type>pom</type>
    </dependency>
  </dependencies>
</profile>

I think it is a bug or a leak in the documentation, but I think I ask here before I post an issue ;-) Thanks in advance.

1 个答案:

答案 0 :(得分:2)

您在配置文件CUBE中缺少此部分

请注意,您没有使用docker-compose格式,而是使用多维数据集格式。默认情况下,docker-compose是启用的格式,因此这意味着如果是多维数据集格式,则需要显式设置。