我有一个Octopus项目,它部署了2个网站和一个Web API。我编写了一个NUnit 3.5测试,它运行一个基本的Selenium测试,以确保所有组件都已启动并运行。 NUnit Selenium测试是在我的构建服务器(TFS 2015)中构建的,其他代码也是如此。如果Octopus能够获得我测试的最新版本并在部署环境中运行它将会很好。
构建可以将测试部署到文件共享或Octopus nuget feed,但nuget feed会更好,因为它的版本化。我不知道如何从Feed中获取测试并执行它。还有NUnit2的步骤定义,但不是NUnit3。必须有一种推荐的方法来处理这种情况!
设置Jenkins服务器以处理Octopus的所有测试是不是一个好主意?
答案 0 :(得分:2)
NUnit 3.5 takes a different approach from NUnit 2. Unit tests can be 'self-hosted' in their own .exe file instead of running them via the nunit runner.
Convert your NUnit project into a console app and add NUnitLite nuget package to the project. This will add a new Program.cs file which allows you to run the test simply but calling the outputted EXE file. There are some additional details in the NUnit docs.
The script file should be run from a package so that Octopus can load the nuget package.