Elffuss BraidHub

kikocis/java-driver public

33a7fd42cbad · 2.6 KiBRenderedRawPermalink
1# Contributing guidelines
2
3## Working on an issue
4
5Before starting to work on something, please comment in JIRA or ask on the mailing list
6to make sure nobody else is working on it.
7
8If your fix applies to multiple branches, base your work on the lowest active branch
9(2.1 at the time of writing, but ask for confirmation). We regularly merge changes downstream.
10
11Before you send your pull request, make sure that:
12
13- you have a unit test that failed before the fix and succeeds after.
14- the fix is mentioned in `changelog/README.md`.
15- the commit message includes the reference of the JIRA ticket for automatic linking
16 (example: `JAVA-503: Fix NPE when a connection fails during pool construction.`).
17
18As long as your pull request is not merged, it's OK to rebase your branch and push with
19`--force`.
20
21If you want to contribute but don't have a specific issue in mind, the [lhf](https://datastax-oss.atlassian.net/secure/IssueNavigator.jspa?reset=true&mode=hide&jqlQuery=project%20%3D%20JAVA%20AND%20status%20in%20(Open%2C%20Reopened)%20AND%20labels%20%3D%20lhf)
22label in JIRA is a good place to start: it marks "low hanging fruits" that don't require
23in-depth knowledge of the codebase.
24
25## Editor configuration
26
27We use IntelliJ IDEA with the default formatting options, with one exception: check
28"Enable formatter markers in comments" in Preferences > Editor > Code Style.
29
30Please format your code and organize imports before submitting your changes.
31
32## Running the tests
33
34We use TestNG. There are 3 test categories:
35
36- "unit": pure Java unit tests.
37- "short" and "long": integration tests that launch Cassandra instances.
38
39The Maven build uses profiles named after the categories to choose which tests to run:
40
41```
42mvn test -Pshort
43```
44
45The default is "unit". Each profile runs the ones before it ("short" runs unit, etc.)
46
47Integration tests use [CCM](https://github.com/pcmanus/ccm) to bootstrap Cassandra instances.
48Two Maven properties control its execution:
49
50- `cassandra.version`: the Cassandra version. This has a default value in the root POM,
51 you can override it on the command line (`-Dcassandra.version=...`).
52- `ipprefix`: the prefix of the IP addresses that the Cassandra instances will bind to (see
53 below). This defaults to `127.0.1.`.
54
55
56CCM launches multiple Cassandra instances on localhost by binding to different addresses. The
57driver uses up to 10 different instances (127.0.1.1 to 127.0.1.10 with the default prefix).
58You'll need to define loopback aliases for this to work, on Mac OS X your can do it with:
59
60```
61sudo ifconfig lo0 alias 127.0.1.1 up
62sudo ifconfig lo0 alias 127.0.1.2 up
63...
64```