【问题标题】:Azure pipeline custom task - info logs are considered errorsAzure 管道自定义任务 - 信息日志被视为错误
【发布时间】:2021-03-21 10:32:20
【问题描述】:

我开发了一个执行 nightwatch.js 测试用例的天蓝色自定义管道任务(构建和发布)。

nightwatch 在连接到 chrome 时会生成一个 INFO 日志(如下面的第一张图片所示)。但是,这些日志被视为管道中的错误,并且自定义任务显示为失败(请参阅第二张图片)。无论如何我可以从 nightwatch.js 中抑制 INFO 日志

Task.json 代码

{
    "$schema": "https://raw.githubusercontent.com/Microsoft/azure-pipelines-task-lib/master/tasks.schema.json",
    "id": "c786b1f1-37f1-44d6-ba55-5abe126bb031",
    "name": “CustomTaskName”,
    "friendlyName": "CustomTaskName Friendly Name,
    "description": “desc”,
    "helpMarkDown": "",
    "category": "Utility",
    "author": "Chandan",
    "version": {
        "Major": 0,
        "Minor": 1,
        "Patch": 0
    },
    "instanceNameFormat": "Echo $(url)",
    "inputs": [
        {
            "name": "url",
            "type": "string",
            "label": "URL of your website",
            "defaultValue": "",
            "required": true,
            "helpMarkDown": "URL of your website which needs testing"
        }
    ],
    "execution": {
        "PowerShell": {
            "target": "$(currentDirectory)\\command.ps1",
            "argumentFormat": "",
            "workingDirectory": ""
        }
    }
}

【问题讨论】:

  • 可以分享一下你的任务代码吗?
  • @ShaykiAbramczyk 我已经更新了问题本身中的 task.json 代码。

标签: azure azure-devops azure-pipelines-release-pipeline nightwatch.js nightwatch


【解决方案1】:

您可以尝试将slient: true 添加到 nightwatch.conf.js 配置文件中。

  live_output: false,
  silent: true,
  output: true,
  detailed_output: false,
  disable_error_log: false,

您可以在官方document的输出设置部分找到相关详细信息。

【讨论】:

  • 我在 test_settings 下更新了 nightwatch.conf.js。仍然没有工作期望Capabilities:{ browserName:'chrome',silent:true,live_output:false,输出:true,detailed_output:false,disable_error_log:false }
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-07-26
  • 2021-09-06
  • 1970-01-01
  • 2011-05-31
  • 2020-02-28
  • 2011-05-01
  • 1970-01-01
相关资源
最近更新 更多