diff --git a/app/assets/javascripts/reports/store/state.js b/app/assets/javascripts/reports/store/state.js index 5484900276cdc325cb5a49e53cc88fceede41de7..25f9f70d0951a02f3c138509703b9de2b4cb2d03 100644 --- a/app/assets/javascripts/reports/store/state.js +++ b/app/assets/javascripts/reports/store/state.js @@ -40,6 +40,11 @@ export default () => ({ text: s__('Reports|Class'), type: fieldTypes.link, }, + classname: { + value: null, + text: s__('Reports|Classname'), + type: fieldTypes.text, + }, execution_time: { value: null, text: s__('Reports|Execution time'), diff --git a/app/serializers/test_case_entity.rb b/app/serializers/test_case_entity.rb index ec60055ba5b6c18634047cecb8e0ee99da99bcb9..5c915c1302c28bc36e7630fc2ae25e4860a0525a 100644 --- a/app/serializers/test_case_entity.rb +++ b/app/serializers/test_case_entity.rb @@ -3,6 +3,7 @@ class TestCaseEntity < Grape::Entity expose :status expose :name + expose :classname expose :execution_time expose :system_output expose :stack_trace diff --git a/changelogs/unreleased/display-junit-classname-in-modal.yml b/changelogs/unreleased/display-junit-classname-in-modal.yml new file mode 100644 index 0000000000000000000000000000000000000000..c5140456e4e75a410bc80ff87b1face5cb78b407 --- /dev/null +++ b/changelogs/unreleased/display-junit-classname-in-modal.yml @@ -0,0 +1,5 @@ +--- +title: Display classname JUnit attribute in report modal +merge_request: 28376 +author: +type: added diff --git a/locale/gitlab.pot b/locale/gitlab.pot index b7aea0254a9e80de3162464ea4b6d4400c3225fd..c20cae9665a86947971327c5340680d1da51da57 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -8068,6 +8068,9 @@ msgstr "" msgid "Reports|Class" msgstr "" +msgid "Reports|Classname" +msgstr "" + msgid "Reports|Execution time" msgstr "" diff --git a/spec/fixtures/api/schemas/entities/test_case.json b/spec/fixtures/api/schemas/entities/test_case.json index c9ba1f3ad18d91e29b6517af3fb5287c6deafbb6..70f6edeeeb7beb9af8d56cb9fae8ed1de2be497c 100644 --- a/spec/fixtures/api/schemas/entities/test_case.json +++ b/spec/fixtures/api/schemas/entities/test_case.json @@ -7,6 +7,7 @@ "properties": { "status": { "type": "string" }, "name": { "type": "string" }, + "classname": { "type": "string" }, "execution_time": { "type": "float" }, "system_output": { "type": ["string", "null"] }, "stack_trace": { "type": ["string", "null"] } diff --git a/spec/serializers/test_case_entity_spec.rb b/spec/serializers/test_case_entity_spec.rb index a55910f98bb5784fcc48decd45f2c60b05c6f75a..986c9feb07bbdfcae4e83f37a9ab00197c471a9f 100644 --- a/spec/serializers/test_case_entity_spec.rb +++ b/spec/serializers/test_case_entity_spec.rb @@ -14,6 +14,7 @@ describe TestCaseEntity do it 'contains correct test case details' do 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[:classname]).to eq('spec.test_spec') expect(subject[:execution_time]).to eq(1.11) end end @@ -24,6 +25,7 @@ describe TestCaseEntity do it 'contains correct test case details' do expect(subject[:status]).to eq('failed') expect(subject[:name]).to eq('Test#sum when a is 2 and b is 2 returns summary') + expect(subject[:classname]).to eq('spec.test_spec') expect(subject[:execution_time]).to eq(2.22) end end