Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
script updates
  • Loading branch information
m-redding committed Nov 7, 2025
commit daf19635f396f6defda3bd5a4fce529f45c57221
19 changes: 8 additions & 11 deletions eng/scripts/compatibility/Check-AOT-Compatibility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@ foreach ($line in $aotCompatLines) {
}
}

exit 0

### Creating a test app ###

Write-Host "Creating a test app to publish."

$expectedWarningsFullPath = Join-Path -Path "..\..\..\..\sdk\$ServiceDirectory\" -ChildPath $ExpectedWarningsFilePath

# Set the project reference path based on whether DirectoryName was provided
if ([string]::IsNullOrEmpty($DirectoryName)) {
$projectRefFullPath = "..\..\..\..\sdk\$ServiceDirectory\$PackageName\src\$PackageName.csproj"
Expand Down Expand Up @@ -138,25 +134,24 @@ foreach ($line in $($publishOutput -split "`r`n"))
}
}

Write-Host "There were $actualWarningCount warnings reported."
### Compare to baselined warnings ###

### Reading the contents of the text file path ###
# Baselining warnings is only allowed for a couple of the Azure.Core.* packages, hard code the file path to the expected
# warnings as a backdoor for those packages.

Write-Host "Reading the list of patterns that represent the list of expected warnings."
$expectedWarningsPath = "..\..\..\..\sdk\$ServiceDirectory\$PackageName\tests\compatibility\ExpectedAotWarnings.txt"

if (Test-Path $expectedWarningsFullPath -PathType Leaf) {
# Read the contents of the file and store each line in an array
$expectedWarnings = Get-Content -Path $expectedWarningsFullPath
} else {
# If no correct expected warnings were provided, check that there are no warnings reported.

Write-Host "The specified file does not exist. Assuming no warnings are expected."

$warnings = $publishOutput -split "`n" | select-string -pattern 'IL\d+' | select-string -pattern '##' -notmatch
$numWarnings = $warnings.Count

if ($numWarnings -gt 0) {
Write-Host "Found $numWarnings additional warnings that were not expected:" -ForegroundColor Red
Write-Host "Found $numWarnings AOT warnings:" -ForegroundColor Red
foreach ($warning in $warnings) {
Write-Host $warning -ForegroundColor Yellow
}
Expand All @@ -174,9 +169,11 @@ if (Test-Path $expectedWarningsFullPath -PathType Leaf) {

### Comparing expected warnings to the publish output ###

Write-Host "There were $actualWarningCount warnings reported from the publish."

$numExpectedWarnings = $expectedWarnings.Count

Write-Host "Checking against the list of expected warnings. There are $numExpectedWarnings warnings expected."
Write-Host "There are $numExpectedWarnings warnings expected."

$warnings = $publishOutput -split "`n" | select-string -pattern 'IL\d+' | select-string -pattern '##' -notmatch | select-string -pattern $expectedWarnings -notmatch
$numWarnings = $warnings.Count
Expand Down
Empty file.
Loading