Contributing
Contributions to Bifurcan are welcome! This guide provides instructions for setting up your development environment and running tests.
Development Environment Setup
Bifurcan is a Java library, but its build and test environment is managed using Leiningen, a build tool for Clojure.
- Install Java: Bifurcan requires an OpenJDK 8 compatible JDK. You can verify this in the
.travis.yml
file. - Install Leiningen: Follow the installation instructions on the official Leiningen website.
-
Clone the Repository:
git clone https://github.com/lacuna/bifurcan.git cd bifurcan
-
Install Dependencies: Leiningen will automatically fetch the required dependencies (defined in
project.clj
) the first time you run a task.
Running Tests
Bifurcan uses extensive generative tests to ensure the correctness of its complex data structures.
The primary command for running the test suite is defined as an alias in project.clj
:
lein partest
The .travis.yml
configuration shows the full command used in CI, which includes specific profiles:
lein with-profile low-mem,dev do clean, partest 1e4
Test Profiles
The project defines several test selectors in project.clj
to run different subsets of tests:
:default
: Runs standard tests, excluding benchmarks and stress tests.:benchmark
: Runs performance benchmarks.:stress
: Runs stress tests, which may take a long time.:focus
: Runs tests that are currently being focused on during development.:all
: Runs all tests.
To run a specific profile, you can use Leiningen's test selectors. For example, to run only the benchmark tests:
lein test :benchmark
Submitting Changes
- Create a new branch for your feature or bug fix.
- Make your changes. Ensure that all new and existing tests pass.
- Submit a pull request to the
master
branch of thelacuna/bifurcan
repository.