Class: Gitlab::QA::Report::TestResult
- Inherits:
-
Object
- Object
- Gitlab::QA::Report::TestResult
- Defined in:
- lib/gitlab/qa/report/test_result.rb
Instance Attribute Summary collapse
-
#failures ⇒ Object
Returns the value of attribute failures.
-
#file ⇒ Object
Returns the value of attribute file.
-
#name ⇒ Object
Returns the value of attribute name.
-
#skipped ⇒ Object
Returns the value of attribute skipped.
-
#testcase ⇒ Object
Returns the value of attribute testcase.
Class Method Summary collapse
Instance Attribute Details
#failures ⇒ Object
Returns the value of attribute failures.
7 8 9 |
# File 'lib/gitlab/qa/report/test_result.rb', line 7 def failures @failures end |
#file ⇒ Object
Returns the value of attribute file.
7 8 9 |
# File 'lib/gitlab/qa/report/test_result.rb', line 7 def file @file end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/gitlab/qa/report/test_result.rb', line 7 def name @name end |
#skipped ⇒ Object
Returns the value of attribute skipped.
7 8 9 |
# File 'lib/gitlab/qa/report/test_result.rb', line 7 def skipped @skipped end |
#testcase ⇒ Object
Returns the value of attribute testcase.
7 8 9 |
# File 'lib/gitlab/qa/report/test_result.rb', line 7 def testcase @testcase end |
Class Method Details
.from_json(test) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/gitlab/qa/report/test_result.rb', line 9 def self.from_json(test) new.tap do |test_result| test_result.name = test['full_description'] test_result.file = test['file_path'] test_result.skipped = test['status'] == 'pending' test_result.failures = failures_from_json_exceptions(test) test_result.testcase = test['testcase'] end end |
.from_junit(test) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/gitlab/qa/report/test_result.rb', line 19 def self.from_junit(test) new.tap do |test_result| test_result.name = test['name'] test_result.file = test['file'] test_result.skipped = test.search('skipped').any? test_result.failures = failures_from_junit_exceptions(test) end end |