mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Added pull request #151 by @21croissants.
This commit is contained in:
parent
01097f9112
commit
6a9d123698
1 changed files with 13 additions and 2 deletions
|
@ -359,12 +359,23 @@ DatabaseCleaner[:mongoid].strategy = :truncation
|
|||
|
||||
### STDERR is being flooded when using Postgres
|
||||
|
||||
If you are using Postgres and have foreign key constraints, the truncation strategy will cause a lot of extra noise to appear on STDERR (in the form of "NOTICE truncate cascades" messages). To silence these warnings set the following log level in your `postgresql.conf` file:
|
||||
If you are using Postgres and have foreign key constraints, the truncation strategy will cause a lot of extra noise to appear on STDERR (in the form of "NOTICE truncate cascades" messages).
|
||||
|
||||
To silence these warnings set the following log level in your `postgresql.conf` file:
|
||||
|
||||
```ruby
|
||||
client_min_messages = warning
|
||||
```
|
||||
|
||||
For ActiveRecord, you add the following parameter in your database.yml file:
|
||||
|
||||
<pre>
|
||||
test:
|
||||
adapter: postgresql
|
||||
# ...
|
||||
min_messages: WARNING
|
||||
</pre>
|
||||
|
||||
### Nothing happens in JRuby with Sequel using transactions
|
||||
|
||||
Due to an inconsistency in JRuby's implementation of Fibers, Sequel gives a different connection to `DatabaseCleaner.start` than is used for tests run between `.start` and `.clean`. This can be worked around by running your tests in a block like `DatabaseCleaner.cleaning { run_my_tests }` instead, which does not use Fibers.
|
||||
|
|
Loading…
Reference in a new issue