Azure 管道自定义任务 - 信息日志被视为错误

问题描述

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

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

INFO log when nightwatch is executed

PipeLine error

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": ""
        }
    }
}

解决方法

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

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

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

enter image description here