Skip to content

Commit d519bf4

Browse files
authored
Fix CI and improve contribute instructions (#123)
* Fix db cleaner core version to match the other repo * Fix "uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger" error * Add CONTRIBUTE.md and docker-compose file with databases setup * Update changelog
1 parent 912acbe commit d519bf4

7 files changed

Lines changed: 57 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Development (unreleased)
22

3+
* Fix bundling and CONTRIBUTE.md instructions: https://github.com/DatabaseCleaner/database_cleaner-active_record/pull/123
4+
35
## v2.2.1 2025-05-13
46

57
* https://github.com/DatabaseCleaner/database_cleaner-active_record/pull/111 by @tagliala

CONTRIBUTE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Guidelines for contributing
2+
3+
## 1. Fork & Clone
4+
5+
Since you probably don't have rights to the main repo, you should Fork it (big
6+
button up top). After that, clone your fork locally and optionally add an
7+
upstream:
8+
9+
git remote add upstream git@github.com:DatabaseCleaner/database_cleaner-active_record.git
10+
11+
## 2. Make sure the tests run fine
12+
13+
The gem uses Appraisal to configure different Gemfiles to test different Rails versions.
14+
15+
- You can run all the databases through docker if needed with `docker compose up` (you can also have them running on your system, just comment out the ones you don't need from the `docker-compose.yml` file)
16+
- Copy `spec/support/sample.config.yml` to `spec/support/config.yml` and edit it
17+
- `BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle install` (change `6.1` with any version from the `gemfiles` directory)
18+
- `BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle exec rake`
19+
20+
Note that if you don't have all the supported databases installed and running,
21+
some tests will fail.
22+
23+
> Note that you can check the `.github/workflows/ci.yml` file for different combinations of Ruby and Rails that are expected to work
24+
25+
## 3. Prepare your contribution
26+
27+
This is all up to you but a few points should be kept in mind:
28+
29+
- Please write tests for your contribution
30+
- Make sure that previous tests still pass
31+
- Push it to a branch of your fork
32+
- Submit a pull request

database_cleaner-active_record.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
1818
spec.executables = []
1919
spec.require_paths = ["lib"]
2020

21-
spec.add_dependency "database_cleaner-core", "~>2.0.0"
21+
spec.add_dependency "database_cleaner-core", "~>2.1.0"
2222
spec.add_dependency "activerecord", ">= 5.a"
2323

2424
spec.add_development_dependency "bundler"

docker-compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
postgres:
3+
image: postgres:16 # specify the version needed for a given app
4+
environment:
5+
- POSTGRES_PASSWORD=postgres # this is required
6+
ports:
7+
- "127.0.0.1:5432:5432" # so we can use `localhost` as the host
8+
mysql:
9+
image: mysql:9.3
10+
environment:
11+
- MYSQL_ROOT_PASSWORD=mysql
12+
ports:
13+
- "127.0.0.1:3306:3306"
14+
redis:
15+
image: redis:6.2-alpine
16+
restart: always
17+
ports:
18+
- "127.0.0.1:6379:6379"
19+
command: redis-server --save 20 1 --loglevel warning

gemfiles/rails_6.1.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ source "https://rubygems.org"
55
gem "database_cleaner-core", git: "https://github.com/DatabaseCleaner/database_cleaner"
66
gem "rails", "~> 6.1.0"
77
gem "sqlite3", "~> 1.5"
8+
gem "concurrent-ruby", "1.3.4"
89

910
group :test do
1011
gem "simplecov", require: false

gemfiles/rails_7.0.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ source "https://rubygems.org"
55
gem "database_cleaner-core", git: "https://github.com/DatabaseCleaner/database_cleaner"
66
gem "rails", "~> 7.0.0"
77
gem "sqlite3", "~> 1.7"
8+
gem "concurrent-ruby", "1.3.4"
89

910
group :test do
1011
gem "simplecov", require: false

gemfiles/rails_7.2.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
source "https://rubygems.org"
44

55
gem "database_cleaner-core", git: "https://github.com/DatabaseCleaner/database_cleaner"
6-
gem "rails", "~> 7.2.0.beta2"
6+
gem "rails", "~> 7.2.0"
77

88
group :test do
99
gem "simplecov", require: false

0 commit comments

Comments
 (0)