![]() |
VOOZH | about |
The Azure Pipelines workflow for Ocaramba is defined in the azure-pipelines.yml file. It implements a robust CI/CD strategy consisting of a three-stage pipeline (Build, Test, and Release) designed to validate the framework across multiple operating systems, browser providers, and execution environments.
The pipeline is configured to trigger on every branch push (excluding gh-pages) and on all tags azure-pipelines.yml6-17 Additionally, a scheduled "Weekly build" runs every Sunday at 18:00 UTC against the master branch azure-pipelines.yml18-24
| Variable | Default Value | Description |
|---|---|---|
solution | **/*.sln | Path to the Ocaramba solution files azure-pipelines.yml27 |
buildConfiguration | Release | The build configuration used for compilation and packaging azure-pipelines.yml29 |
frameworkVersion | 4.0.0 | Base version for NuGet packages; overridden by git tags during releases azure-pipelines.yml30 |
NUGET_PACKAGES | $(Pipeline.Workspace)/.nuget/packages | Custom path for the NuGet cache azure-pipelines.yml34 |
seleniumGridUrl | https://.../selenium-server-4.8.0.jar | Source URL for the Selenium Grid standalone jar azure-pipelines.yml33 |
Sources: azure-pipelines.yml6-34
The build stage executes on a windows-latest agent. It handles versioning, dependency restoration, compilation, and artifact generation.
If the build is triggered by a git tag, a PowerShell task extracts the latest tag using git tag --sort=-creatordate and updates the frameworkVersion variable azure-pipelines.yml44-51 A subsequent task uses regex to remove the Documentation project from Ocaramba.sln to streamline the build process and prevent SHFB build overhead during CI azure-pipelines.yml53-56
Cache@2 to store NuGet packages, keyed against packages.lock.json files azure-pipelines.yml60-68Assembly-Info-NetCore@2 task injects frameworkVersion into .csproj files, setting the PackageVersion, FileVersionNumber, and InformationalVersion azure-pipelines.yml75-89VSBuild@1 task with minimal verbosity azure-pipelines.yml90-95The pipeline publishes four primary NuGet artifacts as pipeline artifacts:
Ocaramba.$(frameworkVersion).nupkg (Main library) azure-pipelines.yml97-101Ocaramba.$(frameworkVersion).snupkg (Symbol package for debugging) azure-pipelines.yml104-108OcarambaLite.$(frameworkVersion).nupkg (Core foundation) azure-pipelines.yml109-114OcarambaLite.$(frameworkVersion).snupkg (Lite symbol package) azure-pipelines.yml115-119Sources: azure-pipelines.yml37-127
The test stage depends on the successful completion of the build stage azure-pipelines.yml130-131 It runs multiple parallel jobs to ensure cross-platform compatibility.
The RunTestsOnDocker job builds a custom Selenium image and orchestrates a local environment.
Dockerfile to create the ocaramba/selenium:latest image azure-pipelines.yml137-143the-internet test application using docker-compose.yml azure-pipelines.yml144-150ExecutingTestsOnDockerAzure.ps1 to run tests against the containerized grid azure-pipelines.yml151-154Ocaramba executes tests across various OS and provider combinations:
| Job Name | Environment | Key Tasks |
|---|---|---|
RunTestsOnLinux | ubuntu-latest | Installs google-chrome-stable, sets ASPNETCORE_ENVIRONMENT=Linux, and runs ExecutingTestsOnLinuxAzure.ps1 azure-pipelines.yml161-182 |
RunTestsOnLinuxBrowserStack | ubuntu-latest | Connects to BrowserStack using mapped environment variables (MAPPED_ENV_BROWSERSTACKKEY) for credentials azure-pipelines.yml189-214 |
RunTestsOnWindowsAzure | windows-latest | Runs standard Windows tests via ExecutingTestsOnWindowsAzure.ps1 azure-pipelines.yml216-231 |
Sources: azure-pipelines.yml133-231
The following diagram illustrates how the pipeline variables and scripts interact with the codebase entities to execute tests.
Pipeline to Code Execution Flow
Sources: azure-pipelines.yml26-34 azure-pipelines.yml151-154 azure-pipelines.yml179-182
The final stage (Release) is typically gated by the success of all previous test jobs. It retrieves the .nupkg and .snupkg artifacts generated in the build stage and pushes them to NuGet.org.
The pipeline explicitly generates and publishes .snupkg files azure-pipelines.yml106-117 These symbol packages contain the PDB files necessary for consumers to step into Ocaramba source code during debugging, leveraging the SourceLink configuration defined in the project files.
Stage and Job Dependency Diagram
Sources: azure-pipelines.yml37-131 azure-pipelines.yml189-231
The pipeline uses environment variables to pass secrets and configuration to the test execution scripts. For instance, cloud provider credentials (BrowserStack, SauceLabs, TestingBot) are mapped from pipeline secrets to environment variables within the test jobs azure-pipelines.yml211-214 These are subsequently read by BaseConfiguration during DriverContext initialization.
Sources: azure-pipelines.yml210-214
Refresh this wiki