Arquillian Cube 抛出 "Key: [buildImage] is not implemented in Cube." 但在文档中有描述

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

我尝试 运行 对 docker 部署的带有 Arquillian-Cube 的 wildfy 10 容器进行集成测试。第一个测试是 JPA dao 测试 de.bitc.dao.CustomerDaoIT。我想要那个 测试构建和部署自定义的 wildfly 10 docker 容器和 运行 测试 在里面。我跟着 Building containers Arquillian Cube 文档中的示例。

我开始测试:

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

但它失败了:

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

看来,原因是INFORMATION: Key: [buildImage] is not implemented in Cube.,但是为什么arquillian cube不知道buildImage呢?我遵循了文档。

我写了一个 example project 来重现错误。我在我的项目中使用了 arquillian universe bom。

这是我的 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>

docker 使用 buildImage 标签编写 yaml:

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

这是我的 maven pom.xml 的集成测试配置文件部分。您可以在上面链接的示例项目中找到完整的 pom

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

我认为这是文档中的一个错误或泄漏,但我想我在 post 一个问题之前先在这里问过 ;-) 提前致谢。

配置文件 CUBE 中缺少此部分

请注意,您使用的不是 docker-compose 格式,而是立方体格式。默认情况下,docker-compose 是启用的格式,因此这意味着在立方体格式的情况下,您需要明确设置。