Add getDyno API endpoint
This commit is contained in:
Родитель
244518e934
Коммит
9f4c18d8af
|
@ -18,6 +18,16 @@ function* pipelineRepository (client, pipelineID) {
|
|||
})
|
||||
}
|
||||
|
||||
function* getDyno (client, appID, dynoID) {
|
||||
return client.request({
|
||||
path: `/apps/${appID}/dynos/${dynoID}`,
|
||||
headers: {
|
||||
Authorization: `Bearer ${client.options.token}`,
|
||||
Accept: VERSION_HEADER
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function* githubArchiveLink (client, user, repository, ref) {
|
||||
return client.request({
|
||||
host: KOLKRABBI,
|
||||
|
@ -128,6 +138,7 @@ module.exports = {
|
|||
configVars,
|
||||
createSource,
|
||||
createTestRun,
|
||||
getDyno,
|
||||
githubArchiveLink,
|
||||
latestTestRun,
|
||||
testNodes,
|
||||
|
|
|
@ -37,6 +37,26 @@ describe('heroku-api', function () {
|
|||
})
|
||||
})
|
||||
|
||||
describe('#getDyno', function () {
|
||||
it('returns dyno information', function* () {
|
||||
const appID = '123-456-67-89'
|
||||
const dynoID = '01234567-89ab-cdef-0123-456789abcdef'
|
||||
const dyno = {
|
||||
id: dynoID,
|
||||
attach_url: 'rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}',
|
||||
app: { id: appID }
|
||||
}
|
||||
|
||||
const api = nock(`https://api.heroku.com`)
|
||||
.get(`/apps/${appID}/dynos/${dynoID}`)
|
||||
.reply(200, dyno)
|
||||
|
||||
const response = yield herokuAPI.getDyno(new Heroku(), appID, dynoID)
|
||||
expect(response).to.deep.eq(dyno)
|
||||
api.done()
|
||||
})
|
||||
})
|
||||
|
||||
describe('#githubArchiveLink', function () {
|
||||
it('gets a GitHub archive link', function* () {
|
||||
const { user, repository } = ['heroku', 'heroku-ci']
|
||||
|
|
Загрузка…
Ссылка в новой задаче