Azure devops Azure DevOps管道:Newman是自托管代理(Windows)上邮递员的cli伴侣

Azure devops Azure DevOps管道:Newman是自托管代理(Windows)上邮递员的cli伴侣,azure-devops,postman,azure-pipelines-release-pipeline,azure-devops-pipelines,Azure Devops,Postman,Azure Pipelines Release Pipeline,Azure Devops Pipelines,我在YAML管道中使用任务“Newman the cli Companion for Postman”()来运行Postman集合,以进行测试和预热 我使用的任务如下所示: - task: carlowahlstedt.NewmanPostman.NewmanPostman.NewmanPostman@4 displayName: 'Newman - Postman' inputs: collectionFileSource: '$(Pipeline.Workspace)/dro

我在YAML管道中使用任务“Newman the cli Companion for Postman”()来运行Postman集合,以进行测试和预热

我使用的任务如下所示:

- task: carlowahlstedt.NewmanPostman.NewmanPostman.NewmanPostman@4
  displayName: 'Newman - Postman'
  inputs:
    collectionFileSource: '$(Pipeline.Workspace)/drop/Postman'
    Contents: '**\*_collection.json'
    folder: Release
    environment: '$(Pipeline.Workspace)/drop/Postman/$(Environment).postman_environment.json'
    ignoreRedirect: false
    bail: false
    sslInsecure: false
    reporters: 'html,junit'
    reporterHtmlExport: '$(Pipeline.Workspace)/drop/Postman'
    htmlExtraDarkTheme: false
    htmlExtraLogs: false
    htmlExtraTestPaging: false
    reporterJUnitExport: '$(Pipeline.Workspace)/drop/Postman'
在托管代理上执行此操作效果很好,但在使用自托管代理时,我得到:

##[error]Unable to locate executable file: 'newman'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.

我在代理上安装了newman和newman reporter html,并且能够在登录到代理时运行它


如何解决此问题?

要解决我添加的问题

pathToNewman: 'C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\newman.cmd'
添加到任务定义。如果代理找不到版本,则使用该路径

因此,任务看起来就像

- task: carlowahlstedt.NewmanPostman.NewmanPostman.NewmanPostman@4
  displayName: 'Newman - Postman'
  inputs:
    collectionFileSource: '$(Pipeline.Workspace)/drop/Postman'
    Contents: '**\*_collection.json'
    folder: Release
    environment: '$(Pipeline.Workspace)/drop/Postman/$(Environment).postman_environment.json'
    pathToNewman: 'C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\newman.cmd'
    ignoreRedirect: false
    bail: false
    sslInsecure: false
    reporters: 'html,junit'
    reporterHtmlExport: '$(Pipeline.Workspace)/drop/Postman'
    htmlExtraDarkTheme: false
    htmlExtraLogs: false
    htmlExtraTestPaging: false
    reporterJUnitExport: '$(Pipeline.Workspace)/drop/Postman'

我不知道为什么它找不到安装的版本本身。因此,如果有人有想法,分享将非常好。

“我在代理上安装了newman和newman reporter html,并且可以在登录到代理时运行它。”我想你是指上面这句话中的自托管代理。您使用什么命令安装newman?
npm install-g newman
npm install-g newman reporter html