@@ -172,13 +172,17 @@ public void GetInstallerScript_UsesDirectAcrProvider_IfEnabled_AndSdkIsNotAlread
172172 detector ,
173173 commonOptions : commonOptions ,
174174 sdkAlreadyInstalled : false ,
175- acrSdkProvider : acrSdkProvider ) ;
175+ acrSdkProvider : acrSdkProvider ,
176+ supportedVersions : new Dictionary < string , string >
177+ {
178+ { "3.1.32" , "3.1.426" } ,
179+ } ) ;
176180 var context = CreateContext ( ) ;
177181 var detectorResult = new DotNetCorePlatformDetectorResult
178182 {
179183 Platform = DotNetCoreConstants . PlatformName ,
180- PlatformVersion = "3.1.2 " ,
181- SdkVersion = "3.1.2 " ,
184+ PlatformVersion = "3.1.32 " ,
185+ SdkVersion = "3.1.426 " ,
182186 } ;
183187
184188 // Act
@@ -247,13 +251,17 @@ public void GetInstallerScript_FallsBackToCdn_WhenAllProvidersFail()
247251 sdkAlreadyInstalled : false ,
248252 externalAcrSdkProvider : externalAcrSdkProvider ,
249253 acrSdkProvider : acrSdkProvider ,
250- externalSdkProvider : externalSdkProvider ) ;
254+ externalSdkProvider : externalSdkProvider ,
255+ supportedVersions : new Dictionary < string , string >
256+ {
257+ { "3.1.32" , "3.1.426" } ,
258+ } ) ;
251259 var context = CreateContext ( ) ;
252260 var detectorResult = new DotNetCorePlatformDetectorResult
253261 {
254262 Platform = DotNetCoreConstants . PlatformName ,
255- PlatformVersion = "3.1.2 " ,
256- SdkVersion = "3.1.2 " ,
263+ PlatformVersion = "3.1.32 " ,
264+ SdkVersion = "3.1.426 " ,
257265 } ;
258266
259267 // Act
@@ -285,14 +293,14 @@ public void GetInstallerScript_DirectAcrProvider_PassesRuntimeVersion()
285293 acrSdkProvider : acrSdkProvider ,
286294 supportedVersions : new Dictionary < string , string >
287295 {
288- { "3.1.2 " , "3.1.2 " } ,
296+ { "3.1.32 " , "3.1.426 " } ,
289297 } ) ;
290298 var context = CreateContext ( ) ;
291299 var detectorResult = new DotNetCorePlatformDetectorResult
292300 {
293301 Platform = DotNetCoreConstants . PlatformName ,
294- PlatformVersion = "3.1.2 " ,
295- SdkVersion = "3.1.2 " ,
302+ PlatformVersion = "3.1.32 " ,
303+ SdkVersion = "3.1.426 " ,
296304 } ;
297305
298306 // Act
@@ -302,9 +310,9 @@ public void GetInstallerScript_DirectAcrProvider_PassesRuntimeVersion()
302310 Assert . NotNull ( snippet ) ;
303311 Assert . True ( acrSdkProvider . RequestSdkFromAcrAsyncCalled ) ;
304312 Assert . Equal ( DotNetCoreConstants . PlatformName , acrSdkProvider . LastRequestedPlatformName ) ;
305- Assert . Equal ( "3.1.2 " , acrSdkProvider . LastRequestedVersion ) ;
313+ Assert . Equal ( "3.1.426 " , acrSdkProvider . LastRequestedVersion ) ;
306314 Assert . Equal ( OsTypes . DebianBookworm , acrSdkProvider . LastRequestedDebianFlavor ) ;
307- Assert . Equal ( "3.1.2 " , acrSdkProvider . LastRequestedRuntimeVersion ) ;
315+ Assert . Equal ( "3.1.32 " , acrSdkProvider . LastRequestedRuntimeVersion ) ;
308316 }
309317
310318 [ Fact ]
@@ -329,13 +337,17 @@ public void GetInstallerScript_FallsBackFromExternalAcrToDirectAcr_WhenBothExter
329337 sdkAlreadyInstalled : false ,
330338 externalAcrSdkProvider : externalAcrSdkProvider ,
331339 acrSdkProvider : acrSdkProvider ,
332- externalSdkProvider : externalSdkProvider ) ;
340+ externalSdkProvider : externalSdkProvider ,
341+ supportedVersions : new Dictionary < string , string >
342+ {
343+ { "3.1.32" , "3.1.426" } ,
344+ } ) ;
333345 var context = CreateContext ( ) ;
334346 var detectorResult = new DotNetCorePlatformDetectorResult
335347 {
336348 Platform = DotNetCoreConstants . PlatformName ,
337- PlatformVersion = "3.1.2 " ,
338- SdkVersion = "3.1.2 " ,
349+ PlatformVersion = "3.1.32 " ,
350+ SdkVersion = "3.1.426 " ,
339351 } ;
340352
341353 // Act
@@ -380,8 +392,11 @@ public void ResolveVersions_UsesExternalAcrSdkVersion_WhenEnabled()
380392 // Act
381393 platform . ResolveVersions ( context , detectorResult ) ;
382394
383- // Assert - ExternalACR dictates SDK version, overriding normal map lookup
395+ // Assert - ExternalACR dictates SDK version, overriding normal map lookup.
396+ // PlatformVersion is only processed by hierarchical rules (not fully resolved
397+ // against the version map), so it stays as the detected value.
384398 Assert . Equal ( "3.1.415" , detectorResult . SdkVersion ) ;
399+ Assert . Equal ( "3.1" , detectorResult . PlatformVersion ) ;
385400 }
386401
387402 [ Fact ]
@@ -416,8 +431,10 @@ public void ResolveVersions_FallsBackToVersionMap_WhenExternalAcrReturnsNull()
416431 // Act
417432 platform . ResolveVersions ( context , detectorResult ) ;
418433
419- // Assert - Falls back to normal version map
434+ // Assert - Falls back to normal version map.
435+ // PlatformVersion is fully resolved (hierarchical rules + version map).
420436 Assert . Equal ( "3.1.302" , detectorResult . SdkVersion ) ;
437+ Assert . Equal ( "3.1.2" , detectorResult . PlatformVersion ) ;
421438 }
422439
423440 private BuildScriptGeneratorContext CreateContext ( ISourceRepo sourceRepo = null )
@@ -637,4 +654,4 @@ private DotNetCorePlatform CreatePlatformWithExternalAcrVersionProvider(
637654 new DefaultStandardOutputWriter ( ) ) ;
638655 }
639656 }
640- }
657+ }
0 commit comments