Skip to content

Commit eadd63a

Browse files
committed
[issue-1344] - More fixes to the project documentation for 2.0.0 release
1 parent 4640def commit eadd63a

File tree

9 files changed

+34
-38
lines changed

9 files changed

+34
-38
lines changed

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
:toc: left
1212

1313
WARNING: 2.0.0.Alpha1 breaks compatibility with previous versions as _boot2docker_ and _DockerMachine_ support has
14-
been removed. This means that support for Windows and macOS is removed from 2.x.
14+
been removed. This means that support for Windows and macOS or the Docker Machine usage is removed from 2.x.
1515
We're in the process of evaluating whether to add such support to the 2.x stream again, or to adopt
1616
different solutions. In such a case we'd probably release a 1.x version, which would still support such components.
1717

docs/build-containers.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
== Building containers
22

3-
To build a container _Docker_ uses a file called `Dockerfile` http://docs.docker.com/reference/builder/.
3+
To build a container _Docker_ uses a file called `Dockerfile` https://docs.docker.com/reference/dockerfile/.
44
*Arquillian Cube* also supports building and running a container from a `Dockerfile`.
55

66
To set that *Arquillian Cube* must build the container, the `image` property must be changed to `buildImage` and add the location of `Dockerfile`.

docs/compose.adoc

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
[[docker-compose-format]]
22
== Docker-Compose Format
33

4-
Instead of using Arquillian Cube format, you can use Docker Compose format to define containers layout. This means that you can use the same Docker Compose file for running your tests with Arquillian Cube and without any change run `docker-compose up` command from terminal and get the same result.
4+
Instead of using Arquillian Cube format, you can use https://docs.docker.com/reference/compose-file/[Docker Compose V2 format]
5+
to define containers layout.
6+
This means that you can use the same Docker Compose file for running your tests with Arquillian Cube, and without any
7+
change run `docker-compose up` command from terminal and get the same result.
58

6-
It is important to note that this is not a docker-compose implementation but only the docker-compose format. This means that for example you cannot execute some CLI commands of _docker-compose_ like start several instances of same service.
9+
It is important to note that this is not a docker-compose implementation but only the docker-compose format.
10+
This means that for example you cannot execute some CLI commands of _docker-compose_, like to start several instances of same service.
711

8-
In case of some specific Arquillian Cube attributes like await strategy cannot be configured and the default values are going to be used.
12+
Another limitation is that some specific Arquillian Cube attributes, like await strategy, cannot be configured and the
13+
default values are used.
914

10-
Moreover, there are some docker-compose commands that are not implemented yet due to restrictions on docker-java library. These commands are _pid_, _log_driver_ and _security_opt_. But they will be implemented as soon as docker-java library adds their support.
15+
Moreover, there are some docker-compose commands that are not implemented yet due to restrictions on docker-java library.
16+
These commands are _pid_, _log_driver_ and _security_opt_.
17+
But they will be implemented as soon as docker-java library adds their support.
1118

12-
Last thing, in case you define a command that is not implemented in Arquillian Cube, this command will be ignored (no exception will be thrown), but a log line will be printed notifying this situation. Please it is really important that if this happens you open a bug so we can add support for them. Although this warning we will try to maintain aligned with the latest docker-compose format.
19+
Last thing, in case you define a command that is not implemented in Arquillian Cube, this command will be ignored
20+
(no exception will be thrown), but a log line will be printed notifying this situation.
21+
Please it is really important that if this happens you open a bug, so we can add support for them.
1322

1423
Let's see how you can rewrite previous HelloWorld example with Tomcat, using docker-compose format.
1524

@@ -95,4 +104,4 @@ For example in case of using Maven, your `pom.xml` should look like:
95104
Notice that you don't need to specify _definitionFormat_ since docker compose format is the default one.
96105

