Skip to content

OPCUA-3461 Add generator-selection invariant test - #387

Merged
parasxos merged 2 commits into
masterfrom
OPCUA-3360B_generator_selection_invariant
Jul 30, 2026
Merged

OPCUA-3461 Add generator-selection invariant test#387
parasxos merged 2 commits into
masterfrom
OPCUA-3360B_generator_selection_invariant

Conversation

@parasxos

Copy link
Copy Markdown
Contributor

What

A fourth hermetic invariants test, .CI/test_generator_selection.py, guarding the CMake generator-selection contract of generateCmake.py at the argv level — plus wiring into both invariants lanes (alma9 + WS2025).

Why

The OPCUA-3360 fix removed the dead hardcoded Visual Studio 15 2017 Win64 generator: with no env set, CMake now auto-detects the installed Visual Studio. But every Windows CI build job exports QUASAR_CMAKE_GENERATOR=Ninja, and the BE-ICS w2025 provisioning (quasar-team/images) sets no generator env at all — so the no-env auto-detect path, the exact path a developer on a provisioned box hits out of the box, had zero CI coverage. A regression there would ship green and surface only on BE-ICS machines.

The 6 cases

Forced OS Setup Must produce
Windows nothing set no -G (auto-detect — the BE-ICS out-of-box path)
Windows QUASAR_CMAKE_GENERATOR=Ninja -G Ninja (the CI path)
Windows generator + QUASAR_CMAKE_GENERATOR_PLATFORM=x64 -G … -A x64
Windows _PLATFORM alone no -G, no -A
Linux default no -G
Linux --builder Ninja -G Ninja

Every case additionally asserts the dead Visual Studio 15 2017 string never reappears.

Hermetic in the style of the existing three invariants: the module graph is stubbed, subprocessWithImprovedErrors captures the argv instead of executing — no CMake, no compiler, any host OS. Mutation-tested: re-introducing the old hardcode fails 4 of 6 cases, exit 1.

Also

The WS2025 invariants step ran all tests as bare pwsh lines — a step fails only on the last command's exit code, so an early test failure could be masked by a later pass. Each test now gets an explicit exit-code check (same chk pattern the SDK build step uses).

@parasxos parasxos changed the title Add generator-selection invariant test (OPCUA-3360 follow-up) OPCUA-3461 Add generator-selection invariant test Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also contains another important fix. Without chk() earlier scripts could fail and the job succeed.
You can separate this to another commit but not necessary in my opinion.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tempfile.mkdtemp() dirs created on run_case() are not cleared. In test_no_unbound_delegate.py there is try/finally and shutil.rmtree(tmp, ignore_errors=True) which clears the generated dirs.
Worth to add this for consistency on run_case()

jimmat92
jimmat92 previously approved these changes Jul 30, 2026
@parasxos
parasxos merged commit c0a9c24 into master Jul 30, 2026
74 checks passed
@parasxos parasxos mentioned this pull request Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants