Files
lmxopcua/scripts/integration
Joseph Doherty a25593a9c6 chore: organize solution into module folders (Core/Server/Drivers/Client/Tooling)
Group all 69 projects into category subfolders under src/ and tests/ so the
Rider Solution Explorer mirrors the module structure. Folders: Core, Server,
Drivers (with a nested Driver CLIs subfolder), Client, Tooling.

- Move every project folder on disk with git mv (history preserved as renames).
- Recompute relative paths in 57 .csproj files: cross-category ProjectReferences,
  the lib/ HintPath+None refs in Driver.Historian.Wonderware, and the external
  mxaccessgw refs in Driver.Galaxy and its test project.
- Rebuild ZB.MOM.WW.OtOpcUa.slnx with nested solution folders.
- Re-prefix project paths in functional scripts (e2e, compliance, smoke SQL,
  integration, install).

Build green (0 errors); unit tests pass. Docs left for a separate pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 01:55:28 -04:00
..

Integration runners

Scripts that orchestrate multi-component integration-test loops — each one wires up docker fixtures, support binaries, and dotnet test in sequence so a developer (or a CI agent) can get from "freshly cloned repo" to "green integration suite" with one command.

Unlike scripts/e2e/test-*.ps1 (which drive the built server through the CLI for black-box coverage), scripts in this folder operate below the server layer — they bring up the raw fixtures the driver-level IntegrationTests projects need.

Scripts

Script Purpose
run-focas.ps1 FOCAS driver: builds shim DLLs + starts focas-mock docker + copies shim into test bin + runs WireCompatGatedTests + FocasSimSmokeTests + tears down docker

run-focas.ps1

Prerequisites

  • Windows + PowerShell 7+
  • .NET 10 SDKdotnet --version prints 10.x
  • Native C compiler — one of:
    • Visual Studio Build Tools with the C++ workload (then run from an "x64 Native Tools Command Prompt for VS" shell), or
    • Zig (zig.exe on PATH) as a drop-in alternative
  • Docker Desktop running, OR pass -SkipDocker and run the mock externally

One-shot run

cd C:\Users\dohertj2\Desktop\lmxopcua
pwsh .\scripts\integration\run-focas.ps1

That's the default invocation: thirtyone profile, debug build, docker cleans up on exit.

Development iteration

Re-run the tests without rebuilding the shim or restarting docker:

# First run bootstraps everything + keeps the mock up.
pwsh .\scripts\integration\run-focas.ps1 -KeepDocker

# Iterate on test bodies without re-doing the slow steps.
pwsh .\scripts\integration\run-focas.ps1 -SkipShimBuild -SkipDocker

Per-series runs

pwsh .\scripts\integration\run-focas.ps1 -Profile thirty     # 30i series
pwsh .\scripts\integration\run-focas.ps1 -Profile zerod      # 0i-D
pwsh .\scripts\integration\run-focas.ps1 -Profile powermotion

Full profile list is in tests/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.IntegrationTests/Docker/docker-compose.yml.

Exit codes

Code Meaning
0 All tests passed or cleanly skipped
1 dotnet test reported failures
2 The runner itself crashed (missing file, unexpected exception)
3 No C compiler detected for shim build
4 Docker CLI not on PATH

CI integration

Wire this into the project's CI runner (Gitea Actions, Jenkins, whatever's hosting this repo) by calling:

- name: FOCAS integration
  shell: pwsh
  run: ./scripts/integration/run-focas.ps1

The script is idempotent; a previous run's docker compose down failure won't block the next one.