97106
And that's all, you can now reuse your existing docker-compose files in Arquillian Cube too.
98-
You can see the full example at: https://github.com/arquillian/arquillian-cube/tree/main/docker/ftest-docker-compose
107+
You can see the full example at: https://github.com/arquillian/arquillian-cube/tree/main/docker/ftest-docker-compose-v2

docs/configuration.adoc

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ The following table summarizes the attributes that are currently supported:
5050
|certPath
5151
|Path where certificates are stored. If you are not using _https_ protocol this parameter is not required. This parameter accepts starting with ~ as home directory.
5252

53-
|machineName
54-
|Sets the machine name in case you are using docker-machine to manage your docker host. This parameter is mandatory when using docker-machine with more than one running machine. In case of having only one docker machine running, it is not necessary to set it since it is auto resolved by cube.
55-
56-
|machineDriver
57-
|Sets the machine driver in case you are using _docker-machine_. This parameter is mandatory when docker-machine is not installed.
58-
59-
|dockerMachineCustomPath
60-
|Sets the custom location where _docker-machine_ will be downloaded. Default value: ~/.arquillian/machine.
61-
6253
|dockerInsideDockerResolution
6354
|Boolean to set if Cube should detect that tests are run inside an already started Docker container, so Docker containers started by Cube could be run using DinD (Docker Inside Docker) or DoD (docker On Docker). Basically it ignores any `SERVER_URI` properties and sets the `serverUri` to `unix:///var/run/docker.sock`. By default, its value is set to true. If you want to use an external dockerhost, then you need to set this property to false.
6455

@@ -91,9 +82,6 @@ as well.
9182

9283
|certPath
9384
|DOCKER_CERT_PATH
94-
95-
|machineName
96-
|DOCKER_MACHINE_NAME
9785
|===
9886

9987

@@ -183,7 +171,7 @@ tomcat: # <1>
183171
<9> You can extend another configuration. Any top level element and it's children from the target container-id will be copied over to this configuration, unless they have been defined here already.
184172
<10> You can use `manual` to indicate that this container is going to be started or in the test manually using `CubeController` or started by an extension. This attribute is ingorned in case of arquillian containers (none autostart containers) or in case of a linked container that comes from a none manual container.
185173
<11> Kills the container instead of stopping it normally. By default, it is set to false, so that containers are stopped.
186-
<12> Alternate hostname for use with the builtin DNS for https://docs.docker.com/engine/userguide/networking/#user-defined-networks[docker'suser defined networks].
174+
<12> Alternate hostname for use with the builtin DNS for https://docs.docker.com/engine/network/#user-defined-networks[docker'suser defined networks].
187175

188176
As we've seen in the basic example the definition of the Arquillian Cube scenarios are described in `dockerContainers` property.
189177
But if you want you can avoid using this property by simply creating a file called `cube` in the root of the classpath of your project.
@@ -520,7 +508,7 @@ STARTORCONNECTANDLEAVE:: it is exactly the same of _STARTORCONNECT_ but if conta
520508

521509
=== Before Stop Events
522510

523-
Sometimes when the tests has finished and container is stopped you want to inspect some data like container console or getting a file from the container to manual inspecting.
511+
Sometimes when the tests have finished and container is stopped you want to inspect some data like container console or getting a file from the container to manual inspecting.
524512
In these cases you can configure each container to copy console log or copy a file/s from container to local machine just before container is stopped.
525513
Or if your need is more specific, you can provide a custom implementation
526514

@@ -636,7 +624,4 @@ This parameter is not mandatory and in case you don't set it, _Arquillian Cube_
636624
|===
637625
|Linux
638626
|unix:///var/run/docker.sock
639-
640-
|Docker Machine
641-
|tcp://dockerHost:2376
642627
|===

docs/drone.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,9 @@ Configure the Cube extension:
8282
.arquillian.xml
8383
----
8484
<extension qualifier="docker">
85-
<property name="machineName">dev</property> <!--1-->
8685
<property name="dockerContainersFile">docker-compose.yml</property>
8786
</extension>
8887
----
89-
<1> In case of using more than one docker machine instance, you need to set it manually.
9088

