performance/cache_runner.rb in identity_cache-1.1.0 vs performance/cache_runner.rb in identity_cache-1.2.0

- old
+ new

@@ -1,17 +1,18 @@ # frozen_string_literal: true + $LOAD_PATH.unshift(File.expand_path("../../lib", __FILE__)) -require 'active_record' -require 'active_support/core_ext' -require 'active_support/cache' -require 'identity_cache' -require 'memcached_store' -require 'active_support/cache/memcached_store' +require "active_record" +require "active_support/core_ext" +require "active_support/cache" +require "identity_cache" +require "memcached_store" +require "active_support/cache/memcached_store" -require File.dirname(__FILE__) + '/../test/helpers/active_record_objects' -require File.dirname(__FILE__) + '/../test/helpers/database_connection' -require File.dirname(__FILE__) + '/../test/helpers/cache_connection' +require File.dirname(__FILE__) + "/../test/helpers/active_record_objects" +require File.dirname(__FILE__) + "/../test/helpers/database_connection" +require File.dirname(__FILE__) + "/../test/helpers/cache_connection" IdentityCache.logger = Logger.new(nil) CacheConnection.setup def create_record(id) @@ -29,16 +30,18 @@ helper = Object.new.extend(ActiveRecordObjects) helper.setup_models return if database_ready(count) + puts "Database not ready for performance testing, generating records" DatabaseConnection.drop_tables DatabaseConnection.create_tables existing = Item.all (1..count).to_a.each do |i| next if existing.any? { |e| e.id == i } + a = Item.new a.id = i a.associated = AssociatedRecord.new(name: "Associated for #{i}") a.associated_records (1..5).each do |j|