VOOZH about

URL: https://deepwiki.com/Accenture/Ocaramba/5.3-powershell-test-orchestration-scripts

⇱ PowerShell Test Orchestration Scripts | Accenture/Ocaramba | DeepWiki


Loading...
Last indexed: 6 June 2026 (fb3580)
Menu

PowerShell Test Orchestration Scripts

This page documents the PowerShell scripting layer used by Ocaramba to orchestrate test execution across different environments, including local Windows machines, Linux runners, Docker containers, and Cloud providers (BrowserStack, SauceLabs). These scripts bridge the gap between CI/CD pipeline definitions (GitHub Actions and Azure Pipelines) and the dotnet vstest engine.

Configuration Injection: set_AppConfig_for_tests.ps1

The primary utility script for environment-specific configuration is scripts/set_AppConfig_for_tests.ps1. This script is capable of modifying both legacy XML-based .config files and modern JSON appsettings.json files at runtime. It is extensively used in CI pipelines to inject secrets (like BrowserStack keys) or change the target browser without modifying the source code.

Implementation Details

The script defines a function set_AppConfig_for_tests scripts/set_AppConfig_for_tests.ps136-112 that takes parameters for the directory, file name, section, and pipe-separated keys and values.

Data Flow: Configuration Injection

The following diagram shows how the script manipulates configuration files during a CI run.

"Configuration Injection Flow"


Sources: scripts/set_AppConfig_for_tests.ps136-112

Test Execution Scripts

Ocaramba utilizes specialized scripts to trigger tests in different environments. These scripts are typically called by the PowerShell@2 task in Azure Pipelines or the run step in GitHub Actions.

GitHub Actions Orchestration

GitHub Actions uses a numbered series of scripts to parallelize test execution across multiple Windows runners:

Docker and Linux Orchestration

"GitHub Actions Windows Orchestration"


Sources: scripts/ExecutingTestsOnWindowsGithubActions1.ps11-27 scripts/ExecutingTestsOnWindowsGithubActions2.ps11-43 scripts/ExecutingTestsOnWindowsGithubActions5.ps11-34 scripts/ExecutingTestsOnWindowsGithubActions6.ps11-19

Script Parameters and Usage

ScriptPurposeKey Parameters / Commands
set_AppConfig_for_tests.ps1Updates config files before test run$OutDir, $configName, $section, $keys, $values, $json scripts/set_AppConfig_for_tests.ps120-34
ExecutingTestsOnWindowsGithubActions*.ps1Triggers NUnit/MsTest/Xunit on WindowsInvokes dotnet vstest for specific test suites.
ExecutingTestsOnDockerGithubActions.ps1Runs tests inside Docker containerdocker exec ocaramba_selenium bash -c ... scripts/ExecutingTestsOnDockerGithubActions.ps15-7
ExecutingTestsOnLinuxAzure.ps1Triggers tests on Azure Linux agents$Env:ASPNETCORE_ENVIRONMENT="Linux" scripts/ExecutingTestsOnLinuxAzure.ps15

Artifact Management

Most execution scripts include post-test logic to collect logs and screenshots:

  1. Staging: Files from TestOutput directories are copied to a temporary folder (e.g., TempZipStaging) scripts/ExecutingTestsOnWindowsGithubActions1.ps113-17
  2. Compression: The staging folder is zipped using Compress-Archive scripts/ExecutingTestsOnWindowsGithubActions2.ps135
  3. Cleanup: Temporary directories are removed via Remove-Item -Recurse -Force scripts/ExecutingTestsOnWindowsGithubActions5.ps126
  4. Docker Extraction: In Docker-based runs, docker cp is used to pull TestOutput and .trx files from the container to the host before zipping scripts/ExecutingTestsOnDockerGithubActions.ps19-14

Utility and Deployment Scripts

Sources: