Recently an error occurred in an Azure DevOps build pipeline due to a conflict with a non-running Docker container, impacting integration tests using Testcontainers.MsSql. A workaround was suggested to resolve compatibility issues on Linux by updating the Docker image used by Testcontainers.MsSql.
[HOWTO] Report code coverage of .NET solution in SonarCloud when using Azure DevOps Microsoft-hosted linux agent
This blog post discusses the integration of SonarCloud code coverage reporting in an Azure DevOps YAML pipeline for .NET projects. It highlights adjustments needed when running such a pipeline on Azure DevOps Microsoft-hosted linux agents.
[FollowUp] Using Testcontainers in integration tests for ASP.NET Core Web API
The blog post discusses transitioning from SQLite to Testcontainers for .NET to run integration tests for ASP.NET Core applications. The author encountered limitations with SQLite when running complex Linq queries. While alternatives like Mocking, EF Core In-Memory Database Provider, and LocalDB were considered, these were found to be wanting. Instead, Testcontainers was chosen for its simple setup, good documentation, and excellent integration with MSSQL servers. This approach does necessitate Docker being installed and operational on the local development environment.
[HOWTO] Implement integration tests for ASP.NET Core Web API with AntiForgery token validation
The author discusses the importance of integration tests in ASP.NET Core Web APIs, citing benefits, such as real-life-like REST requests, serialization and deserialization, server application startup code execution, etc. Furthermore, the Microsoft.AspNetCore.Mvc.Testing library is highlighted. Despite challenges, the author promotes maintaining similarity to production during tests. The text then explores code bases and integration tests. Several sections cover API initialization, authentication configuration, running tests against a Sqlite database, and antiforgery subject. The article concludes by discussing alternative approaches found during the research.
[NoBrainer] Avoid HTTPS redirection warnings in integration test logs
I recently implemented ASP.NET Core integration tests in a project I am working on. I have followed the official documentation, which was extremely helpful. The system under test (SUT) is an ASP.NET Core Web API (.NET 7) implementing backends for frontends (BFF) pattern. To follow security best practices we enabled HTTPS redirection in all stages... Continue Reading →
The ultimate Gmail trick
Recently, a colleague at work told me a great Gmail trick that I'd like to share here. You can add a + sign at the end of the local part of your email address followed by an arbitrary combination of words and/or numbers. Example: yourusername+test1234@gmail.com Emails sent to such variants of your Gmail address will... Continue Reading →
