Since you probably don't have rights to the main repo, you should Fork it (big button up top). After that, clone your fork locally and optionally add an upstream:
git remote add upstream git@github.com:DatabaseCleaner/database_cleaner-active_record.git
The gem uses Appraisal to configure different Gemfiles to test different Rails versions.
- You can run all the databases through docker if needed with
docker compose -f docker-compose.db.yml up(you can also have them running on your system, just comment out the ones you don't need from thedocker-compose.db.ymlfile) - Copy
spec/support/sample.config.ymltospec/support/config.ymland edit it as needed BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle install(change6.1with any version from thegemfilesdirectory)BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle exec rake
Note that if you don't have all the supported databases installed and running, some tests will fail.
Check the
.github/workflows/ci.ymlfile for different combinations of Ruby and Rails that are expected to work
- Open
docker-compose.ymland configure the Ruby version and Gemfile file to use - Copy
spec/support/sample.docker.config.ymltospec/support/config.yml(not this config file is specific for the Docker setup) - Run
docker compose upto start the container, run the tests, and exit - Run
docker compose run ruby bashto openbashinside the container for more control, runraketo run the tests
Note that the code is mounted inside the docker container, so changes in the container will reflect in the code. There's no need to re-build the container for code changes, but changing the Ruby version or Gemfile in the docker-compose.yml will require a container re-build with
docker compose build --no-cache
Check the
.github/workflows/ci.ymlfile for different combinations of Ruby and Rails that are expected to work
This is all up to you but a few points should be kept in mind:
- Please write tests for your contribution
- Make sure that previous tests still pass
- Push it to a branch of your fork
- Submit a pull request