We are using xUnit to run our Unit testing for our .NET Core project . I'm a newbie to Bamboo and we are using Bamboo for CI and Octpopus for CD.
What's the best way to implement the xUnit testing framework and also best practice to run the Unit test whether its before or after a deployment.
Thanks,
Always run unit tests before deploying! The whole point is to fail the build if tests fail so that you do not deploy faulty code.
xUnit Integration to Bamboo:
It's a one-line script:
It may be helpful to run the dotnet test command outside of Bamboo to see where the files are being saved. You can also view the logs to see where Bamboo is saving and looking at for the .trx
@vjijo Not sure if there’s an xUnit task available out of the box; the lack of documentation for xUnit on Bamboo leads me to believe there isn’t.
Having said that, there’s always the Script task, so you can just execute the xUnit CLI as part of a script.
As for whether it’s best practice to run unit tests before or after, that’s the same as answering the question: “Is it better to catch bugs and fix them before your product gets released or after?”.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.