本文整理汇总了TypeScript中@heroku-cli/command.Command.log方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Command.log方法的具体用法?TypeScript Command.log怎么用?TypeScript Command.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@heroku-cli/command.Command
的用法示例。
在下文中一共展示了Command.log方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: display
async function display(pipeline: Heroku.Pipeline, number: number, command: Command) {
let {body: testRun} = await command.heroku.get<Heroku.TestRun | undefined>(`/pipelines/${pipeline.id}/test-runs/${number}`)
if (testRun) {
cli.action.start('Waiting for build to start')
testRun = await waitForStates(BUILDING_STATES, testRun, command)
cli.action.stop()
let {body: testNodes} = await command.heroku.get<Heroku.TestNode[]>(`/test-runs/${testRun.id}/test-nodes`)
let firstTestNode = testNodes[0]
if (firstTestNode) { await stream(firstTestNode.setup_stream_url!) }
if (testRun) { testRun = await waitForStates(RUNNING_STATES, testRun, command) }
if (firstTestNode) { await stream(firstTestNode.output_stream_url!) }
if (testRun) { testRun = await waitForStates(TERMINAL_STATES, testRun, command) }
// At this point, we know that testRun has a finished status,
// and we can check for exit_code from firstTestNode
if (testRun) {
let {body: newTestNodes} = await command.heroku.get<Heroku.TestNode[]>(`/test-runs/${testRun.id}/test-nodes`)
firstTestNode = newTestNodes[0]
command.log()
command.log(printLine(testRun))
}
return firstTestNode
}
}
示例2: displayTestRunInfo
export async function displayTestRunInfo(command: Command, testRun: Heroku.TestRun, testNodes: Heroku.TestNode[], nodeArg: string | undefined) {
let testNode: Heroku.TestNode
if (nodeArg) {
const nodeIndex = parseInt(nodeArg, 2)
testNode = testNodes.length > 1 ? testNodes[nodeIndex] : testNodes[0]
await renderNodeOutput(command, testRun, testNode)
if (testNodes.length === 1) {
command.log()
command.warn('This pipeline doesn\'t have parallel test runs, but you specified a node')
command.warn('See https://devcenter.heroku.com/articles/heroku-ci-parallel-test-runs for more info')
}
processExitCode(command, testNode)
} else {
if (testNodes.length > 1) {
command.log(printLine(testRun))
command.log()
testNodes.forEach(testNode => {
command.log(printLineTestNode(testNode))
})
} else {
testNode = testNodes[0]
await renderNodeOutput(command, testRun, testNode)
processExitCode(command, testNode)
}
}
}
示例3: renderNodeOutput
async function renderNodeOutput(command: Command, testRun: Heroku.TestRun, testNode: Heroku.TestNode) {
if (!testNode) {
command.error(`Test run ${testRun.number} was ${testRun.status}. No Heroku CI runs found for this pipeline.`)
}
await stream(testNode.setup_stream_url!)
await stream(testNode.output_stream_url!)
command.log()
command.log(printLine(testRun))
}
示例4:
testNodes.forEach(testNode => {
command.log(printLineTestNode(testNode))
})