From the course: Deploying ASP.NET Core Applications: From Fundamentals to Advanced Deployment Strategies

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Automating to CI/CD pipelines

Automating to CI/CD pipelines

- [Instructor] In this part we're going to talk about automating tests in CI/CD pipelines. Now for that, we need to first create a unit testing project, and then we're going to have a unit test. So wherever we deploy some code to a branch, we want the pipeline to run the unit test. For that then I'll just go to Visual Studio. And then in here I'm just going to Add, New Project, and then this is going to be an xUnit. Go Next. I'm going to name it CICD and then Test. Next, Create. Now, inside this test, I'm just going to add an Assert statement, so Assert.True. And then I just want this to pass on true. Let me just deploy this one and then save and commit. Then Push, Pull then Push. Let us now go to GitHub, and then here go to Actions. We can see that this action was triggered. And we can see that the build was successful. And if I go to this file, you can see that inside this file, part of the steps, I also have a step named Test which runs the command, dotnet test. So it means that…

Contents