This codebase has been created to demonstrate good DevOps practices such as CI, CD and test automation practices.
This project consists of:
- Azure DevOps Pipelines (
/.azdo/pipelines
) - PR, CI & CD - Application Code (
/src
) - Web and API - Test code (
/test
) - Integration (L3), E2E (L4) and unit testing (L0, L1)
These test, and code coverage, are included as pipeline artefacts.
I use (docker-compose
) to orchestrate the hosting of the API HTTP Listener so I can assert Integration tests.
Run .\winterm
to open Windows Terminal with pre-configured sln tabs
Api:
cd UnitTesting
dotnet test --filter "TestCategory=L0" -v 4
dotnet test --filter "TestCategory=L1" -v 4
dotnet test --filter "TestCategory=L0|TestCategory=L1" -v 4
Web:
```powershell
cd UnitTesting_Web
dotnet test --filter "TestCategory=L0" -v 4
cd UnitTestingTesting
dotnet test --filter "TestCategory=L3" -v 4
cd End2EndTesting
bin/Debug/net6.0/playwright.ps1 install --with-deps
dotnet test --filter "Category=L4"
dotnet test --collect "XPlat Code Coverage" --settings .runsettings.xml --logger trx --results-directory ./TestResults /p:Exclude="[*]*Startup%2c[*]*Program"
reportgenerator "-reports:TestResults/**/*.xml" "-targetdir:TestResults\Coverage" -reporttypes:Html --settings .\.runsettings.xml
https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md