From 9c88340caaf2a9fda404aba4958b51b8c3e7e8a4 Mon Sep 17 00:00:00 2001 From: Paul Irwin Date: Thu, 12 Dec 2024 08:21:10 -0700 Subject: [PATCH] Run tests on .NET 9, #1019 (#1052) * Run tests on .NET 9; add polyfill for Stream.ReadExactly, #1019 * Add net9.0 to Tests.Analysis.OpenNLP * Regenerate github test workflows * Fix assertion issue with .NET 9 x64 returning different results for long conversion overflow, #1019 * Add net9.0 to Tests.Cli * Regenerate github workflow for cli * Include net9.0 in x86 install hack; add LUCENENET comments to ReadExactly use * Regenerate github workflow for CodeAnalysis * Add .NET 8 SDK conditionally for ADO build * Fix typos in publish-test-binaries.yml * Only target net9.0 for Tests.CodeAnalysis * Remove ReadExactly usage * Use windows-latest in ADO pipeline * Update CodeAnalysis GitHub workflow * Remove case to install .NET 9 x86 SDK on .NET 8 x86 test run --- .../azure-templates/publish-test-binaries.yml | 12 +-- .build/azure-templates/run-tests-on-os.yml | 30 +++++- .build/runbuild.ps1 | 2 +- .github/workflows/Generate-TestWorkflows.ps1 | 16 ++- .../Lucene-Net-Tests-AllProjects.yml | 7 +- .../Lucene-Net-Tests-Analysis-Common.yml | 7 +- .../Lucene-Net-Tests-Analysis-Kuromoji.yml | 7 +- .../Lucene-Net-Tests-Analysis-Morfologik.yml | 7 +- .../Lucene-Net-Tests-Analysis-OpenNLP.yml | 7 +- .../Lucene-Net-Tests-Analysis-Phonetic.yml | 7 +- .../Lucene-Net-Tests-Analysis-SmartCn.yml | 7 +- .../Lucene-Net-Tests-Analysis-Stempel.yml | 7 +- .../workflows/Lucene-Net-Tests-Benchmark.yml | 7 +- .../Lucene-Net-Tests-Classification.yml | 7 +- .github/workflows/Lucene-Net-Tests-Cli.yml | 7 +- .../Lucene-Net-Tests-CodeAnalysis.yml | 7 +- .github/workflows/Lucene-Net-Tests-Codecs.yml | 7 +- .github/workflows/Lucene-Net-Tests-Demo.yml | 7 +- .../Lucene-Net-Tests-Expressions.yml | 7 +- .github/workflows/Lucene-Net-Tests-Facet.yml | 7 +- .../workflows/Lucene-Net-Tests-Grouping.yml | 7 +- .../Lucene-Net-Tests-Highlighter.yml | 7 +- .github/workflows/Lucene-Net-Tests-ICU.yml | 7 +- .github/workflows/Lucene-Net-Tests-Join.yml | 7 +- .github/workflows/Lucene-Net-Tests-Memory.yml | 7 +- .github/workflows/Lucene-Net-Tests-Misc.yml | 7 +- .../workflows/Lucene-Net-Tests-Queries.yml | 7 +- .../Lucene-Net-Tests-QueryParser.yml | 7 +- .../workflows/Lucene-Net-Tests-Replicator.yml | 7 +- .../workflows/Lucene-Net-Tests-Sandbox.yml | 7 +- .../workflows/Lucene-Net-Tests-Spatial.yml | 7 +- .../workflows/Lucene-Net-Tests-Suggest.yml | 7 +- ...ests-TestFramework-DependencyInjection.yml | 7 +- .../Lucene-Net-Tests-TestFramework.yml | 7 +- .github/workflows/Lucene-Net-Tests-_A-D.yml | 7 +- .github/workflows/Lucene-Net-Tests-_E-I.yml | 7 +- .github/workflows/Lucene-Net-Tests-_I-J.yml | 7 +- .github/workflows/Lucene-Net-Tests-_J-S.yml | 7 +- .github/workflows/Lucene-Net-Tests-_T-Z.yml | 7 +- Directory.Build.targets | 43 +++++--- TestTargetFramework.props | 6 +- azure-pipelines.yml | 99 ++++++++++++++++--- .../Lucene.Net.Tests.Analysis.OpenNLP.csproj | 2 +- .../JS/TestJavascriptOperations.cs | 12 ++- .../TestQueryParserResourceProvider.cs | 4 +- .../IndexAndTaxonomyRevisionTest.cs | 7 +- .../IndexInputStreamTest.cs | 8 +- .../IndexRevisionTest.cs | 7 +- .../Util/TestOfflineSorter.cs | 8 +- .../Lucene.Net.CodeAnalysis.CSharp.csproj | 4 +- ...Lucene.Net.CodeAnalysis.VisualBasic.csproj | 5 +- .../Lucene.Net.Tests.CodeAnalysis.csproj | 8 +- .../Lucene.Net.Tests.Cli.csproj | 2 +- 53 files changed, 419 insertions(+), 101 deletions(-) diff --git a/.build/azure-templates/publish-test-binaries.yml b/.build/azure-templates/publish-test-binaries.yml index 870aca6918..b65fcfd2d8 100644 --- a/.build/azure-templates/publish-test-binaries.yml +++ b/.build/azure-templates/publish-test-binaries.yml @@ -5,9 +5,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -19,7 +19,7 @@ # to the binary publish subdirectory for the provided target # framework, and then publishes to an pipeline artifact. -# NOTE: Depends on environment varable $(RunTests) +# NOTE: Depends on environment variable $(RunTests) parameters: publishDirectory: '' # The path of the root publish staging directory where the binaries can be found $(PublishTempDirectory) @@ -27,20 +27,20 @@ parameters: binaryArtifactName: '' # The prefix of the binary artifact to publish $(BinaryArtifactName) testSettingsFilePath: '$(Build.ArtifactStagingDirectory)/lucene.testsettings.json' #The name of the lucene test settings file solution: '$(Build.SourcesDirectory)/Lucene.Net.sln' - configration: '$(BuildConfiguration)' # The build configuration + configuration: '$(BuildConfiguration)' # The build configuration platform: '$(BuildPlatform)' # The build platform steps: - pwsh: | $solution = "${{ parameters.solution }}" - $configuration = "${{ parameters.configration }}" + $configuration = "${{ parameters.configuration }}" $framework = "${{ parameters.framework }}" $publishDirectory = "${{ parameters.publishDirectory }}" Write-Host "solution: $solution" Write-Host "configuration: $configuration" Write-Host "framework: $framework" Write-Host "publishDirectory: $publishDirectory" - &dotnet publish "${{ parameters.solution }}" --configuration "${{ parameters.configration }}" --framework: "${{ parameters.framework }}" --no-build --no-restore --verbosity normal /p:TestFrameworks=true /p:Platform="${{ parameters.platform }}" /p:AlternatePublishRootDirectory="${{ parameters.publishDirectory }}" + &dotnet publish "${{ parameters.solution }}" --configuration "${{ parameters.configuration }}" --framework: "${{ parameters.framework }}" --no-build --no-restore --verbosity normal /p:TestFrameworks=true /p:Platform="${{ parameters.platform }}" /p:AlternatePublishRootDirectory="${{ parameters.publishDirectory }}" displayName: 'Publish Projects for ${{ parameters.framework }}' condition: and(succeeded(), ne(variables['RunTests'], 'false')) diff --git a/.build/azure-templates/run-tests-on-os.yml b/.build/azure-templates/run-tests-on-os.yml index dabe18ae46..b0635e9c60 100644 --- a/.build/azure-templates/run-tests-on-os.yml +++ b/.build/azure-templates/run-tests-on-os.yml @@ -90,7 +90,7 @@ steps: sdkVersion: '${{ parameters.dotNetSdkVersion }}' performMultiLevelLookup: '${{ variables.PerformMultiLevelLookup }}' - # Hack: .NET 8 no longer installs the x86 bits and they must be installed separately. However, it is not + # Hack: .NET 8+ no longer installs the x86 bits and they must be installed separately. However, it is not # trivial to get it into the path and to get it to pass the minimum SDK version check in runbuild.ps1. # So, we install it afterward and set the environment variable so the above SDK can delegate to it. # This code only works on Windows. @@ -105,8 +105,34 @@ steps: & $installScriptPath -Version $sdkVersion -Architecture $architecture -InstallDir $installPath Write-Host "##vso[task.setvariable variable=DOTNET_ROOT_X86;]$installPath" displayName: 'Use .NET SDK ${{ parameters.dotNetSdkVersion }} (x86)' + condition: and(succeeded(), contains('${{ parameters.framework }}', 'net9.'), eq('${{ parameters.vsTestPlatform }}', 'x86')) + +- task: UseDotNet@2 + displayName: 'Use .NET SDK 8.0.404' + inputs: + packageType: 'sdk' + version: '8.0.404' + performMultiLevelLookup: '${{ variables.PerformMultiLevelLookup }}' + condition: and(succeeded(), contains('${{ parameters.framework }}', 'net8.')) + + # Hack: .NET 8+ no longer installs the x86 bits and they must be installed separately. However, it is not + # trivial to get it into the path and to get it to pass the minimum SDK version check in runbuild.ps1. + # So, we install it afterward and set the environment variable so the above SDK can delegate to it. + # This code only works on Windows. +- pwsh: | + $sdkVersion = '8.0.404' + $architecture = '${{ parameters.vsTestPlatform }}' + $installScriptPath = "${env:AGENT_TEMPDIRECTORY}/dotnet-install.ps1" + $installScriptUrl = "https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1" + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + Invoke-WebRequest $installScriptUrl -OutFile $installScriptPath -TimeoutSec 60 + $installPath = "${env:ProgramFiles(x86)}/dotnet" + & $installScriptPath -Version $sdkVersion -Architecture $architecture -InstallDir $installPath + Write-Host "##vso[task.setvariable variable=DOTNET_ROOT_X86;]$installPath" + displayName: 'Use .NET SDK 8.0.404 (x86)' condition: and(succeeded(), contains('${{ parameters.framework }}', 'net8.'), eq('${{ parameters.vsTestPlatform }}', 'x86')) + - task: UseDotNet@2 displayName: 'Use .NET SDK 6.0.421' inputs: @@ -115,7 +141,7 @@ steps: performMultiLevelLookup: '${{ variables.PerformMultiLevelLookup }}' condition: and(succeeded(), contains('${{ parameters.framework }}', 'net6.')) - # Hack: .NET 8 no longer installs the x86 bits and they must be installed separately. However, it is not + # Hack: .NET 8+ no longer installs the x86 bits and they must be installed separately. However, it is not # trivial to get it into the path and to get it to pass the minimum SDK version check in runbuild.ps1. # So, we install it afterward and set the environment variable so the above SDK can delegate to it. # This code only works on Windows. diff --git a/.build/runbuild.ps1 b/.build/runbuild.ps1 index 4c0ebd8f81..97bd118e6d 100644 --- a/.build/runbuild.ps1 +++ b/.build/runbuild.ps1 @@ -27,7 +27,7 @@ properties { [string]$testResultsDirectory = "$artifactsDirectory/TestResults" [string]$publishDirectory = "$artifactsDirectory/Publish" [string]$solutionFile = "$baseDirectory/Lucene.Net.sln" - [string]$minimumSdkVersion = "8.0.100" + [string]$minimumSdkVersion = "9.0.100" [string]$globalJsonFile = "$baseDirectory/global.json" [string]$versionPropsFile = "$baseDirectory/version.props" [string]$luceneReadmeFile = "$baseDirectory/src/Lucene.Net/readme-nuget.md" diff --git a/.github/workflows/Generate-TestWorkflows.ps1 b/.github/workflows/Generate-TestWorkflows.ps1 index 7faa3b7ccb..e292365337 100644 --- a/.github/workflows/Generate-TestWorkflows.ps1 +++ b/.github/workflows/Generate-TestWorkflows.ps1 @@ -38,7 +38,7 @@ .PARAMETER TestFrameworks A string array of Dotnet target framework monikers to run the tests on. The default is - @('net8.0','net6.0','net472','net48'). + @('net9.0','net8.0','net6.0','net472','net48'). .PARAMETER OperatingSystems A string array of Github Actions operating system monikers to run the tests on. @@ -51,6 +51,10 @@ .PARAMETER Configurations A string array of build configurations to run the tests on. The default is @('Release'). + .PARAMETER DotNet9SDKVersion + The SDK version of .NET 9.x to install on the build agent to be used for building and + testing. This SDK is always installed on the build agent. The default is 9.0.x. + .PARAMETER DotNet8SDKVersion The SDK version of .NET 8.x to install on the build agent to be used for building and testing. This SDK is always installed on the build agent. The default is 8.0.x. @@ -64,7 +68,7 @@ param( [string]$RepoRoot = (Split-Path (Split-Path $PSScriptRoot)), - [string[]]$TestFrameworks = @('net8.0','net6.0','net472','net48'), # targets under test: net8.0, netstandard2.1, netstandard2.0, net462 + [string[]]$TestFrameworks = @('net9.0','net8.0','net6.0','net472','net48'), # targets under test: net8.0, net8.0, netstandard2.1, netstandard2.0, net462 [string[]]$OperatingSystems = @('windows-latest', 'ubuntu-latest'), @@ -72,6 +76,8 @@ param( [string[]]$Configurations = @('Release'), + [string]$DotNet9SDKVersion = '9.0.x', + [string]$DotNet8SDKVersion = '8.0.x', [string]$DotNet6SDKVersion = '6.0.x' @@ -154,6 +160,7 @@ function Write-TestWorkflow( [string[]]$TestFrameworks = @('net6.0', 'net48'), [string[]]$TestPlatforms = @('x64'), [string[]]$OperatingSystems = @('windows-latest', 'ubuntu-latest', 'macos-latest'), + [string]$DotNet9SDKVersion = $DotNet9SDKVersion, [string]$DotNet8SDKVersion = $DotNet8SDKVersion, [string]$DotNet6SDKVersion = $DotNet6SDKVersion) { @@ -286,6 +293,11 @@ jobs: with: dotnet-version: '$DotNet8SDKVersion' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '$DotNet9SDKVersion' + - name: Setup Environment Variables run: | `$project_name = [System.IO.Path]::GetFileNameWithoutExtension(`$env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-AllProjects.yml b/.github/workflows/Lucene-Net-Tests-AllProjects.yml index a6ff68b150..040280e26c 100644 --- a/.github/workflows/Lucene-Net-Tests-AllProjects.yml +++ b/.github/workflows/Lucene-Net-Tests-AllProjects.yml @@ -72,7 +72,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -111,6 +111,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-Common.yml b/.github/workflows/Lucene-Net-Tests-Analysis-Common.yml index 0b4bca60cb..df5cdd1ab4 100644 --- a/.github/workflows/Lucene-Net-Tests-Analysis-Common.yml +++ b/.github/workflows/Lucene-Net-Tests-Analysis-Common.yml @@ -56,7 +56,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -95,6 +95,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-Kuromoji.yml b/.github/workflows/Lucene-Net-Tests-Analysis-Kuromoji.yml index 9fb6dbf58c..88996886aa 100644 --- a/.github/workflows/Lucene-Net-Tests-Analysis-Kuromoji.yml +++ b/.github/workflows/Lucene-Net-Tests-Analysis-Kuromoji.yml @@ -53,7 +53,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -92,6 +92,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-Morfologik.yml b/.github/workflows/Lucene-Net-Tests-Analysis-Morfologik.yml index a7327604fd..cead4499f4 100644 --- a/.github/workflows/Lucene-Net-Tests-Analysis-Morfologik.yml +++ b/.github/workflows/Lucene-Net-Tests-Analysis-Morfologik.yml @@ -53,7 +53,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -92,6 +92,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml b/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml index c69a218857..f86bbbddcd 100644 --- a/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml +++ b/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml @@ -56,7 +56,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net48] + framework: [net9.0, net8.0, net48] platform: [x64] configuration: [Release] exclude: @@ -95,6 +95,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-Phonetic.yml b/.github/workflows/Lucene-Net-Tests-Analysis-Phonetic.yml index d666c2e6cf..603de15769 100644 --- a/.github/workflows/Lucene-Net-Tests-Analysis-Phonetic.yml +++ b/.github/workflows/Lucene-Net-Tests-Analysis-Phonetic.yml @@ -50,7 +50,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -89,6 +89,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-SmartCn.yml b/.github/workflows/Lucene-Net-Tests-Analysis-SmartCn.yml index 933ff6785b..0c9e97fd5a 100644 --- a/.github/workflows/Lucene-Net-Tests-Analysis-SmartCn.yml +++ b/.github/workflows/Lucene-Net-Tests-Analysis-SmartCn.yml @@ -54,7 +54,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -93,6 +93,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-Stempel.yml b/.github/workflows/Lucene-Net-Tests-Analysis-Stempel.yml index 3d46e4e1ce..32d3174828 100644 --- a/.github/workflows/Lucene-Net-Tests-Analysis-Stempel.yml +++ b/.github/workflows/Lucene-Net-Tests-Analysis-Stempel.yml @@ -51,7 +51,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -90,6 +90,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Benchmark.yml b/.github/workflows/Lucene-Net-Tests-Benchmark.yml index f478824045..a281360004 100644 --- a/.github/workflows/Lucene-Net-Tests-Benchmark.yml +++ b/.github/workflows/Lucene-Net-Tests-Benchmark.yml @@ -63,7 +63,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -102,6 +102,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Classification.yml b/.github/workflows/Lucene-Net-Tests-Classification.yml index 396ad4196b..5caefbdf38 100644 --- a/.github/workflows/Lucene-Net-Tests-Classification.yml +++ b/.github/workflows/Lucene-Net-Tests-Classification.yml @@ -51,7 +51,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -90,6 +90,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Cli.yml b/.github/workflows/Lucene-Net-Tests-Cli.yml index 32a9e6dde6..b23266308b 100644 --- a/.github/workflows/Lucene-Net-Tests-Cli.yml +++ b/.github/workflows/Lucene-Net-Tests-Cli.yml @@ -70,7 +70,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0] + framework: [net9.0, net8.0] platform: [x64] configuration: [Release] exclude: @@ -110,6 +110,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-CodeAnalysis.yml b/.github/workflows/Lucene-Net-Tests-CodeAnalysis.yml index 9c11c5dbc9..5cbcf1fcc3 100644 --- a/.github/workflows/Lucene-Net-Tests-CodeAnalysis.yml +++ b/.github/workflows/Lucene-Net-Tests-CodeAnalysis.yml @@ -49,7 +49,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0] + framework: [net9.0] platform: [x64] configuration: [Release] exclude: @@ -88,6 +88,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Codecs.yml b/.github/workflows/Lucene-Net-Tests-Codecs.yml index 0a274f570e..f92ac1f283 100644 --- a/.github/workflows/Lucene-Net-Tests-Codecs.yml +++ b/.github/workflows/Lucene-Net-Tests-Codecs.yml @@ -49,7 +49,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -88,6 +88,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Demo.yml b/.github/workflows/Lucene-Net-Tests-Demo.yml index ebe2f2e23a..97a4015d76 100644 --- a/.github/workflows/Lucene-Net-Tests-Demo.yml +++ b/.github/workflows/Lucene-Net-Tests-Demo.yml @@ -58,7 +58,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -97,6 +97,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Expressions.yml b/.github/workflows/Lucene-Net-Tests-Expressions.yml index eea9bfce17..e54a075a20 100644 --- a/.github/workflows/Lucene-Net-Tests-Expressions.yml +++ b/.github/workflows/Lucene-Net-Tests-Expressions.yml @@ -51,7 +51,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -90,6 +90,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Facet.yml b/.github/workflows/Lucene-Net-Tests-Facet.yml index 522ce9dc0e..8fb2874df5 100644 --- a/.github/workflows/Lucene-Net-Tests-Facet.yml +++ b/.github/workflows/Lucene-Net-Tests-Facet.yml @@ -53,7 +53,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -92,6 +92,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Grouping.yml b/.github/workflows/Lucene-Net-Tests-Grouping.yml index 8ad68ec8e4..d50ebcad4c 100644 --- a/.github/workflows/Lucene-Net-Tests-Grouping.yml +++ b/.github/workflows/Lucene-Net-Tests-Grouping.yml @@ -51,7 +51,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -90,6 +90,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Highlighter.yml b/.github/workflows/Lucene-Net-Tests-Highlighter.yml index 0374cd570a..f179c1d0f4 100644 --- a/.github/workflows/Lucene-Net-Tests-Highlighter.yml +++ b/.github/workflows/Lucene-Net-Tests-Highlighter.yml @@ -53,7 +53,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -92,6 +92,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-ICU.yml b/.github/workflows/Lucene-Net-Tests-ICU.yml index 2c09fd2fdf..70bc270fbf 100644 --- a/.github/workflows/Lucene-Net-Tests-ICU.yml +++ b/.github/workflows/Lucene-Net-Tests-ICU.yml @@ -66,7 +66,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -105,6 +105,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Join.yml b/.github/workflows/Lucene-Net-Tests-Join.yml index d45b52409e..eb1b72b467 100644 --- a/.github/workflows/Lucene-Net-Tests-Join.yml +++ b/.github/workflows/Lucene-Net-Tests-Join.yml @@ -52,7 +52,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -91,6 +91,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Memory.yml b/.github/workflows/Lucene-Net-Tests-Memory.yml index c996b24b00..29aef5fec6 100644 --- a/.github/workflows/Lucene-Net-Tests-Memory.yml +++ b/.github/workflows/Lucene-Net-Tests-Memory.yml @@ -54,7 +54,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -93,6 +93,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Misc.yml b/.github/workflows/Lucene-Net-Tests-Misc.yml index fbd15412eb..c83171e955 100644 --- a/.github/workflows/Lucene-Net-Tests-Misc.yml +++ b/.github/workflows/Lucene-Net-Tests-Misc.yml @@ -50,7 +50,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -89,6 +89,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Queries.yml b/.github/workflows/Lucene-Net-Tests-Queries.yml index e88e22adfd..3073b3d0d8 100644 --- a/.github/workflows/Lucene-Net-Tests-Queries.yml +++ b/.github/workflows/Lucene-Net-Tests-Queries.yml @@ -50,7 +50,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -89,6 +89,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-QueryParser.yml b/.github/workflows/Lucene-Net-Tests-QueryParser.yml index 79f235ba2f..37a6f3a149 100644 --- a/.github/workflows/Lucene-Net-Tests-QueryParser.yml +++ b/.github/workflows/Lucene-Net-Tests-QueryParser.yml @@ -56,7 +56,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -95,6 +95,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Replicator.yml b/.github/workflows/Lucene-Net-Tests-Replicator.yml index 53f655a132..114b882f9d 100644 --- a/.github/workflows/Lucene-Net-Tests-Replicator.yml +++ b/.github/workflows/Lucene-Net-Tests-Replicator.yml @@ -55,7 +55,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -94,6 +94,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Sandbox.yml b/.github/workflows/Lucene-Net-Tests-Sandbox.yml index 07782e84df..8067ad8f59 100644 --- a/.github/workflows/Lucene-Net-Tests-Sandbox.yml +++ b/.github/workflows/Lucene-Net-Tests-Sandbox.yml @@ -51,7 +51,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -90,6 +90,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Spatial.yml b/.github/workflows/Lucene-Net-Tests-Spatial.yml index 60cb289614..53bbbd8952 100644 --- a/.github/workflows/Lucene-Net-Tests-Spatial.yml +++ b/.github/workflows/Lucene-Net-Tests-Spatial.yml @@ -52,7 +52,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -91,6 +91,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-Suggest.yml b/.github/workflows/Lucene-Net-Tests-Suggest.yml index ec610d3601..4c9d33de87 100644 --- a/.github/workflows/Lucene-Net-Tests-Suggest.yml +++ b/.github/workflows/Lucene-Net-Tests-Suggest.yml @@ -53,7 +53,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -92,6 +92,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-TestFramework-DependencyInjection.yml b/.github/workflows/Lucene-Net-Tests-TestFramework-DependencyInjection.yml index 38c10f408e..e36db65f27 100644 --- a/.github/workflows/Lucene-Net-Tests-TestFramework-DependencyInjection.yml +++ b/.github/workflows/Lucene-Net-Tests-TestFramework-DependencyInjection.yml @@ -49,7 +49,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -88,6 +88,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-TestFramework.yml b/.github/workflows/Lucene-Net-Tests-TestFramework.yml index 6909acad53..b757190edb 100644 --- a/.github/workflows/Lucene-Net-Tests-TestFramework.yml +++ b/.github/workflows/Lucene-Net-Tests-TestFramework.yml @@ -51,7 +51,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -90,6 +90,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-_A-D.yml b/.github/workflows/Lucene-Net-Tests-_A-D.yml index 5ca568ff3e..5389a3dc2c 100644 --- a/.github/workflows/Lucene-Net-Tests-_A-D.yml +++ b/.github/workflows/Lucene-Net-Tests-_A-D.yml @@ -60,7 +60,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -99,6 +99,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-_E-I.yml b/.github/workflows/Lucene-Net-Tests-_E-I.yml index 76c3e22221..a9c7bd08d7 100644 --- a/.github/workflows/Lucene-Net-Tests-_E-I.yml +++ b/.github/workflows/Lucene-Net-Tests-_E-I.yml @@ -70,7 +70,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -109,6 +109,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-_I-J.yml b/.github/workflows/Lucene-Net-Tests-_I-J.yml index 4f5271a7ad..2a5655409e 100644 --- a/.github/workflows/Lucene-Net-Tests-_I-J.yml +++ b/.github/workflows/Lucene-Net-Tests-_I-J.yml @@ -75,7 +75,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -114,6 +114,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-_J-S.yml b/.github/workflows/Lucene-Net-Tests-_J-S.yml index 6aeb2f00f6..e7d5c4314f 100644 --- a/.github/workflows/Lucene-Net-Tests-_J-S.yml +++ b/.github/workflows/Lucene-Net-Tests-_J-S.yml @@ -62,7 +62,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -101,6 +101,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/.github/workflows/Lucene-Net-Tests-_T-Z.yml b/.github/workflows/Lucene-Net-Tests-_T-Z.yml index 3f4996e491..dbc6ac0114 100644 --- a/.github/workflows/Lucene-Net-Tests-_T-Z.yml +++ b/.github/workflows/Lucene-Net-Tests-_T-Z.yml @@ -57,7 +57,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - framework: [net8.0, net6.0, net48, net472] + framework: [net9.0, net8.0, net6.0, net48, net472] platform: [x64] configuration: [Release] exclude: @@ -96,6 +96,11 @@ jobs: with: dotnet-version: '8.0.x' + - name: Setup .NET 9 SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '9.0.x' + - name: Setup Environment Variables run: | $project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path) diff --git a/Directory.Build.targets b/Directory.Build.targets index 331787ecdd..fd71ab0554 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -30,8 +30,15 @@ $(AlternatePublishRootDirectory)/$(TargetFramework)/$(MSBuildProjectName)/ - - + + + + $(DefineConstants);FEATURE_STREAM_READEXACTLY + + + + + $(DefineConstants);FEATURE_RANDOM_NEXTINT64_NEXTSINGLE $(DefineConstants);FEATURE_SPANFORMATTABLE @@ -39,16 +46,16 @@ - - + + $(DefineConstants);FEATURE_ASPNETCORE_ENDPOINT_CONFIG $(DefineConstants);FEATURE_READONLYSET - - + + $(DefineConstants);FEATURE_ARGITERATOR $(DefineConstants);FEATURE_PROCESS_KILL_ENTIREPROCESSTREE @@ -56,8 +63,8 @@ - - + + $(DefineConstants);NETSTANDARD $(DefineConstants);FEATURE_CULTUREINFO_CURRENTCULTURE_SETTER @@ -66,8 +73,8 @@ portable - - + + $(DefineConstants);FEATURE_ARRAY_FILL $(DefineConstants);FEATURE_CONDITIONALWEAKTABLE_ENUMERATOR @@ -79,26 +86,30 @@ - - + + $(DefineConstants);FEATURE_ICONFIGURATIONROOT_PROVIDERS - - + + $(DefineConstants);FEATURE_ASSEMBLY_GETCALLINGASSEMBLY $(DefineConstants);FEATURE_FILESTREAM_LOCK $(DefineConstants);FEATURE_TEXTWRITER_CLOSE - $(DefineConstants);FEATURE_SERIALIZABLE - $(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS $(DefineConstants);FEATURE_THREADPOOL_UNSAFEQUEUEWORKITEM $(DefineConstants);FEATURE_TYPE_GETMETHOD__BINDINGFLAGS_PARAMS + + + $(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS + $(DefineConstants);FEATURE_SERIALIZABLE + + diff --git a/TestTargetFramework.props b/TestTargetFramework.props index a370826384..3b90f2b162 100644 --- a/TestTargetFramework.props +++ b/TestTargetFramework.props @@ -29,7 +29,8 @@ - net8.0 + + net9.0 - net8.0;net6.0 + net9.0;net8.0;net6.0 $(TargetFrameworks);net48;net472 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2c256a7b3b..5771dd7556 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -55,7 +55,7 @@ variables: - name: BuildCounter value: $[counter(variables['VersionSuffix'],coalesce(variables['BuildCounterSeed'], 1250))] - name: DotNetSDKVersion - value: '8.0.204' + value: '9.0.100' - name: DocumentationArtifactName value: 'docs' - name: DocumentationArtifactZipFileName @@ -99,7 +99,7 @@ stages: - job: Build pool: - vmImage: 'windows-2019' + vmImage: 'windows-latest' steps: @@ -229,13 +229,22 @@ stages: displayName: 'Delete temp publish location: $(NuGetArtifactDirectory)' condition: and(succeeded(), ne(variables['RunPack'], 'false')) + - template: '.build/azure-templates/publish-test-binaries.yml' + parameters: + publishDirectory: $(PublishDirectory) + framework: 'net9.0' + binaryArtifactName: '$(BinaryArtifactName)' + testSettingsFilePath: '$(Build.ArtifactStagingDirectory)/$(TestSettingsFileName)' + configuration: '$(BuildConfiguration)' + platform: '$(BuildPlatform)' + - template: '.build/azure-templates/publish-test-binaries.yml' parameters: publishDirectory: $(PublishDirectory) framework: 'net8.0' binaryArtifactName: '$(BinaryArtifactName)' testSettingsFilePath: '$(Build.ArtifactStagingDirectory)/$(TestSettingsFileName)' - configration: '$(BuildConfiguration)' + configuration: '$(BuildConfiguration)' platform: '$(BuildPlatform)' - template: '.build/azure-templates/publish-test-binaries.yml' @@ -244,7 +253,7 @@ stages: framework: 'net6.0' binaryArtifactName: '$(BinaryArtifactName)' testSettingsFilePath: '$(Build.ArtifactStagingDirectory)/$(TestSettingsFileName)' - configration: '$(BuildConfiguration)' + configuration: '$(BuildConfiguration)' platform: '$(BuildPlatform)' - template: '.build/azure-templates/publish-test-binaries.yml' @@ -253,7 +262,7 @@ stages: framework: 'net472' binaryArtifactName: '$(BinaryArtifactName)' testSettingsFilePath: '$(Build.ArtifactStagingDirectory)/$(TestSettingsFileName)' - configration: '$(BuildConfiguration)' + configuration: '$(BuildConfiguration)' platform: '$(BuildPlatform)' - template: '.build/azure-templates/publish-test-binaries.yml' @@ -262,7 +271,7 @@ stages: framework: 'net48' binaryArtifactName: '$(BinaryArtifactName)' testSettingsFilePath: '$(Build.ArtifactStagingDirectory)/$(TestSettingsFileName)' - configration: '$(BuildConfiguration)' + configuration: '$(BuildConfiguration)' platform: '$(BuildPlatform)' - job: Docs @@ -326,6 +335,66 @@ stages: displayName: 'Test Stage:' jobs: + - job: Test_net9_0_x64 + condition: and(succeeded(), ne(variables['RunTests'], 'false')) + strategy: + matrix: + Windows: + osName: 'Windows' + imageName: 'windows-latest' + maximumParallelJobs: 8 + maximumAllowedFailures: 0 # Maximum allowed failures for a successful build + Linux: + osName: 'Linux' + imageName: 'ubuntu-latest' + maximumParallelJobs: 7 + maximumAllowedFailures: 0 # Maximum allowed failures for a successful build + macOS: + osName: 'macOS' + imageName: 'macOS-latest' + maximumParallelJobs: 7 + maximumAllowedFailures: 0 # Maximum allowed failures for a successful build + displayName: 'Test net9.0,x64 on' + pool: + vmImage: $(imageName) + steps: + - template: '.build/azure-templates/run-tests-on-os.yml' + parameters: + osName: $(osName) + framework: 'net9.0' + vsTestPlatform: 'x64' + testBinariesArtifactName: '$(TestBinariesArtifactName)' + nugetArtifactName: '$(NuGetArtifactName)' + testResultsArtifactName: '$(TestResultsArtifactName)' + maximumParallelJobs: $(maximumParallelJobs) + maximumAllowedFailures: $(maximumAllowedFailures) + dotNetSdkVersion: '$(DotNetSDKVersion)' + + - job: Test_net9_0_x86 # Only run Nightly or if explicitly enabled with RunX86Tests + condition: and(succeeded(), ne(variables['RunTests'], 'false'), or(eq(variables['IsNightly'], 'true'), eq(variables['RunX86Tests'], 'true'))) + strategy: + matrix: + Windows: + osName: 'Windows' + imageName: 'windows-latest' + maximumParallelJobs: 8 + maximumAllowedFailures: 0 # Maximum allowed failures for a successful build + displayName: 'Test net9.0,x86 on' + pool: + vmImage: $(imageName) + steps: + - template: '.build/azure-templates/run-tests-on-os.yml' + parameters: + osName: $(osName) + framework: 'net9.0' + vsTestPlatform: 'x86' + testBinariesArtifactName: '$(TestBinariesArtifactName)' + nugetArtifactName: '$(NuGetArtifactName)' + testResultsArtifactName: '$(TestResultsArtifactName)' + maximumParallelJobs: $(maximumParallelJobs) + maximumAllowedFailures: $(maximumAllowedFailures) + dotNetSdkVersion: '$(DotNetSDKVersion)' + - job: Test_net8_0_x64 condition: and(succeeded(), ne(variables['RunTests'], 'false')) strategy: @@ -367,7 +436,7 @@ stages: matrix: Windows: osName: 'Windows' - imageName: 'windows-2019' + imageName: 'windows-latest' maximumParallelJobs: 8 maximumAllowedFailures: 0 # Maximum allowed failures for a successful build displayName: 'Test net8.0,x86 on' @@ -392,7 +461,7 @@ stages: matrix: Windows: osName: 'Windows' - imageName: 'windows-2019' + imageName: 'windows-latest' maximumParallelJobs: 8 maximumAllowedFailures: 0 # Maximum allowed failures for a successful build Linux: @@ -427,7 +496,7 @@ stages: matrix: Windows: osName: 'Windows' - imageName: 'windows-2019' + imageName: 'windows-latest' maximumParallelJobs: 8 maximumAllowedFailures: 0 # Maximum allowed failures for a successful build displayName: 'Test net6.0,x86 on' @@ -452,7 +521,7 @@ stages: matrix: Windows: osName: 'Windows' - imageName: 'windows-2019' + imageName: 'windows-latest' maximumParallelJobs: 8 maximumAllowedFailures: 0 # Maximum allowed failures for a successful build displayName: 'Test net472,x64 on' @@ -477,7 +546,7 @@ stages: matrix: Windows: osName: 'Windows' - imageName: 'windows-2019' + imageName: 'windows-latest' maximumParallelJobs: 8 maximumAllowedFailures: 0 # Maximum allowed failures for a successful build displayName: 'Test net472,x86 on' @@ -500,7 +569,7 @@ stages: condition: and(succeeded(), ne(variables['RunTests'], 'false')) displayName: 'Test net48,x64 on Windows' pool: - vmImage: 'windows-2019' + vmImage: 'windows-latest' steps: - template: '.build/azure-templates/run-tests-on-os.yml' parameters: @@ -518,7 +587,7 @@ stages: condition: and(succeeded(), ne(variables['RunTests'], 'false'), or(eq(variables['IsNightly'], 'true'), eq(variables['RunX86Tests'], 'true'))) displayName: 'Test net48,x86 on Windows' pool: - vmImage: 'windows-2019' + vmImage: 'windows-latest' steps: - template: '.build/azure-templates/run-tests-on-os.yml' parameters: @@ -542,7 +611,7 @@ stages: - job: Publish_Azure_Artifacts condition: and(succeeded(), ne(variables['ArtifactFeedID'], '')) pool: - vmImage: 'windows-2019' + vmImage: 'windows-latest' steps: # We checkout here because we need to publish the source code along with the symbols for debugging @@ -584,7 +653,7 @@ stages: condition: and(succeeded(), eq(variables['IsRelease'], 'true')) displayName: 'Build Release Artifacts for [VOTE]' pool: - vmImage: 'windows-2019' + vmImage: 'windows-latest' steps: # We checkout here because we need to publish the source code along with the binaries per Apache's releae policy diff --git a/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj b/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj index a4cf98a0ca..06e24f5520 100644 --- a/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj +++ b/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj @@ -26,7 +26,7 @@ - net8.0 + net9.0;net8.0 $(TargetFrameworks);net48 Lucene.Net.Tests.Analysis.OpenNLP diff --git a/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs b/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs index 595580a195..bf6d01aaba 100644 --- a/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs +++ b/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs @@ -93,17 +93,19 @@ public virtual void TestDivisionOperation() AssertEvaluatesTo("10/5/2", 1); AssertEvaluatesTo("(27/9)/3", 1); AssertEvaluatesTo("27/(9/3)", 9); - // LUCENENET: division overflow cast to double then to long evaluates to long.MinValue, except on arm64 + // LUCENENET: division overflow cast to double then to long evaluates to long.MinValue, except on arm64 (and .NET 9 x64) // where it matches Java's behavior and Lucene's assertion. This only happens with the conv.i8 opcode with // positive infinity on the stack. 1.0 / 0.0 == double.PositiveInfinity. In C#, if you cast // double.PositiveInfinity to long in an unchecked context it returns 0. The C# spec for conversion in an // unchecked context from double to long states "If the value of the operand is NaN or infinite, the result // of the conversion is an unspecified value of the destination type." Likewise, the docs for conv.i8 state // "If overflow occurs converting a floating-point type to an integer the value returned is unspecified." - // Essentially this is undefined behavior, so we are going to assert an architecture-specific value - // primarily to ensure it produces something rather than throws. CPU architectures other than arm64, x86, - // and x64 may produce different results. - AssertEvaluatesTo("1/0", RuntimeInformation.ProcessArchitecture == Architecture.Arm64 ? 9223372036854775807 : -9223372036854775808); + // Essentially this is undefined behavior, so we are going to assert that it produces one of the two + // known expected values (long.MinValue or long.MaxValue) rather than throws. + // CPU architectures other than arm64, x86, and x64 may produce different results. + Expression evaluator = JavascriptCompiler.Compile("1/0"); + long actual = (long)evaluator.Evaluate(0, null); + Assert.IsTrue(actual is long.MinValue or long.MaxValue, "Expected long.MaxValue or long.MinValue, but got: " + actual); } [Test] diff --git a/src/Lucene.Net.Tests.QueryParser/Support/Flexible/Core/Messages/TestQueryParserResourceProvider.cs b/src/Lucene.Net.Tests.QueryParser/Support/Flexible/Core/Messages/TestQueryParserResourceProvider.cs index 6979df4646..caa4bfab78 100644 --- a/src/Lucene.Net.Tests.QueryParser/Support/Flexible/Core/Messages/TestQueryParserResourceProvider.cs +++ b/src/Lucene.Net.Tests.QueryParser/Support/Flexible/Core/Messages/TestQueryParserResourceProvider.cs @@ -97,7 +97,9 @@ public void TestGetImageAsObject() // Get the expected bytes using var expectedStream = GetType().Assembly.GetManifestResourceStream("Lucene.Net.QueryParsers.Support.Flexible.Core.Messages.lucene-net-icon-32x32.png"); byte[] expectedBytes = new byte[expectedStream.Length]; - expectedStream.Read(expectedBytes, 0, (int)expectedStream.Length); + + var numRead = expectedStream.Read(expectedBytes, 0, (int)expectedStream.Length); // LUCENENET specific - asserting that we read the entire buffer + Assert.AreEqual(expectedStream.Length, numRead); // Check the wrapper to ensure we can read the bytes Assert.AreEqual(expectedBytes, MessagesTest.LUCENE_NET_ICON_32x32); diff --git a/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs b/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs index f12f9972e8..5c1936aeaf 100644 --- a/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs +++ b/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs @@ -178,7 +178,10 @@ public void TestOpen() offset = skip; } src.ReadBytes(srcBytes, offset, srcBytes.Length - offset); - @in.Read(inBytes, offset, inBytes.Length - offset); + + var numRead = @in.Read(inBytes, offset, inBytes.Length - offset); // LUCENENET specific - asserting that we read the entire buffer + assertEquals(inBytes.Length - offset, numRead); + assertArrayEquals(srcBytes, inBytes); } } @@ -189,4 +192,4 @@ public void TestOpen() } } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs b/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs index f060eba98a..25e22f4273 100644 --- a/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs +++ b/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs @@ -30,7 +30,7 @@ namespace Lucene.Net.Tests.Replicator [LuceneNetSpecific] public class IndexInputStreamTest : LuceneTestCase { - + [Test] [LuceneNetSpecific] public void Read_RemainingIndexInputLargerThanReadCount_ReturnsReadCount() @@ -55,7 +55,11 @@ public void Read_RemainingIndexInputLargerThanReadCount_ReturnsExpectedSection([ int readBytes = 1.KiloBytes(); byte[] readBuffer = new byte[readBytes]; for (int i = section; i > 0; i--) - stream.Read(readBuffer, 0, readBytes); + { + var numRead = stream.Read(readBuffer, 0, readBytes); // LUCENENET specific - asserting that we read the entire buffer + Assert.AreEqual(readBytes, numRead); + } + Assert.AreEqual(readBuffer, buffer.Skip((section - 1) * readBytes).Take(readBytes).ToArray()); } diff --git a/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs b/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs index a43a51a364..d3c5a91469 100644 --- a/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs +++ b/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs @@ -160,7 +160,10 @@ public void TestOpen() offset = skip; } src.ReadBytes(srcBytes, offset, srcBytes.Length - offset); - @in.Read(inBytes, offset, inBytes.Length - offset); + + var numRead = @in.Read(inBytes, offset, inBytes.Length - offset); // LUCENENET specific - asserting that we read the entire buffer + assertEquals(inBytes.Length - offset, numRead); + assertArrayEquals(srcBytes, inBytes); IOUtils.Dispose(src, @in); } @@ -171,4 +174,4 @@ public void TestOpen() } } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs b/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs index dc5efe6ea3..3f9ae8929f 100644 --- a/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs +++ b/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs @@ -231,7 +231,9 @@ private void AssertFilesIdentical(FileInfo golden, FileInfo sorted) using Stream is2 = sorted.Open(FileMode.Open, FileAccess.Read, FileShare.Delete); while ((len = is1.Read(buf1, 0, buf1.Length)) > 0) { - is2.Read(buf2, 0, len); + var numRead = is2.Read(buf2, 0, len); // LUCENENET specific - asserting that we read the entire buffer + Assert.AreEqual(len, numRead); + for (int i = 0; i < len; i++) { Assert.AreEqual(buf1[i], buf2[i]); @@ -254,7 +256,9 @@ private void AssertFilesIdentical(FileStream golden, FileStream sorted) Stream is2 = sorted; while ((len = is1.Read(buf1, 0, buf1.Length)) > 0) { - is2.Read(buf2, 0, len); + var numRead = is2.Read(buf2, 0, len); // LUCENENET specific - asserting that we read the entire buffer + Assert.AreEqual(len, numRead); + for (int i = 0; i < len; i++) { Assert.AreEqual(buf1[i], buf2[i]); diff --git a/src/dotnet/Lucene.Net.CodeAnalysis.CSharp/Lucene.Net.CodeAnalysis.CSharp.csproj b/src/dotnet/Lucene.Net.CodeAnalysis.CSharp/Lucene.Net.CodeAnalysis.CSharp.csproj index a631150c12..64220be37d 100644 --- a/src/dotnet/Lucene.Net.CodeAnalysis.CSharp/Lucene.Net.CodeAnalysis.CSharp.csproj +++ b/src/dotnet/Lucene.Net.CodeAnalysis.CSharp/Lucene.Net.CodeAnalysis.CSharp.csproj @@ -24,9 +24,11 @@ netstandard1.3 false + + + false - diff --git a/src/dotnet/Lucene.Net.CodeAnalysis.VisualBasic/Lucene.Net.CodeAnalysis.VisualBasic.csproj b/src/dotnet/Lucene.Net.CodeAnalysis.VisualBasic/Lucene.Net.CodeAnalysis.VisualBasic.csproj index f76baceda0..d24d8db3d1 100644 --- a/src/dotnet/Lucene.Net.CodeAnalysis.VisualBasic/Lucene.Net.CodeAnalysis.VisualBasic.csproj +++ b/src/dotnet/Lucene.Net.CodeAnalysis.VisualBasic/Lucene.Net.CodeAnalysis.VisualBasic.csproj @@ -24,9 +24,12 @@ netstandard1.3 false + + + false - + diff --git a/src/dotnet/Lucene.Net.Tests.CodeAnalysis/Lucene.Net.Tests.CodeAnalysis.csproj b/src/dotnet/Lucene.Net.Tests.CodeAnalysis/Lucene.Net.Tests.CodeAnalysis.csproj index 6c5e8e0573..6af63c3943 100644 --- a/src/dotnet/Lucene.Net.Tests.CodeAnalysis/Lucene.Net.Tests.CodeAnalysis.csproj +++ b/src/dotnet/Lucene.Net.Tests.CodeAnalysis/Lucene.Net.Tests.CodeAnalysis.csproj @@ -22,14 +22,14 @@ - net8.0 + net9.0 Lucene.Net.CodeAnalysis - + false - true + true true - + diff --git a/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj b/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj index 24e943dd06..fc62de828d 100644 --- a/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj +++ b/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj @@ -25,7 +25,7 @@ - net8.0 + net9.0;net8.0 Lucene.Net.Tests.Cli