Commit e503b498 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'expose-junit-spec-file-path' into 'master'

Expose file path from XML Test Report artifact

See merge request gitlab-org/gitlab!43594
parents f81ea006 a57fd941
...@@ -6,6 +6,7 @@ class TestCaseEntity < Grape::Entity ...@@ -6,6 +6,7 @@ class TestCaseEntity < Grape::Entity
expose :status expose :status
expose :name expose :name
expose :classname expose :classname
expose :file
expose :execution_time expose :execution_time
expose :system_output expose :system_output
expose :stack_trace expose :stack_trace
......
---
title: Expose file path from XML Test Report artifact
merge_request: 43594
author:
type: changed
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"status": { "type": "string" }, "status": { "type": "string" },
"name": { "type": "string" }, "name": { "type": "string" },
"classname": { "type": "string" }, "classname": { "type": "string" },
"file": { "type": ["string", "null"] },
"execution_time": { "type": "float" }, "execution_time": { "type": "float" },
"system_output": { "type": ["string", "null"] }, "system_output": { "type": ["string", "null"] },
"stack_trace": { "type": ["string", "null"] }, "stack_trace": { "type": ["string", "null"] },
......
...@@ -19,6 +19,7 @@ RSpec.describe TestCaseEntity do ...@@ -19,6 +19,7 @@ RSpec.describe TestCaseEntity do
expect(subject[:status]).to eq('success') expect(subject[:status]).to eq('success')
expect(subject[:name]).to eq('Test#sum when a is 1 and b is 3 returns summary') expect(subject[:name]).to eq('Test#sum when a is 1 and b is 3 returns summary')
expect(subject[:classname]).to eq('spec.test_spec') expect(subject[:classname]).to eq('spec.test_spec')
expect(subject[:file]).to eq('./spec/test_spec.rb')
expect(subject[:execution_time]).to eq(1.11) expect(subject[:execution_time]).to eq(1.11)
end end
end end
...@@ -30,6 +31,7 @@ RSpec.describe TestCaseEntity do ...@@ -30,6 +31,7 @@ RSpec.describe TestCaseEntity do
expect(subject[:status]).to eq('failed') expect(subject[:status]).to eq('failed')
expect(subject[:name]).to eq('Test#sum when a is 1 and b is 3 returns summary') expect(subject[:name]).to eq('Test#sum when a is 1 and b is 3 returns summary')
expect(subject[:classname]).to eq('spec.test_spec') expect(subject[:classname]).to eq('spec.test_spec')
expect(subject[:file]).to eq('./spec/test_spec.rb')
expect(subject[:execution_time]).to eq(2.22) expect(subject[:execution_time]).to eq(2.22)
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