【发布时间】:2018-01-25 15:18:12
【问题描述】:
我在尝试从发布定义中的 VSTS 运行 Protractor e2e 测试时遇到问题。
我在发布定义中的步骤是:
Azure 文件复制:这会将源代码从 Git 存储库复制到将运行测试的 Azure VM
目标机器上的 PowerShell:这会在 Azure VM 上执行 Powershell 脚本。
powershell脚本如下:
cd c:/App
$ErrorActionPreference = 'Continue'
npm install
npm run e2e
在 VSTS 中,它失败并显示以下错误:
2018-01-24T05:27:47.2854207Z Deployment started on target machine...
2018-01-24T05:27:47.2854587Z
2018-01-24T05:27:47.2855184Z System.AggregateException: Failed to execute the powershell script. Consult the logs below for details of the error.
2018-01-24T05:27:47.2855708Z
2018-01-24T05:27:47.2856210Z System.Management.Automation.RemoteException
2018-01-24T05:27:47.2856743Z +At C:\scripts\Rune2eTests.ps1:3 char:1
2018-01-24T05:27:47.2857225Z + npm install
2018-01-24T05:27:47.2857694Z + ~~~~~~~~~~~~~~~~~~~~
2018-01-24T05:27:47.2858464Z CategoryInfo :NotSpecified: (:String) [], RemoteException
2018-01-24T05:27:47.2859049Z FullyQualifiedErrorId :NativeCommandError
2018-01-24T05:27:47.2859393Z
2018-01-24T05:27:47.2860037Z Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
2018-01-24T05:27:47.2860677Z +At C:\scripts\Rune2eTests.ps1:4 char:1
2018-01-24T05:27:47.2861172Z + npm run e2e
2018-01-24T05:27:47.2861603Z + ~~~~~~~~~~~
2018-01-24T05:27:47.2862153Z CategoryInfo :NotSpecified: (Without `from` ...t this warning.:String) [], RemoteException
2018-01-24T05:27:47.2862721Z FullyQualifiedErrorId :NativeCommandError
当我远程进入 Azure VM 并仅运行 powershell 脚本时,它确实成功地运行了所有量角器测试,但在 VSTS 运行它时却没有。另一个问题是它不会在控制台中输出 VSTS 中通过/失败的测试。
【问题讨论】:
标签: protractor azure-devops azure-pipelines-release-pipeline