Skip to content

Commit 8a8a719

Browse files
Explain how to override local RABBITMQCTL location
(cherry picked from commit 067dd87)
1 parent c8682f5 commit 8a8a719

File tree

1 file changed

+47
-27
lines changed

1 file changed

+47
-27
lines changed

RUNNING_TESTS.md

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ and perform protocol encoder/decoder code generation.
1717

1818
On Windows run:
1919

20-
build.bat
20+
``` powershell
21+
build.bat
22+
```
2123

22-
On osx/linux run:
24+
On MacOS and linux run:
2325

24-
build.sh
26+
``` shell
27+
build.sh
28+
```
2529

2630
This will complete the code AMQP 0-9-1 protocol code generation and build all projects. After this open the solution in Visual Studio.
2731

@@ -34,40 +38,56 @@ may take some time for the adapter to discover tests in the assemblies.
3438
The test suite assumes there's a RabbitMQ node running locally with all
3539
defaults, and the tests will need to be able to run commands against the
3640
[`rabbitmqctl`](https://www.rabbitmq.com/rabbitmqctl.8.html) tool for that node.
37-
Two options to accomplish this are:
41+
Two options to accomplish this are covered below.
42+
43+
### Using RabbitMQ Umbrella Repository
3844

3945
1. Team RabbitMQ uses [rabbitmq-public-umbrella](https://github.com/rabbitmq/rabbitmq-public-umbrella), which sets up a local RabbitMQ server [built from source](https://www.rabbitmq.com/build-server.html):
40-
```
41-
git clone https://github.com/rabbitmq/rabbitmq-public-umbrella umbrella
42-
cd umbrella
43-
make co
44-
cd deps/rabbit
45-
make
46-
make run-broker
47-
```
4846

49-
2. You can load a RabbitMQ node in a [docker](https://www.docker.com/) container. You will need to create an environment variable `RABBITMQ_RABBITMQCTL_PATH` and set it to `DOCKER:<container_name>` (for example `DOCKER:rabbitmq01`). This tells the unit tests to run the `rabbitmqctl` commands through docker, in the format `docker exec rabbitmq01 rabbitmqctl <args>`:
50-
```
51-
docker run -d --hostname rabbitmq01 --name rabbitmq01 -p 15672:15672 -p 5672:5672 rabbitmq:3-management
52-
```
47+
```
48+
git clone https://github.com/rabbitmq/rabbitmq-public-umbrella umbrella
49+
cd umbrella
50+
make co
51+
cd deps/rabbit
52+
make
53+
make run-broker
54+
```
5355

54-
Then, to run the tests on Windows use:
56+
`rabbitmqctl` location will be computed using a relative path in the umbrella.
57+
It is possible to override the location using `RABBITMQ_RABBITMQCTL_PATH`:
5558

56-
```
57-
run-test.bat
58-
```
59+
```
60+
RABBITMQ_RABBITMQCTL_PATH=/path/to/rabbitmqctl dotnet test projects/Unit
61+
```
5962

60-
On MacOS, Linux, BSD use:
63+
### Using a Docker Container
6164

62-
```
63-
run-test.sh
64-
```
65+
It is also possible to run a RabbitMQ node in a [Docker](https://www.docker.com/) container. Set the environment variable `RABBITMQ_RABBITMQCTL_PATH` to `DOCKER:<container_name>` (for example `DOCKER:rabbitmq01`). This tells the unit tests to run the `rabbitmqctl` commands through Docker, in the format `docker exec rabbitmq01 rabbitmqctl <args>`:
6566

66-
Running individual tests and fixtures on Windows is trivial using the Visual Studio test runner.
67-
To run a specific tests fixture on MacOS or Linux, use the NUnit filter expressions to select the tests
68-
to be run:
67+
``` shell
68+
docker run -d --hostname rabbitmq01 --name rabbitmq01 -p 15672:15672 -p 5672:5672 rabbitmq:3-management
69+
```
6970

71+
### Running All Tests
72+
73+
Then, to run the tests use:
74+
75+
``` powershell
76+
run-test.bat
77+
```
78+
79+
On MacOS, Linux, BSD use:
80+
81+
``` shell
82+
run-test.sh
7083
```
84+
85+
### Running Individual Suites or Test Casess
86+
87+
Running individual tests and fixtures on Windows is trivial using the Visual Studio test runner.
88+
To run a specific tests fixture on MacOS or Linux, use the NUnit filter expressions to select the tests to be run:
89+
90+
``` shell
7191
dotnet test projects/Unit --filter "Name~TestAmqpUriParseFail"
7292

7393
dotnet test projects/Unit --filter "FullyQualifiedName~RabbitMQ.Client.Unit.TestHeartbeats"

0 commit comments

Comments
 (0)