Lessons in this course (10)

9. Running tests in CI/CD, parallel execution and reporting

Advanced★ Must knowLesson 9 of 10
yaml
# Azure DevOps pipeline (excerpt)
- task: DotNetCoreCLI@2
  inputs: { command: test, projects: 'tests/**/*.csproj', arguments: '--filter TestCategory=Smoke --logger trx' }
- task: PublishTestResults@2
  inputs: { testResultsFormat: VSTest, testResultsFiles: '**/*.trx' }
  • When to run: unit + API smoke on every PR; full UI regression nightly or before release; smoke after each deployment.
  • Parallel: NUnit [Parallelizable(ParallelScope.All)] + [FixtureLifeCycle(LifeCycle.InstancePerTestCase)]; xUnit runs test classes in parallel; Playwright workers; Selenium Grid / cloud grids for many browsers.
  • Headless browsers in CI; record video/trace only on failure.
  • Reports: TRX in Azure DevOps, Allure/Extent HTML, Playwright HTML report with traces.
  • Environment & data: config per environment (appsettings + pipeline variables), secrets from Key Vault/variable groups, fresh data created through APIs, Testcontainers for DBs.