summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Jankowski <matt@jankowski.online>2023-07-28 17:16:23 -0400
committerGitHub <noreply@github.com>2023-07-28 23:16:23 +0200
commit7581b1ff9664b90d1ba2cd75e7e332cc5bab4d36 (patch)
treecb13ba15aedc9e38f237261d2e39e68d923e385c
parent6f1fa1364f40e991389718823fb3bcb1da30bbf5 (diff)
Profiling tools configuration improvement (#25383)
-rw-r--r--Gemfile4
-rw-r--r--Gemfile.lock4
-rw-r--r--spec/fabricators/fabricators_spec.rb (renamed from spec/fabricators_spec.rb)0
-rw-r--r--spec/rails_helper.rb8
4 files changed, 16 insertions, 0 deletions
diff --git a/Gemfile b/Gemfile
index ff9a9cdb161..a9080060b96 100644
--- a/Gemfile
+++ b/Gemfile
@@ -177,10 +177,14 @@ group :development do
# Validate missing i18n keys
gem 'i18n-tasks', '~> 1.0', require: false
+end
+group :development, :test do
# Profiling tools
gem 'memory_profiler', require: false
+ gem 'ruby-prof', require: false
gem 'stackprof', require: false
+ gem 'test-prof'
end
group :production do
diff --git a/Gemfile.lock b/Gemfile.lock
index fda288c6f0d..151a3720178 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -644,6 +644,7 @@ GEM
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
+ ruby-prof (1.6.3)
ruby-progressbar (1.13.0)
ruby-saml (1.15.0)
nokogiri (>= 1.13.10)
@@ -718,6 +719,7 @@ GEM
unicode-display_width (>= 1.1.1, < 3)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
+ test-prof (1.2.1)
thor (1.2.2)
tilt (2.2.0)
timeout (0.4.0)
@@ -891,6 +893,7 @@ DEPENDENCIES
rubocop-performance
rubocop-rails
rubocop-rspec
+ ruby-prof
ruby-progressbar (~> 1.13)
rubyzip (~> 2.3)
sanitize (~> 6.0)
@@ -908,6 +911,7 @@ DEPENDENCIES
stackprof
stoplight (~> 3.0.1)
strong_migrations (~> 0.8)
+ test-prof
thor (~> 1.2)
tty-prompt (~> 0.23)
twitter-text (~> 3.1.0)
diff --git a/spec/fabricators_spec.rb b/spec/fabricators/fabricators_spec.rb
index 53193378c84..53193378c84 100644
--- a/spec/fabricators_spec.rb
+++ b/spec/fabricators/fabricators_spec.rb
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index 0f1073630d9..d4ff79c51c9 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -147,6 +147,14 @@ RSpec.configure do |config|
Rails.cache.clear
redis.del(redis.keys)
end
+
+ # Assign types based on dir name for non-inferred types
+ config.define_derived_metadata(file_path: %r{/spec/}) do |metadata|
+ unless metadata.key?(:type)
+ match = metadata[:location].match(%r{/spec/([^/]+)/})
+ metadata[:type] = match[1].singularize.to_sym
+ end
+ end
end
RSpec::Sidekiq.configure do |config|