當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Command.log方法代碼示例

本文整理匯總了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
  }
}
開發者ID:jimmyurl,項目名稱:cli,代碼行數:29,代碼來源:test-run.ts

示例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)
    }
  }
}
開發者ID:jimmyurl,項目名稱:cli,代碼行數:30,代碼來源:test-run.ts

示例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))
}
開發者ID:jimmyurl,項目名稱:cli,代碼行數:11,代碼來源:test-run.ts

示例4:

 testNodes.forEach(testNode => {
   command.log(printLineTestNode(testNode))
 })
開發者ID:jimmyurl,項目名稱:cli,代碼行數:3,代碼來源:test-run.ts


注:本文中的@heroku-cli/command.Command.log方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。