9189
And finally among `cube` dependencies, add the `drone`, `selenium` and `cube-drone` dependencies.
9290

docs/enrichers.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ Suppose you have a _Docker Container_ configuration like:
307307
<1> Note that the exposed port is the 8081.
308308
309309
Then in theory you should configure the remote _Tomcat_ adapter to port 8081 on your _arquillian.xml_ file.
310-
But let's say that you are using that remote adapter for a remote local machine _Tomcat_ (outside _Docker_) too, and is configured to use 8080 port.
310+
But let's say that you are using that remote adapter for a remote local _Tomcat_ (outside _Docker_) too, and is configured to use 8080 port.
311311
312312
[source, xml]
313313
.arquillian.xml

docs/requirements.adoc

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ whether _just_ an environment variable or a system property ar set.
8080

8181
=== Example with OpenShift 4
8282

83-
The `openshift` module also defines an annotation for checking the environment against a given docker machine existence.
83+
The `openshift` module also defines an annotation for checking the environment against an OpenShift 4 cluster existence.
8484

8585
[source, java]
8686
----
@@ -131,14 +131,17 @@ And the implementation logic:
131131
public class DockerRequirement implements Requirement<RequiresDockerVersion> {
132132
133133
@Override
134-
public void check(RequiresDockerMachine context) throws UnsatisfiedRequirementException {
135-
String name = context.name();
136-
if (name != null && !name.isEmpty()) {
137-
String installedVersion = getDockerVersion();
138-
139-
if (!name.equals(installedVersion)) {
140-
throw new UnsatisfiedRequirementException("Docker version not specified."); // <1>
134+
public void check(RequiresDocker context) throws UnsatisfiedRequirementException {
135+
try {
136+
Map<String, String> config = resolver.resolve(new HashMap<String, String>());
137+
String serverUrl = config.get(CubeDockerConfiguration.DOCKER_URI);
138+
if (Strings.isNullOrEmpty(serverUrl)) {
139+
throw new UnsatisfiedRequirementException("Could not resolve the docker server url."); // <1>
140+
} else if (!isDockerRunning(serverUrl)) {
141+
throw new UnsatisfiedRequirementException("No server is running on url:[" + serverUrl + "].");
141142
}
143+
} catch (ExecutionException e) {
144+
throw new UnsatisfiedRequirementException("Cannot execute docker command.");
142145
}
143146
}
144147
}

docs/restassured.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ spec = new RequestSpecBuilder()
3737
Previous approach works but it has some problems:
3838

3939
* You need to repeat the same configuration properties in all tests you want to use Rest-Assured with Docker.
40-
* Requires some development interference of the developer, if it is running in docker machine needs to set one _ip_ which might change in the future, or if running on native linux must be changed to _localhost_.
40+
* Requires some development interference of the developer, if it is running in docker machine one _ip_ must be set which might change in the future,
41+
or changed to _localhost_ if running on native linux.
4142
* Any change on Rest-Assured configuration properties would make all tests fails.
4243

4344
To fix these problems, you can use Arquillian Cube Docker RestAssured integration which creates a `RequestSpecBuilder`

docs/what-is-this.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _Kubernetes_ and _OpenShift_ versions, but we had to take some decisions about d
2222
capacity reasons:
2323
2424
- *Arquillian Cube 2.0.0 does not support execution on _Windows_ and _macOS_ machines anymore*, since the *Boot2Docker*
25-
and *Docker machine* integrations have been removed, due to deprecation.
25+
integration has been removed, and it no longer supports *Docker Machine* integration, due to deprecation.
2626
2727
We're aware this might be an issue in some cases, and we're open to community discussion about any options that could
2828
help mitigate the consequences, like temporarily resuming the integration in a sustaining branch. Feel free to

0 commit comments

Comments
 (0)