1

We have a Microsoft .NET Blazor server-side application. We have incorporated bUnit testing that triggers when we run the Blazor app from within VisualStudio.

Recently, we have been asked to use GitLab for our CI/CD.

As I am new to GitLab and bUnit, itself, is fairly new, I am not sure how to accomplish this.

In VisualStudio, in order to create and run bUnit tests, we had to have a structure like so:

OurProject/
∟ BlazorProject/
  ∟ BlazorProject.csproj
  ∟ BlazorProject.sln
∟ bUnitTests/
  ∟ bUnitTests.csproj

I'm not even sure how to, or if it is possible, to run these tests from PowerShell. I add this part as the GitLab .gitlab-ci.yml file is essentially running command line commands to accomplish the tasks.

So, does anybody know how to accomplish running bUnit test from within the GitLab CI pipeline?

Brian
  • 1,726
  • 2
  • 24
  • 62

1 Answers1

1

Just run the test project like you normally do, e.g. via dotnet test.

Looks like this template is a good starting point: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/dotNET-Core.gitlab-ci.yml

Egil Hansen
  • 15,028
  • 8
  • 37
  • 54
  • Thank you, that worked! I checked out the documentation at GitLab.com, but I couldn't find anything specific to bUnit (I assumed because it was relatively new), so I moved on. – Brian Apr 07 '23 at 16:09