Class: GitlabQuality::TestTooling::Report::GroupIssues::ErrorPatternMatcher
- Inherits:
-
Object
- Object
- GitlabQuality::TestTooling::Report::GroupIssues::ErrorPatternMatcher
- Defined in:
- lib/gitlab_quality/test_tooling/report/group_issues/error_pattern_matcher.rb
Constant Summary collapse
- ENVIRONMENT_ERROR_PATTERNS =
[ { name: "http_500_api_fabrication", pattern: /Fabrication of .+ using the API failed \(500\)/i }, { name: "http_500_internal_server", pattern: /(500 Internal Server Error|request returned \(500\)|Expected \(200\), request returned \(500\))/i }, { name: "http_400_backend_failing", pattern: /failed \(400\) with.+connections to all backends failing/i }, { name: "http_503_service_unavailable", pattern: /Unexpected status code 503/i }, { name: "pipeline_creation_timeout", pattern: /Wait for pipeline to be created failed after \d+ seconds/i }, { name: "event_timeout", pattern: /(Timed out waiting for event|EventNotFoundError: Timed out waiting)/i }, { name: "git_rpc_failure", pattern: /error: RPC failed; HTTP 500/i }, { name: "repository_fabricate_error", pattern: /Repository fabricate/i } ].freeze
Instance Method Summary collapse
- #environment_error?(error_message) ⇒ Boolean
- #match(error_message) ⇒ Object
- #pattern_name(error_message) ⇒ Object
Instance Method Details
#environment_error?(error_message) ⇒ Boolean
25 26 27 |
# File 'lib/gitlab_quality/test_tooling/report/group_issues/error_pattern_matcher.rb', line 25 def environment_error?() !match().nil? end |
#match(error_message) ⇒ Object
19 20 21 22 23 |
# File 'lib/gitlab_quality/test_tooling/report/group_issues/error_pattern_matcher.rb', line 19 def match() return nil if .nil? || .empty? ENVIRONMENT_ERROR_PATTERNS.find { |pattern_def| .match?(pattern_def[:pattern]) } end |
#pattern_name(error_message) ⇒ Object
29 30 31 |
# File 'lib/gitlab_quality/test_tooling/report/group_issues/error_pattern_matcher.rb', line 29 def pattern_name() match()&.dig(:name) end |