It is good to have the pass/fail reporting in Slack. However, we can amp it up by providing the test results, too.
We can read the test results and coverage report and include the information in the output if it is available.
Continue readingIt is good to have the pass/fail reporting in Slack. However, we can amp it up by providing the test results, too.
We can read the test results and coverage report and include the information in the output if it is available.
Continue readingThe following is inspired by the article from Kris the Coding Unicorn. This is not meant to be a comprehensive suite of tests but a start.
The following steps use the open-source Security Code Scan project, which publishes a tool to NuGet.
Unfortunately, Jenkins doesn’t seem to have a mechanism for visualizing security scans, so the output file is stored as an artifact of the job.
Continue readingCode coverage measures how much of the code is covered when running tests. This is a useful indicator of how effective tests are. One of the features we want to add is to set a minimum bar for testing to increase the quality of our components.
Visual Studio 2022 Community Edition doesn’t automatically include code coverage features out of the box. There are some things we can do to expose it in Jenkins during our build processes, validate the results, and possibly fail the build based on it. Within Visual Studio itself, you can install Fine Code Coverage from the Visual Studio Marketplace or consider tools such as NCrunch.
Adding additional steps to Jenkins won’t take long to get code coverage data and expose it on the Jenkins build page.
Continue readingI have been relying on my previous efforts over five years ago that initially set out our C# builds in Jenkins. However, my next topic, code coverage, was new territory for me.
In the process of working through code coverage, I had the opportunity to discover opportunities to clean up the existing build scripts set out in the previous articles so far.
This article will cover the revisions I’ve made. However, I’ll also update the previous articles that will jump immediately to the result.
Continue readingInitially, when building C# projects, I would have multiple solutions directly referencing the projects to be built. Sometimes, the solutions would have an extraordinary number of projects in them, so I could update them all in parallel.
However, this isn’t an ideal scenario as it makes it easy to blend code and develop tighter dependencies between modules that make future software development harder. By decomposing projects into smaller, more discrete and manageable components, we can increase the rigour around changes we make and have greater confidence in the code quality.
The use of NuGet to store versions of my packages means the applications I build can be small and lean and can work with already-defined mechanisms for publishing and retrieving packages.
I don’t want to publish my personal NuGet packages to a public repository (at least not without developing some confidence in the process first). So I have set up a Sonatype Nexus Repository to host NuGet packages.
I’ll go through the steps for configuring the Nexus Repository, Jenkins, and Visual Studio projects.
Continue readingNow that projects are building, it is incredibly valuable to run tests against the code to validate it.
This is all the more important as in the future: in GitHub we can require that a pull request pass tests and be validated before it is merged into the main branch.
Continue readingThe goal for this stage of development is to get our C# project listed in Jenkins and building. The next iteration will be adding testing.
This step follows the work from CI/CD Scanning GitHub for Repositories from Jenkins, where Jenkins is set up to scan for projects, but it now needs the files required to build.
Continue readingAs described in https://www.oneoddsock.com/2022/04/02/personal-ci-cd/, the goal of setting up the CI/CD automation is to:
To facilitate this, I’ll structure my Visual Studio solutions in GitHub so Jenkins can access them and run builds and tests.
The sample project is published on GitHub for reference at: https://github.com/FineRedMist/jenkins-project-sample-dotnet
For reference, I’m using Visual Studio 2022 Community Edition. I’m configuring the projects to use .NET 6.0.
Continue readingJust a quick note for anyone else building ClickOnce applications that have a System Tray notification icon and are signing their applications.
If you change your certificate, you likely need to change the GUID used in the System Tray notification icon otherwise it may not show up.
We distribute several tools internally that we want to ensure are code-signed (particularly ClickOnce applications).
The goals were: