• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

codebar / planner / 24966061628

26 Apr 2026 08:16PM UTC coverage: 95.058% (-0.4%) from 95.443%
24966061628

Pull #2596

github

web-flow
Merge 105c8567d into fd1a03b79
Pull Request #2596: Speed up test execution via fabricator optimizations

9 of 20 new or added lines in 3 files covered. (45.0%)

4 existing lines in 1 file now uncovered.

3520 of 3703 relevant lines covered (95.06%)

39.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

31.25
/lib/tasks/test_unlogged.rake
1
namespace :db do
6✔
2
  namespace :test do
6✔
3
    desc "Convert all tables to UNLOGGED for faster test performance"
6✔
4
    task unlogged: :environment do
6✔
NEW
5
      raise "This task only works in test environment" unless Rails.env.test?
×
6

NEW
7
      tables = ActiveRecord::Base.connection.tables
×
NEW
8
      converted = 0
×
NEW
9
      tables.each do |table|
×
NEW
10
        next if table == "schema_migrations" || table == "ar_internal_metadata"
×
NEW
11
        result = ActiveRecord::Base.connection.execute(
×
12
          "SELECT relpersistence FROM pg_class WHERE relname = '#{table}'"
13
        )
NEW
14
        if result.first && result.first["relpersistence"] != "u"
×
NEW
15
          ActiveRecord::Base.connection.execute("ALTER TABLE #{table} SET UNLOGGED")
×
NEW
16
          converted += 1
×
17
        end
18
      end
NEW
19
      puts "Converted #{converted} tables to UNLOGGED" if converted > 0
×
20
    end
21
  end
22
end
23

24
# Auto-run after db:test:prepare
25
Rake::Task["db:test:prepare"].enhance do
6✔
NEW
26
  Rake::Task["db:test:unlogged"].invoke if Rails.env.test?
×
27
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc