Commit 5b1be68d authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'alberts-knapsack-1.21.1' into 'master'

Update knapsack 1.21.1

See merge request gitlab-org/gitlab!59602
parents 84bc4a7e 278429ed
...@@ -383,7 +383,7 @@ group :development, :test do ...@@ -383,7 +383,7 @@ group :development, :test do
gem 'benchmark-ips', '~> 2.3.0', require: false gem 'benchmark-ips', '~> 2.3.0', require: false
gem 'knapsack', '~> 1.17' gem 'knapsack', '~> 1.21.1'
gem 'crystalball', '~> 0.7.0', require: false gem 'crystalball', '~> 0.7.0', require: false
gem 'simple_po_parser', '~> 1.1.2', require: false gem 'simple_po_parser', '~> 1.1.2', require: false
......
...@@ -672,7 +672,7 @@ GEM ...@@ -672,7 +672,7 @@ GEM
kaminari-core (= 1.2.1) kaminari-core (= 1.2.1)
kaminari-core (1.2.1) kaminari-core (1.2.1)
kgio (2.11.3) kgio (2.11.3)
knapsack (1.17.0) knapsack (1.21.1)
rake rake
kramdown (2.3.1) kramdown (2.3.1)
rexml rexml
...@@ -1476,7 +1476,7 @@ DEPENDENCIES ...@@ -1476,7 +1476,7 @@ DEPENDENCIES
json_schemer (~> 0.2.12) json_schemer (~> 0.2.12)
jwt (~> 2.1.0) jwt (~> 2.1.0)
kaminari (~> 1.0) kaminari (~> 1.0)
knapsack (~> 1.17) knapsack (~> 1.21.1)
kramdown (~> 2.3.1) kramdown (~> 2.3.1)
kubeclient (~> 4.9.1) kubeclient (~> 4.9.1)
lefthook (~> 0.7.0) lefthook (~> 0.7.0)
......
...@@ -3,44 +3,9 @@ ...@@ -3,44 +3,9 @@
require 'knapsack' require 'knapsack'
module KnapsackEnv module KnapsackEnv
class RSpecContextAdapter < Knapsack::Adapters::RSpecAdapter
def bind_time_tracker
::RSpec.configure do |config|
# Original version starts timer in `config.prepend_before(:each) do`
# https://github.com/KnapsackPro/knapsack/blob/v1.17.0/lib/knapsack/adapters/rspec_adapter.rb#L9
config.prepend_before(:context) do
Knapsack.tracker.start_timer
end
# Original version is `config.prepend_before(:each) do`
# https://github.com/KnapsackPro/knapsack/blob/v1.17.0/lib/knapsack/adapters/rspec_adapter.rb#L9
config.prepend_before(:each) do # rubocop:disable RSpec/HookArgument
current_example_group =
if ::RSpec.respond_to?(:current_example)
::RSpec.current_example.metadata[:example_group]
else
example.metadata
end
Knapsack.tracker.test_path = Knapsack::Adapters::RSpecAdapter.test_path(current_example_group)
end
# Original version stops timer in `config.append_after(:each) do`
# https://github.com/KnapsackPro/knapsack/blob/v1.17.0/lib/knapsack/adapters/rspec_adapter.rb#L20
config.append_after(:context) do
Knapsack.tracker.stop_timer
end
config.after(:suite) do
Knapsack.logger.info(Knapsack::Presenter.global_time)
end
end
end
end
def self.configure! def self.configure!
return unless ENV['CI'] && ENV['KNAPSACK_GENERATE_REPORT'] && !ENV['NO_KNAPSACK'] return unless ENV['CI'] && ENV['KNAPSACK_GENERATE_REPORT'] && !ENV['NO_KNAPSACK']
RSpecContextAdapter.bind Knapsack::Adapters::RSpecAdapter.bind
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment