diff options
Diffstat (limited to 'tooling/rspec_flaky/flaky_example.rb')
-rw-r--r-- | tooling/rspec_flaky/flaky_example.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tooling/rspec_flaky/flaky_example.rb b/tooling/rspec_flaky/flaky_example.rb index 299fcb567fc..3ce48ce1cd3 100644 --- a/tooling/rspec_flaky/flaky_example.rb +++ b/tooling/rspec_flaky/flaky_example.rb @@ -13,6 +13,7 @@ module RspecFlaky last_flaky_job last_attempts_count flaky_reports + feature_category ].freeze # This represents a flaky RSpec example and is mainly meant to be saved in a JSON file @@ -23,7 +24,8 @@ module RspecFlaky last_flaky_at: Time.now, last_flaky_job: nil, last_attempts_count: example_hash[:attempts], - flaky_reports: 0 + flaky_reports: 0, + feature_category: example_hash[:feature_category] }.merge(example_hash.slice(*ALLOWED_ATTRIBUTES)) %i[first_flaky_at last_flaky_at].each do |attr| @@ -31,11 +33,15 @@ module RspecFlaky end end - def update_flakiness!(last_attempts_count: nil) + def update!(example_hash) + attributes[:file] = example_hash[:file] + attributes[:line] = example_hash[:line] + attributes[:description] = example_hash[:description] attributes[:first_flaky_at] ||= Time.now attributes[:last_flaky_at] = Time.now attributes[:flaky_reports] += 1 - attributes[:last_attempts_count] = last_attempts_count if last_attempts_count + attributes[:feature_category] = example_hash[:feature_category] + attributes[:last_attempts_count] = example_hash[:last_attempts_count] if example_hash[:last_attempts_count] if ENV['CI_JOB_URL'] attributes[:last_flaky_job] = "#{ENV['CI_JOB_URL']}" |