微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。