简体   繁体   中英

Running Canopy in Azure Devops

I have a couple of automated tests written in Canopy. I run them locally by running the following command:

dotnet run Project.AutomatedTests.fsproj

on Azure DevOps I tried to configure them the same way, so I have the following steps:

1.

dotnet restore Project.sln

2.

dotnet build Project.sln

3.

dotnet run Project.AutomatedTests.dll

But Azure DevOps fails with following error:

2019-01-19T11:11:42.5195371Z ##[error]Error: /usr/bin/dotnet failed with return code: 1
2019-01-19T11:11:42.5219579Z ##[error]Dotnet command failed with non-zero exit code on the following projects : /home/vsts/work/1/s/backend/tests/Project.AutomatedTests/bin/Release/netcoreapp2.1/Project.AutomatedTests.dll,/home/vsts/work/1/s/backend/tests/Project.AutomatedTests/bin/Release/netcoreapp2.1/publish/Project.AutomatedTests.dll,/home/vsts/work/1/s/backend/tests/Project.AutomatedTests/obj/Release/netcoreapp2.1/Project.AutomatedTests.dll

I also tried running:

dotnet run Project.AutomatedTests.fsproj

But it fails with the same error.

I tried to run it with --project argument like that:

-v d --project /home/vsts/work/1/s/backend/tests/Project.AutomatedTests/Project.AutomatedTests.fsproj

but tests hangs up with the following exception:

 at Start.main(String[] _arg1) in /home/vsts/work/1/s/backend/tests/Project.AutomatedTests/Program.fs:line 17
   at canopy.classic.start(BrowserStartMode b) in C:\projects\canopy\src\canopy\canopy.fs:line 250
   at canopy.parallell.functions.start(BrowserStartMode b) in C:\projects\canopy\src\canopy\canopy.parallell.functions.fs:line 835
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)

Maybe someone has an idea what I did wrong?

The solution to my problem was:

start ChromeHeadless

instead of:

start chrome

and after that everything works just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM