diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/serializers/test_case_entity.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/serializers/test_case_entity.rb')
-rw-r--r-- | app/serializers/test_case_entity.rb | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/app/serializers/test_case_entity.rb b/app/serializers/test_case_entity.rb index 8a5fadf53a6..1a872274cbf 100644 --- a/app/serializers/test_case_entity.rb +++ b/app/serializers/test_case_entity.rb @@ -3,15 +3,20 @@ class TestCaseEntity < Grape::Entity include API::Helpers::RelatedResourcesHelpers - expose :status - expose :name, default: "(No name)" - expose :classname - expose :file - expose :execution_time - expose :system_output - expose :stack_trace - expose :recent_failures - expose :attachment_url, if: -> (*) { can_read_screenshots? } do |test_case| + expose :status, documentation: { type: 'string', example: 'success' } + expose :name, default: "(No name)", + documentation: { type: 'string', example: 'Security Reports can create an auto-remediation MR' } + expose :classname, documentation: { type: 'string', example: 'vulnerability_management_spec' } + expose :file, documentation: { type: 'string', example: './spec/test_spec.rb' } + expose :execution_time, documentation: { type: 'integer', example: 180 } + expose :system_output, documentation: { type: 'string', example: 'Failure/Error: is_expected.to eq(3)' } + expose :stack_trace, documentation: { type: 'string', example: 'Failure/Error: is_expected.to eq(3)' } + expose :recent_failures, documentation: { example: { count: 3, base_branch: 'develop' } } + expose( + :attachment_url, + if: -> (*) { can_read_screenshots? }, + documentation: { type: 'string', example: 'http://localhost/namespace1/project1/-/jobs/1/artifacts/file/some/path.png' } + ) do |test_case| expose_url(test_case.attachment_url) end |