Facilitate profiling of tests (#1611)

Allow for optional installation of test profilers to help development
identify slow areas needing additional work.
This commit is contained in:
Darragh Bailey 2022-09-28 19:23:25 +01:00 committed by GitHub
parent 6f2674eec6
commit 0af8931c36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -45,3 +45,9 @@ end
group :plugins do
gemspec
end
group :test do
gem "test-prof", require: false
gem "ruby-prof", ">= 0.17.0", require: false
gem 'stackprof', '>= 0.2.9', require: false
end

View File

@ -63,10 +63,19 @@ RSpec.configure do |config|
# don't run acceptance tests by default
config.filter_run_excluding :acceptance => true
end
config.expect_with :rspec do |c|
c.max_formatted_output_length = 2000 if c.respond_to?("max_formatted_output_length=")
begin
require 'test-prof'
TestProf.configure do |config|
# use unique filenames for reports (by simply appending current timestamp)
config.timestamps = true
# color output
config.color = true
end
rescue LoadError
end
require 'vagrant-spec/unit'