Skip to content

Commit 15a58dd

Browse files
Update CONTRIBUTING.md with recent changes
1 parent 6e87f97 commit 15a58dd

File tree

1 file changed

+94
-16
lines changed

1 file changed

+94
-16
lines changed

CONTRIBUTING.md

Lines changed: 94 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,85 @@
1-
##
1+
# Contributing
22

3+
## Development Workflow
4+
5+
This project uses the most basic development workflow possible:
6+
7+
* Identify a problem
8+
* Add a failing test or any other way to reproduce it
9+
* Fix it
10+
* Make sure all tests pass
11+
* Submit a pull request on GitHub explaining **why** the change it necessary
12+
and how to reproduce it
13+
* Wait for maintainer's feedback
14+
15+
That's about it.
316

417
## Running Tests
518

6-
First, run Carthage bootstrap:
19+
### Building Dependencies
20+
21+
Carthage bootstrap will clone and build the dependencies:
722

823
```
924
gmake bootstrap
1025
```
1126

12-
Then start a local RabbitMQ node (any way you please, doesn't have to be from Homebrew or source),
13-
configure it using files under `.travis/etc/` and enable the
14-
[x509 certificate authentication mechanism](https://github.com/rabbitmq/rabbitmq-auth-mechanism-ssl):
27+
### Run a Local RabbitMQ Node
28+
29+
There are two sets of tests that can be executed, each with its own
30+
XCode scheme:
31+
32+
* Unit and integration tests (core tests) use the `RMQClient` scheme
33+
and can be executed against a RabbitMQ node with stock defaults
34+
(assuming that certain setup targets are executed, see below)
35+
* TLS tests use the `RMQClient with TLS tests` scheme and requires
36+
a RabbitMQ node configured in a particular way
37+
38+
The RabbitMQ node can be installed from Homebrew or by downloading
39+
and extracting a [generic binary build](https://www.rabbitmq.com/install-generic-unix.html).
40+
41+
### Node Configuration for TLS Tests
1542

16-
brew install rabbitmq
17-
cp .travis/etc/* /path/to/etc/rabbitmq/
18-
rabbitmq-plugins enable rabbitmq_auth_mechanism_ssl
43+
To configure a node to run the TLS tests, configure the node to use the [certificates and keys](https://www.rabbitmq.com/ssl.html#certificates-and-keys)
44+
under `TestCertificates`. The certificates have a Subject Alternative Name of `localhost`
45+
which makes them not to be dependent on the host they were generated on.
46+
47+
The following minimalistic [RabbitMQ configuration file](https://www.rabbitmq.com/configure.html#configuration-files) is used by CI:
48+
49+
``` ini
50+
listeners.tcp.1 = 0.0.0.0:5672
51+
listeners.tcp.2 = 0.0.0.0:5674
52+
53+
54+
listeners.ssl.default = 5671
55+
56+
ssl_options.cacertfile = /usr/local/etc/rabbitmq/ca_certificate.pem
57+
ssl_options.certfile = /usr/local/etc/rabbitmq/server_certificate.pem
58+
ssl_options.keyfile = /usr/local/etc/rabbitmq/server_key.pem
59+
ssl_options.verify = verify_peer
60+
ssl_options.fail_if_no_peer_cert = false
61+
62+
63+
auth_mechanisms.1 = PLAIN
64+
auth_mechanisms.2 = AMQPLAIN
65+
auth_mechanisms.3 = EXTERNAL
66+
```
67+
68+
The test suite also requires the [x509 certificate authentication mechanism](https://github.com/rabbitmq/rabbitmq-auth-mechanism-ssl)
69+
plugin to be enabled:
70+
71+
``` shell
72+
brew install rabbitmq
73+
cp TestCertificates/* /path/to/rabbitmq/installation/etc/rabbitmq/
74+
rabbitmq-plugins enable rabbitmq_auth_mechanism_ssl --offline
75+
```
1976

2077
Then restart RabbitMQ.
2178

22-
Now what's left is running a few setup steps:
79+
### Node Preconfiguration
80+
81+
To seed the node (pre-create certain [virtual hosts](https://www.rabbitmq.com/vhosts.html), users,
82+
[permissions](https://www.rabbitmq.com/access-control.html)):
2383

2484
```
2585
# use RABBITMQCTL="/path/to/rabbitmqctl"
@@ -34,29 +94,47 @@ gmake set_up_test_users RABBITMQCTL="/path/to/rabbitmqctl"
3494
gmake before_build RABBITMQCTL="/path/to/rabbitmqctl" RABBITMQ_PLUGINS="/path/to/rabbitmq-plugins"
3595
```
3696

37-
Finally, to run the tests:
97+
### Test Targets
98+
99+
To run the core test suite:
100+
38101

102+
``` shell
103+
# runs all tests with iOS and MacOS destinations
104+
gmake tests
39105

40-
``` bash
41-
# for iOS
106+
# iOS only
42107
gmake tests_ios iOS_VERSION=12.1
43108

44-
# for macOS
109+
# MacOS only
45110
gmake tests_macos
111+
46112
```
47113

48-
## SwiftLint
114+
or run the tests using the `RMQClient` scheme from XCode.
115+
116+
To run the TLS test suite:
117+
118+
119+
``` shell
120+
# see the
121+
gmake tests_with_tls
122+
```
123+
124+
or run the tests using the `RMQClient with TLS tests` scheme in XCode.
125+
126+
## Linting with SwiftLint
49127

50128
The test suite uses [SwiftLint](https://github.com/realm/SwiftLint) as a build phase.
51129
It must be installed in order for XCode to use it:
52130

53-
``` bash
131+
``` shell
54132
brew install swiftlint
55133
```
56134

57135
In order to lint from the command line, use
58136

59-
``` bash
137+
``` shell
60138
swiftlint
61139
```
62140

0 commit comments

Comments
 (0)