Skip to content

Commit 516f7a3

Browse files
committed
Update documentation to run tests
[#157080754] Fixes rabbitmq#359 (cherry picked from commit bb88600)
1 parent dc3ebe1 commit 516f7a3

File tree

2 files changed

+52
-35
lines changed

2 files changed

+52
-35
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ MVN_FLAGS += -Ddeps.dir="$(abspath $(DEPS_DIR))"
1616
all: deps
1717
$(MVN) $(MVN_FLAGS) compile
1818

19-
deps: $(DEPS_DIR)/rabbit
19+
deps: $(DEPS_DIR)/rabbit $(DEPS_DIR)/rabbitmq-ct-helpers
2020
@:
2121

2222
dist: clean
@@ -26,6 +26,10 @@ $(DEPS_DIR)/rabbit:
2626
git clone https://github.com/rabbitmq/rabbitmq-server.git $@
2727
$(MAKE) -C $@ fetch-deps DEPS_DIR="$(abspath $(DEPS_DIR))"
2828

29+
$(DEPS_DIR)/rabbitmq-ct-helpers:
30+
rm -rf $(DEPS_DIR)/rabbitmq_ct_helpers
31+
git clone https://github.com/rabbitmq/rabbitmq-ct-helpers.git $(DEPS_DIR)/rabbitmq_ct_helpers
32+
2933
tests: deps
3034
$(MVN) $(MVN_FLAGS) verify
3135

RUNNING_TESTS.md

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ SSL port. HA tests expect a second node listening on localhost:5673.
1919
Connection recovery tests need `rabbitmqctl` to control the running nodes.
2020
can control the running node.
2121

22-
`mvn verify` will start those nodes with the appropriate configuration.
22+
`./mvnw verify` will start those nodes with the appropriate configuration.
2323

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

27+
You then run Maven with the `deps.dir` property set like this:
2828
```
29-
deps
30-
|-- rabbitmq_codegen
31-
`-- rabbit
29+
./mvnw -Ddeps.dir=$(pwd)/deps verify
3230
```
3331

34-
You then run Maven with the `deps.dir` property set like this:
32+
The previous command launches tests against the blocking IO connector. If you want
33+
to run the tests against the NIO connector, add `-P use-nio` to the command line:
34+
3535
```
36-
mvn -Ddeps.dir=/path/to/deps verify
36+
./mvnw -Ddeps.dir=$(pwd)/deps verify -P use-nio
3737
```
3838

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

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

5353
* To run the functional tests:
5454

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

5959
* To run a single test:
6060

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

6565
For example, to run the client tests:
6666

6767
```
68-
rabbitmq-java-client$ mvn -Ddeps.dir=/path/to/deps verify -Dit.test=ClientTests
68+
rabbitmq-java-client$ ./mvnw -Ddeps.dir=$(pwd)/deps verify -Dit.test=ClientTests
6969
[INFO] Scanning for projects...
70-
[INFO] Inspecting build with total of 1 modules...
71-
[INFO] Installing Nexus Staging features:
72-
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
7370
[INFO]
7471
[INFO] ------------------------------------------------------------------------
75-
[INFO] Building RabbitMQ Java Client 3.7.0-SNAPSHOT
72+
[INFO] Building RabbitMQ Java Client 5.3.0-SNAPSHOT
7673
[INFO] ------------------------------------------------------------------------
7774
[INFO]
7875
[INFO] --- groovy-maven-plugin:2.0:execute (generate-amqp-sources) @ amqp-client ---
7976
[INFO]
8077
[INFO] --- build-helper-maven-plugin:1.12:add-source (add-generated-sources-dir) @ amqp-client ---
81-
[INFO] Source directory: .../rabbitmq_java_client/target/generated-sources/src/main/java added.
78+
[INFO] Source directory: .../rabbitmq-java-client/target/generated-sources/src/main/java added.
8279
[INFO]
83-
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ amqp-client ---
84-
[debug] execute contextualize
80+
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ amqp-client ---
8581
[INFO] Using 'UTF-8' encoding to copy filtered resources.
86-
[INFO] Copying 1 resource
82+
[INFO] Copying 2 resources
8783
[INFO]
88-
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ amqp-client ---
84+
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ amqp-client ---
8985
[INFO] Nothing to compile - all classes are up to date
9086
[INFO]
87+
[INFO] --- maven-bundle-plugin:3.2.0:manifest (bundle-manifest) @ amqp-client ---
88+
[INFO]
9189
[INFO] --- groovy-maven-plugin:2.0:execute (remove-old-test-keystores) @ amqp-client ---
9290
[INFO]
9391
[INFO] --- groovy-maven-plugin:2.0:execute (query-test-tls-certs-dir) @ amqp-client ---
@@ -100,19 +98,31 @@ rabbitmq-java-client$ mvn -Ddeps.dir=/path/to/deps verify -Dit.test=ClientTests
10098
[INFO]
10199
[INFO] --- keytool-maven-plugin:1.5:deleteAlias (generate-test-empty-keystore) @ amqp-client ---
102100
[INFO]
103-
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ amqp-client ---
104-
[debug] execute contextualize
101+
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ amqp-client ---
105102
[INFO] Using 'UTF-8' encoding to copy filtered resources.
106-
[INFO] Copying 3 resources
103+
[INFO] Copying 5 resources
107104
[INFO]
108-
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ amqp-client ---
105+
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ amqp-client ---
109106
[INFO] Nothing to compile - all classes are up to date
110107
[INFO]
111108
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ amqp-client ---
112109
[INFO] Tests are skipped.
113110
[INFO]
114111
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ amqp-client ---
115-
[INFO] Building jar: .../rabbitmq_java_client/target/amqp-client-3.7.0-SNAPSHOT.jar
112+
[INFO] Building jar: .../rabbitmq-java-client/target/amqp-client-5.3.0-SNAPSHOT.jar
113+
[INFO]
114+
[INFO] >>> maven-source-plugin:3.0.1:jar (default) > generate-sources @ amqp-client >>>
115+
[INFO]
116+
[INFO] --- groovy-maven-plugin:2.0:execute (generate-amqp-sources) @ amqp-client ---
117+
[INFO]
118+
[INFO] --- build-helper-maven-plugin:1.12:add-source (add-generated-sources-dir) @ amqp-client ---
119+
[INFO] Source directory: .../rabbitmq-java-client/target/generated-sources/src/main/java added.
120+
[INFO]
121+
[INFO] <<< maven-source-plugin:3.0.1:jar (default) < generate-sources @ amqp-client <<<
122+
[INFO]
123+
[INFO]
124+
[INFO] --- maven-source-plugin:3.0.1:jar (default) @ amqp-client ---
125+
[INFO] Building jar: .../rabbitmq-java-client/target/amqp-client-5.3.0-SNAPSHOT-sources.jar
116126
[INFO]
117127
[INFO] --- groovy-maven-plugin:2.0:execute (start-test-broker-A) @ amqp-client ---
118128
[INFO]
@@ -123,14 +133,14 @@ rabbitmq-java-client$ mvn -Ddeps.dir=/path/to/deps verify -Dit.test=ClientTests
123133
[INFO] --- maven-failsafe-plugin:2.19.1:integration-test (integration-test) @ amqp-client ---
124134
125135
-------------------------------------------------------
126-
T E S T S
136+
T E S T S
127137
-------------------------------------------------------
128138
Running com.rabbitmq.client.test.ClientTests
129-
Tests run: 50, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.732 sec - in com.rabbitmq.client.test.ClientTests
139+
Tests run: 121, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 58.869 sec - in com.rabbitmq.client.test.ClientTests
130140
131141
Results :
132142
133-
Tests run: 50, Failures: 0, Errors: 0, Skipped: 0
143+
Tests run: 121, Failures: 0, Errors: 0, Skipped: 0
134144
135145
[INFO]
136146
[INFO] --- groovy-maven-plugin:2.0:execute (stop-test-broker-B) @ amqp-client ---
@@ -141,9 +151,9 @@ Tests run: 50, Failures: 0, Errors: 0, Skipped: 0
141151
[INFO] ------------------------------------------------------------------------
142152
[INFO] BUILD SUCCESS
143153
[INFO] ------------------------------------------------------------------------
144-
[INFO] Total time: 33.707s
145-
[INFO] Finished at: Mon Aug 08 16:22:26 CEST 2016
146-
[INFO] Final Memory: 21M/256M
154+
[INFO] Total time: 01:31 min
155+
[INFO] Finished at: 2018-04-25T11:33:54+02:00
156+
[INFO] Final Memory: 26M/336M
147157
[INFO] ------------------------------------------------------------------------
148158
```
149159

@@ -163,3 +173,6 @@ profile:
163173
```
164174
mvn verify -P '!setup-test-cluster'
165175
```
176+
177+
Note that by doing so some tests will fail as they require `rabbitmqctl` to
178+
control the running nodes.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy