Commit 383d61af authored by James Lopez's avatar James Lopez

Merge branch 'add-allow_failure-to-job-api' into 'master'

Add allow_failure attribute to Job API

Closes #50813

See merge request gitlab-org/gitlab-ce!28406
parents ea7b10cd cef8d1d4
---
title: Add allow_failure attribute to Job API
merge_request: 28406
author:
type: added
...@@ -32,6 +32,7 @@ Example of response ...@@ -32,6 +32,7 @@ Example of response
"title": "Test the CI integration." "title": "Test the CI integration."
}, },
"coverage": null, "coverage": null,
"allow_failure": false,
"created_at": "2015-12-24T15:51:21.727Z", "created_at": "2015-12-24T15:51:21.727Z",
"started_at": "2015-12-24T17:54:24.729Z", "started_at": "2015-12-24T17:54:24.729Z",
"finished_at": "2015-12-24T17:54:24.921Z", "finished_at": "2015-12-24T17:54:24.921Z",
...@@ -81,6 +82,7 @@ Example of response ...@@ -81,6 +82,7 @@ Example of response
"title": "Test the CI integration." "title": "Test the CI integration."
}, },
"coverage": null, "coverage": null,
"allow_failure": false,
"created_at": "2015-12-24T15:51:21.802Z", "created_at": "2015-12-24T15:51:21.802Z",
"started_at": "2015-12-24T17:54:27.722Z", "started_at": "2015-12-24T17:54:27.722Z",
"finished_at": "2015-12-24T17:54:27.895Z", "finished_at": "2015-12-24T17:54:27.895Z",
...@@ -165,6 +167,7 @@ Example of response ...@@ -165,6 +167,7 @@ Example of response
"title": "Test the CI integration." "title": "Test the CI integration."
}, },
"coverage": null, "coverage": null,
"allow_failure": false,
"created_at": "2015-12-24T15:51:21.727Z", "created_at": "2015-12-24T15:51:21.727Z",
"started_at": "2015-12-24T17:54:24.729Z", "started_at": "2015-12-24T17:54:24.729Z",
"finished_at": "2015-12-24T17:54:24.921Z", "finished_at": "2015-12-24T17:54:24.921Z",
...@@ -214,6 +217,7 @@ Example of response ...@@ -214,6 +217,7 @@ Example of response
"title": "Test the CI integration." "title": "Test the CI integration."
}, },
"coverage": null, "coverage": null,
"allow_failure": false,
"created_at": "2015-12-24T15:51:21.802Z", "created_at": "2015-12-24T15:51:21.802Z",
"started_at": "2015-12-24T17:54:27.722Z", "started_at": "2015-12-24T17:54:27.722Z",
"finished_at": "2015-12-24T17:54:27.895Z", "finished_at": "2015-12-24T17:54:27.895Z",
...@@ -296,6 +300,7 @@ Example of response ...@@ -296,6 +300,7 @@ Example of response
"title": "Test the CI integration." "title": "Test the CI integration."
}, },
"coverage": null, "coverage": null,
"allow_failure": false,
"created_at": "2015-12-24T15:51:21.880Z", "created_at": "2015-12-24T15:51:21.880Z",
"started_at": "2015-12-24T17:54:30.733Z", "started_at": "2015-12-24T17:54:30.733Z",
"finished_at": "2015-12-24T17:54:31.198Z", "finished_at": "2015-12-24T17:54:31.198Z",
...@@ -528,6 +533,7 @@ Example of response ...@@ -528,6 +533,7 @@ Example of response
"title": "Test the CI integration." "title": "Test the CI integration."
}, },
"coverage": null, "coverage": null,
"allow_failure": false,
"created_at": "2016-01-11T10:13:33.506Z", "created_at": "2016-01-11T10:13:33.506Z",
"started_at": "2016-01-11T10:14:09.526Z", "started_at": "2016-01-11T10:14:09.526Z",
"finished_at": null, "finished_at": null,
...@@ -576,6 +582,7 @@ Example of response ...@@ -576,6 +582,7 @@ Example of response
"title": "Test the CI integration." "title": "Test the CI integration."
}, },
"coverage": null, "coverage": null,
"allow_failure": false,
"created_at": "2016-01-11T10:13:33.506Z", "created_at": "2016-01-11T10:13:33.506Z",
"started_at": null, "started_at": null,
"finished_at": null, "finished_at": null,
...@@ -628,6 +635,7 @@ Example of response ...@@ -628,6 +635,7 @@ Example of response
"title": "Test the CI integration." "title": "Test the CI integration."
}, },
"coverage": null, "coverage": null,
"allow_failure": false,
"download_url": null, "download_url": null,
"id": 42, "id": 42,
"name": "rubocop", "name": "rubocop",
...@@ -681,6 +689,7 @@ Example response: ...@@ -681,6 +689,7 @@ Example response:
"title": "Test the CI integration." "title": "Test the CI integration."
}, },
"coverage": null, "coverage": null,
"allow_failure": false,
"download_url": null, "download_url": null,
"id": 42, "id": 42,
"name": "rubocop", "name": "rubocop",
...@@ -757,6 +766,7 @@ Example of response ...@@ -757,6 +766,7 @@ Example of response
"title": "Test the CI integration." "title": "Test the CI integration."
}, },
"coverage": null, "coverage": null,
"allow_failure": false,
"created_at": "2016-01-11T10:13:33.506Z", "created_at": "2016-01-11T10:13:33.506Z",
"started_at": null, "started_at": null,
"finished_at": null, "finished_at": null,
......
...@@ -1266,7 +1266,7 @@ module API ...@@ -1266,7 +1266,7 @@ module API
end end
class JobBasic < Grape::Entity class JobBasic < Grape::Entity
expose :id, :status, :stage, :name, :ref, :tag, :coverage expose :id, :status, :stage, :name, :ref, :tag, :coverage, :allow_failure
expose :created_at, :started_at, :finished_at expose :created_at, :started_at, :finished_at
expose :duration expose :duration
expose :user, with: User expose :user, with: User
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
"ref": { "type": "string" }, "ref": { "type": "string" },
"tag": { "type": "boolean" }, "tag": { "type": "boolean" },
"coverage": { "type": ["number", "null"] }, "coverage": { "type": ["number", "null"] },
"allow_failure": { "type": "boolean" },
"created_at": { "type": "string" }, "created_at": { "type": "string" },
"started_at": { "type": ["null", "string"] }, "started_at": { "type": ["null", "string"] },
"finished_at": { "type": ["null", "string"] }, "finished_at": { "type": ["null", "string"] },
......
...@@ -286,6 +286,7 @@ describe API::Jobs do ...@@ -286,6 +286,7 @@ describe API::Jobs do
expect(json_response['ref']).to eq(job.ref) expect(json_response['ref']).to eq(job.ref)
expect(json_response['tag']).to eq(job.tag) expect(json_response['tag']).to eq(job.tag)
expect(json_response['coverage']).to eq(job.coverage) expect(json_response['coverage']).to eq(job.coverage)
expect(json_response['allow_failure']).to eq(job.allow_failure)
expect(Time.parse(json_response['created_at'])).to be_like_time(job.created_at) expect(Time.parse(json_response['created_at'])).to be_like_time(job.created_at)
expect(Time.parse(json_response['started_at'])).to be_like_time(job.started_at) expect(Time.parse(json_response['started_at'])).to be_like_time(job.started_at)
expect(Time.parse(json_response['finished_at'])).to be_like_time(job.finished_at) expect(Time.parse(json_response['finished_at'])).to be_like_time(job.finished_at)
......
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