diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-10 15:08:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-10 15:08:00 +0000 |
commit | 609943de5e2ee6c3bf0f09d3fb1d5fc38ed5a4ed (patch) | |
tree | d6c366584972d84f9171881fa5977e59b123bff6 /tooling | |
parent | be2696666feee6e1045e0991309b71ce7f38a413 (diff) | |
download | gitlab-ce-609943de5e2ee6c3bf0f09d3fb1d5fc38ed5a4ed.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'tooling')
-rw-r--r-- | tooling/rspec_flaky/example.rb | 7 | ||||
-rw-r--r-- | tooling/rspec_flaky/flaky_example.rb | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/tooling/rspec_flaky/example.rb b/tooling/rspec_flaky/example.rb index e6c2f838194..8f369c99c5b 100644 --- a/tooling/rspec_flaky/example.rb +++ b/tooling/rspec_flaky/example.rb @@ -38,13 +38,18 @@ module RspecFlaky rspec_example.respond_to?(:attempts) ? rspec_example.attempts : 1 end + def feature_category + metadata[:feature_category] + end + def to_h { example_id: example_id, file: file, line: line, description: description, - last_attempts_count: attempts + last_attempts_count: attempts, + feature_category: feature_category } end diff --git a/tooling/rspec_flaky/flaky_example.rb b/tooling/rspec_flaky/flaky_example.rb index 5736cc74810..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| @@ -38,6 +40,7 @@ module RspecFlaky attributes[:first_flaky_at] ||= Time.now attributes[:last_flaky_at] = Time.now attributes[:flaky_reports] += 1 + 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'] |