简体   繁体   中英

How to run nSpec test in Team City?

I want to run nSpec in Team City 7.X (or later). I have seen that Team City has support for mSpec framework but no for nSpec. And the option XML Report Processing seems to not support nSpec.

Is it possible?

I know this question is quite old but thought I would post in case anyone has this problem, like I have recently.

From my perspective there are 2 options (until there is an in-built runner in TeamCity).

Option 1: Configure NSpec tests to be run as an NUnit test

The best way I have found for doing this is using a workaround which allows NSpec tests to be run as an NUnit test.

  1. Derive each test class from a derived version of nspec which has an entry point for NUnit tests (see the following answer for more details on this: https://stackoverflow.com/a/27179217/5389272 ). I have a shared testing project which exposes this base class.
  2. Configure TeamCity to run NUnit tests as you usually would (FYI you can get a basic report using a Build Feature - https://stackoverflow.com/a/8065482/5389272 )

Option 2: Install the NSpec console on your build server and execute your tests using command line

Since TeamCity allows use to use the command line directly you could install the NSpec console on your build server and run your tests directly from here. I have not done this so cannot give you much direction but it is likely to be a lot more complex than Option 1 when it comes returning a failing result etc.

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