Azure pipeline custom task - info logs are considered errors
Asked 07 September, 2021
Viewed 430 times
  • 63
Votes

I have developed an azure custom pipeline task (Build and Release) that executes nightwatch.js test cases.

nightwatch generates an INFO log while connecting to chrome (As Shown in the first image below). However, these logs are considered as errors in the pipleline and the custom task is shown as failure (refer 2nd image). Is there anyway I can supress INFO logs from nightwatch.js

INFO log when nightwatch is executed

PipeLine error

Task.json code

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

1 Answer