Elffuss BraidHub

kikocis/java-driver public

3.1.x · 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(currently 3.0.x for bug fixes and 3.0 for new features, but ask for confirmation).
10We regularly merge changes to higher branches.
11
12Before you send your pull request, make sure that:
13
14- you have a unit test that failed before the fix and succeeds after.
15- the fix is mentioned in `changelog/README.md`.
16- the commit message include the reference of the JIRA ticket for automatic linking
17 (example: `JAVA-503: Fix NPE when a connection fails during pool construction.`).
18
19As long as your pull request is not merged, it's OK to rebase your branch and push with
20`--force`.
21
22If 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)
23label in JIRA is a good place to start: it marks "low hanging fruits" that don't require
24in-depth knowledge of the codebase.
25
26## Editor configuration
27
28We use IntelliJ IDEA with the default formatting options, with one exception: check
29"Enable formatter markers in comments" in Preferences > Editor > Code Style.
30
31Please format your code and organize imports before submitting your changes.
32
33## Running the tests
34
35We use TestNG. There are 3 test categories:
36
37- "unit": pure Java unit tests.
38- "short" and "long": integration tests that launch Cassandra instances.
39
40The Maven build uses profiles named after the categories to choose which tests to run:
41
42```
43mvn test -Pshort
44```
45
46The default is "unit". Each profile runs the ones before it ("short" runs unit, etc.)
47
48Integration tests use [CCM](https://github.com/pcmanus/ccm) to bootstrap Cassandra instances.
49Two Maven properties control its execution:
50
51- `cassandra.version`: the Cassandra version. This has a default value in the root POM,
52 you can override it on the command line (`-Dcassandra.version=...`).
53- `ipprefix`: the prefix of the IP addresses that the Cassandra instances will bind to (see
54 below). This defaults to `127.0.1.`.
55
56
57CCM launches multiple Cassandra instances on localhost by binding to different addresses. The
58driver uses up to 10 different instances (127.0.1.1 to 127.0.1.10 with the default prefix).
59You'll need to define loopback aliases for this to work, on Mac OS X your can do it with:
60
61```
62sudo ifconfig lo0 alias 127.0.1.1 up
63sudo ifconfig lo0 alias 127.0.1.2 up
64...
65```