Restore CustomTestTarget passthrough for Channels.Stress.Tests

The previous unconditional <TargetFrameworks>net8.0;net9.0;net10.0</> broke
the CI matrix because referenced library projects only multi-target the
single CustomTestTarget TFM (net10.0). NU1201 errors followed because the
stress tests still asked for net8.0/net9.0.

Make the TFM list conditional: keep the modern-only list when CustomTestTarget
is unset (CodeQL whole-solution builds) and pass through TestsTargetFrameworks
when it is set (standard buildandtest matrix, single-TFM dev builds).
This commit is contained in:
Marc Schier
2026-06-06 10:37:57 +02:00
parent 48b24bec40
commit d5f1dbbc36
@@ -5,11 +5,13 @@
Stress/chaos tests rely on modern primitives (Task.Delay TimeProvider
overloads, RandomNumberGenerator.GetInt32, Math.Clamp,
ValueTask.CompletedTask, IClientChannelManager.ReconnectAsync(budget))
that do not exist on net48/net472. Restrict TFMs to the supported set
so CodeQL and other whole-solution builds do not try to compile this
project against the legacy frameworks.
that do not exist on net48/net472. When CustomTestTarget is unset
(e.g. CodeQL whole-solution build) restrict to the supported TFMs.
When CustomTestTarget is set the standard TestsTargetFrameworks
pipeline takes over so the matrix can still drive a single TFM.
-->
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks Condition="'$(CustomTestTarget)' == ''">net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks Condition="'$(CustomTestTarget)' != ''">$(TestsTargetFrameworks)</TargetFrameworks>
<RootNamespace>Opc.Ua.Channels.Stress.Tests</RootNamespace>
<GenerateProgramFile>false</GenerateProgramFile>
<Nullable>annotations</Nullable>