Make sure that uses exit_code from firstTestNode

This commit is contained in:
raulb 2017-03-30 09:13:23 -07:00
Родитель 3b971eb1fb
Коммит 2c7efc008d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E980774E7D035F37
2 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -33,7 +33,7 @@ function stream (url) {
function * display (pipeline, number, { heroku }) {
let testRun = yield api.testRun(heroku, pipeline.id, number)
const testNodes = yield api.testNodes(heroku, testRun.id)
let testNodes = yield api.testNodes(heroku, testRun.id)
let firstTestNode = testNodes[0]
testRun = yield waitForStates(TestRunStatesUtil.BUILDING_STATES, testRun, { heroku })
@ -46,10 +46,15 @@ function * display (pipeline, number, { heroku }) {
testRun = yield waitForStates(TestRunStatesUtil.TERMINAL_STATES, testRun, { heroku })
// At this point, we know that testRun has a finished status,
// and we can check for exit_code from firstTestNode
testNodes = yield api.testNodes(heroku, testRun.id)
firstTestNode = testNodes[0]
cli.log(/* newline 💃 */)
cli.log(RenderTestRuns.printLine(testRun))
return testRun
return firstTestNode
}
function * displayAndExit (pipeline, number, { heroku }) {

Просмотреть файл

@ -34,7 +34,8 @@ describe('heroku ci:last', function () {
testNode = {
output_stream_url: 'https://output.com/tests',
setup_stream_url: 'https://output.com/setup',
test_run: { id: testRun.id }
test_run: { id: testRun.id },
exit_code: 1
}
setupOutput = ''
@ -55,6 +56,8 @@ describe('heroku ci:last', function () {
.reply(200, testRun)
.get(`/test-runs/${testRun.id}/test-nodes`)
.reply(200, [testNode])
.get(`/test-runs/${testRun.id}/test-nodes`)
.reply(200, [testNode])
const streamAPI = nock('https://output.com')
.get('/setup')