Skip to content

Commit f3ce442

Browse files
nmetulevCopilot
andcommitted
test(e2e): handle experimental runtime package name in PackageShouldIncludeRuntimeDependency
The expected Microsoft.WindowsAppRuntime package name was derived as '.{major}.{minor}', which only matches stable (1.x) packaging. Experimental 2.x ships as 'Microsoft.WindowsAppRuntime.{major}-experimental{N}' (no minor, with the suffix). When the experimental feed bumped to -experimental7 the test started asserting an outdated stable-style name against the actual experimental dependency in the MSIX. Detect the -experimental suffix in the SDK version and build the expected runtime name accordingly. Test-only change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8b4bf30 commit f3ce442

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/winapp-CLI/WinApp.Cli.Tests/EndToEndTests.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,23 @@ public async Task E2E_DotNetApp_PackageShouldIncludeRuntimeDependency(string sdk
249249
Path.Combine(extractDir, "AppxManifest.xml"), TestContext.CancellationToken);
250250

251251
var versionParts = winAppSdkVersion.Split('.');
252-
var expectedRuntimeName = $"Microsoft.WindowsAppRuntime.{versionParts[0]}.{versionParts[1]}";
252+
253+
// Compute expected WindowsAppRuntime package name. Naming convention differs:
254+
// Stable (e.g. 1.8.x) -> Microsoft.WindowsAppRuntime.{major}.{minor}
255+
// Experimental 2.x (e.g. 2.0.0-experimental7) -> Microsoft.WindowsAppRuntime.{major}-experimental{N}
256+
// The experimental suffix lives on the last dotted segment as "...-experimentalN",
257+
// and ships in the runtime name without the minor component.
258+
string expectedRuntimeName;
259+
var experimentalIdx = winAppSdkVersion.IndexOf("-experimental", StringComparison.OrdinalIgnoreCase);
260+
if (experimentalIdx >= 0)
261+
{
262+
var experimentalSuffix = winAppSdkVersion.Substring(experimentalIdx);
263+
expectedRuntimeName = $"Microsoft.WindowsAppRuntime.{versionParts[0]}{experimentalSuffix}";
264+
}
265+
else
266+
{
267+
expectedRuntimeName = $"Microsoft.WindowsAppRuntime.{versionParts[0]}.{versionParts[1]}";
268+
}
253269

254270
Assert.Contains("<PackageDependency", finalManifest,
255271
"Manifest should contain a PackageDependency element");

0 commit comments

Comments
 (0)