Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MVN_FLAGS += -Ddeps.dir="$(abspath $(DEPS_DIR))"
all: deps
$(MVN) $(MVN_FLAGS) compile

deps: $(DEPS_DIR)/rabbit
deps: $(DEPS_DIR)/rabbit $(DEPS_DIR)/rabbitmq_ct_helpers
@:

dist: clean
Expand All @@ -26,6 +26,9 @@ $(DEPS_DIR)/rabbit:
git clone https://github.com/rabbitmq/rabbitmq-server.git $@
$(MAKE) -C $@ fetch-deps DEPS_DIR="$(abspath $(DEPS_DIR))"

$(DEPS_DIR)/rabbitmq_ct_helpers:
git clone https://github.com/rabbitmq/rabbitmq-ct-helpers.git $(DEPS_DIR)/rabbitmq_ct_helpers

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the $@ Make variable to reduce repetition:

git clone https://github.com/rabbitmq/rabbitmq-ct-helpers.git "$@"

(plus the quotes to protect against spaces)

tests: deps
$(MVN) $(MVN_FLAGS) verify

Expand Down
81 changes: 47 additions & 34 deletions RUNNING_TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ SSL port. HA tests expect a second node listening on localhost:5673.
Connection recovery tests need `rabbitmqctl` to control the running nodes.
can control the running node.

`mvn verify` will start those nodes with the appropriate configuration.
`./mvnw verify` will start those nodes with the appropriate configuration.

To easily fullfil all those requirements, you can use `make deps` to
fetch the dependencies. You can also fetch them yourself and use the
same layout:
To easily fullfil all those requirements, you should use `make deps` to
fetch the dependencies in the `deps` directory.

You then run Maven with the `deps.dir` property set like this:
```
deps
|-- rabbitmq_codegen
`-- rabbit
./mvnw -Ddeps.dir=$(pwd)/deps verify
```

You then run Maven with the `deps.dir` property set like this:
The previous command launches tests against the blocking IO connector. If you want
to run the tests against the NIO connector, add `-P use-nio` to the command line:

```
mvn -Ddeps.dir=/path/to/deps verify
./mvnw -Ddeps.dir=$(pwd)/deps verify -P use-nio
```

For details on running specific tests, see below.
Expand All @@ -47,47 +47,45 @@ top-level directory of the source tree:
* To run the client unit tests:

```
mvn -Ddeps.dir=/path/to/deps verify -Dit.test=ClientTests
./mvnw -Ddeps.dir=$(pwd)/deps verify -Dit.test=ClientTests
```

* To run the functional tests:

```
mvn -Ddeps.dir=/path/to/deps verify -Dit.test=FunctionalTests
./mvnw -Ddeps.dir=$(pwd)/deps verify -Dit.test=FunctionalTests
```

* To run a single test:

```
mvn -Ddeps.dir=/path/to/deps verify -Dit.test=DeadLetterExchange
```
./mvnw -Ddeps.dir=$(pwd)/deps/deps verify -Dit.test=DeadLetterExchange
```

For example, to run the client tests:

```
rabbitmq-java-client$ mvn -Ddeps.dir=/path/to/deps verify -Dit.test=ClientTests
rabbitmq-java-client$ ./mvnw -Ddeps.dir=$(pwd)/deps verify -Dit.test=ClientTests
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building RabbitMQ Java Client 3.7.0-SNAPSHOT
[INFO] Building RabbitMQ Java Client 5.3.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- groovy-maven-plugin:2.0:execute (generate-amqp-sources) @ amqp-client ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.12:add-source (add-generated-sources-dir) @ amqp-client ---
[INFO] Source directory: .../rabbitmq_java_client/target/generated-sources/src/main/java added.
[INFO] Source directory: .../rabbitmq-java-client/target/generated-sources/src/main/java added.
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ amqp-client ---
[debug] execute contextualize
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ amqp-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ amqp-client ---
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ amqp-client ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-bundle-plugin:3.2.0:manifest (bundle-manifest) @ amqp-client ---
[INFO]
[INFO] --- groovy-maven-plugin:2.0:execute (remove-old-test-keystores) @ amqp-client ---
[INFO]
[INFO] --- groovy-maven-plugin:2.0:execute (query-test-tls-certs-dir) @ amqp-client ---
Expand All @@ -100,19 +98,31 @@ rabbitmq-java-client$ mvn -Ddeps.dir=/path/to/deps verify -Dit.test=ClientTests
[INFO]
[INFO] --- keytool-maven-plugin:1.5:deleteAlias (generate-test-empty-keystore) @ amqp-client ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ amqp-client ---
[debug] execute contextualize
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ amqp-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ amqp-client ---
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ amqp-client ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ amqp-client ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ amqp-client ---
[INFO] Building jar: .../rabbitmq_java_client/target/amqp-client-3.7.0-SNAPSHOT.jar
[INFO] Building jar: .../rabbitmq-java-client/target/amqp-client-5.3.0-SNAPSHOT.jar
[INFO]
[INFO] >>> maven-source-plugin:3.0.1:jar (default) > generate-sources @ amqp-client >>>
[INFO]
[INFO] --- groovy-maven-plugin:2.0:execute (generate-amqp-sources) @ amqp-client ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.12:add-source (add-generated-sources-dir) @ amqp-client ---
[INFO] Source directory: .../rabbitmq-java-client/target/generated-sources/src/main/java added.
[INFO]
[INFO] <<< maven-source-plugin:3.0.1:jar (default) < generate-sources @ amqp-client <<<
[INFO]
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar (default) @ amqp-client ---
[INFO] Building jar: .../rabbitmq-java-client/target/amqp-client-5.3.0-SNAPSHOT-sources.jar
[INFO]
[INFO] --- groovy-maven-plugin:2.0:execute (start-test-broker-A) @ amqp-client ---
[INFO]
Expand All @@ -123,14 +133,14 @@ rabbitmq-java-client$ mvn -Ddeps.dir=/path/to/deps verify -Dit.test=ClientTests
[INFO] --- maven-failsafe-plugin:2.19.1:integration-test (integration-test) @ amqp-client ---

-------------------------------------------------------
T E S T S
T E S T S
-------------------------------------------------------
Running com.rabbitmq.client.test.ClientTests
Tests run: 50, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.732 sec - in com.rabbitmq.client.test.ClientTests
Tests run: 121, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 58.869 sec - in com.rabbitmq.client.test.ClientTests

Results :

Tests run: 50, Failures: 0, Errors: 0, Skipped: 0
Tests run: 121, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- groovy-maven-plugin:2.0:execute (stop-test-broker-B) @ amqp-client ---
Expand All @@ -141,9 +151,9 @@ Tests run: 50, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.707s
[INFO] Finished at: Mon Aug 08 16:22:26 CEST 2016
[INFO] Final Memory: 21M/256M
[INFO] Total time: 01:31 min
[INFO] Finished at: 2018-04-25T11:33:54+02:00
[INFO] Final Memory: 26M/336M
[INFO] ------------------------------------------------------------------------
```

Expand All @@ -163,3 +173,6 @@ profile:
```
mvn verify -P '!setup-test-cluster'
```

Note that by doing so some tests will fail as they require `rabbitmqctl` to
control the running nodes.