-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added RepeatAttribute that is aware of RandomizedContext (#1125)
* Lucene.Net.Util.LuceneTestCase.LuceneDelegatingTestCommand::Execute(): Only create an instance of TestResult if it is not already instantiated. * Lucene.Net.Util.LuceneTestCase: Added RepeatAttribute that is RandomizedContext aware. Added tests from NUnit to verify it passes RepeatAttribute tests. * SWEEP: Added URLs of source code from randomizedtesting and NUnit to files that were copied from those libraries * Lucene.Net.TestData.RepeatingTests.RepeatingTestsFixtureBase: Added asserts to ensure the random seed and test seed in RandomizedContext are being updated consistently and correctly * Lucene.Net.Util.LuceneTestCase.RepeatAttribute: Added more robust subclass checking and a test to ensure that we receive the correct result * publish-test-results-for-test-projects.yml: Added Lucene.Net.Tests.TestFramework.NUnitExtensions * .github/workflows: Generated Lucene-Net-Tests-TestFramework-NUnitExtensions workflow file * LICENSE.txt: Added attribution of new test projects for NUnit extensions * Lucene.Net.Util.LuceneRandomSeedInitializer: Removed TODO * Lucene.Net.Util.LuceneTestCase.RepeatAttribute: Fixed method name of SetResultErrorNonLuceneTestCaseSubclass
- Loading branch information
1 parent
b1d309f
commit fa630da
Showing
24 changed files
with
1,501 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
.github/workflows/Lucene-Net-Tests-TestFramework-NUnitExtensions.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#################################################################################### | ||
# DO NOT EDIT: This file was automatically generated by Generate-TestWorkflows.ps1 | ||
#################################################################################### | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# 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 | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: 'Lucene.Net.Tests.TestFramework.NUnitExtensions' | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- 'src/Lucene.Net.Tests.TestFramework.NUnitExtensions/**/*' | ||
- '.build/dependencies.props' | ||
- '.build/TestReferences.Common.*' | ||
- 'TestTargetFrameworks.*' | ||
- '.github/**/*.yml' | ||
- '*.sln' | ||
- 'src/Lucene.Net.Tests.TestFramework.NUnitExtensions/Directory.Build.*' | ||
- 'src/Directory.Build.*' | ||
- 'Directory.Build.*' | ||
|
||
# Dependencies | ||
- 'src/Lucene.Net/**/*' | ||
- 'src/Lucene.Net.Analysis.Common/**/*' | ||
- 'src/Lucene.Net.Codecs/**/*' | ||
- 'src/Lucene.Net.TestFramework/**/*' | ||
- 'src/dotnet/Lucene.Net.TestFramework.TestData.NUnit/**/*' | ||
|
||
- '!**/*.md' | ||
|
||
jobs: | ||
|
||
Test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, ubuntu-latest] | ||
framework: [net9.0, net8.0, net6.0, net48, net472] | ||
platform: [x64] | ||
configuration: [Release] | ||
exclude: | ||
- os: ubuntu-latest | ||
framework: net48 | ||
- os: ubuntu-latest | ||
framework: net472 | ||
- os: macos-latest | ||
framework: net48 | ||
- os: macos-latest | ||
framework: net472 | ||
env: | ||
project_path: './src/Lucene.Net.Tests.TestFramework.NUnitExtensions/Lucene.Net.Tests.TestFramework.NUnitExtensions.csproj' | ||
run_slow_tests: 'false' | ||
trx_file_name: 'TestResults.trx' | ||
md_file_name: 'TestResults.md' # Report file name for LiquidTestReports.Markdown | ||
|
||
steps: | ||
- name: Checkout Source Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Disable .NET SDK Telemetry and Logo | ||
run: | | ||
echo "DOTNET_NOLOGO=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
shell: pwsh | ||
|
||
- name: Setup .NET 6 SDK | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '6.0.x' | ||
if: ${{ startswith(matrix.framework, 'net6.') }} | ||
|
||
- name: Setup .NET 8 SDK | ||
uses: actions/setup-dotnet@v3 | ||
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) | ||
$test_results_artifact_name = "testresults_${{matrix.os}}_${{matrix.framework}}_${{matrix.platform}}_${{matrix.configuration}}" | ||
$working_directory = "$env:GITHUB_WORKSPACE" | ||
Write-Host "Project Name: $project_name" | ||
Write-Host "Results Artifact Name: $test_results_artifact_name" | ||
Write-Host "Working Directory: $working_directory" | ||
echo "project_name=$project_name" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
echo "test_results_artifact_name=$test_results_artifact_name" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
# Set the Azure DevOps default working directory env variable, so our tests only need to deal with a single env variable | ||
echo "SYSTEM_DEFAULTWORKINGDIRECTORY=$working_directory" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
# Title for LiquidTestReports.Markdown | ||
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
shell: pwsh | ||
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true | ||
- run: dotnet test ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-build --no-restore --blame-hang --blame-hang-dump-type mini --blame-hang-timeout 20minutes --logger:"console;verbosity=normal" --logger:"trx;LogFileName=${{env.trx_file_name}}" --logger:"liquid.md;LogFileName=${{env.md_file_name}};Title=${{env.title}};" --results-directory:"${{github.workspace}}/${{env.test_results_artifact_name}}/${{env.project_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} NUnit.DisplayName=FullName TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\) | ||
shell: bash | ||
# upload reports as build artifacts | ||
- name: Upload a Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
if: ${{always()}} | ||
with: | ||
name: '${{env.test_results_artifact_name}}' | ||
path: '${{github.workspace}}/${{env.test_results_artifact_name}}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/Lucene.Net.TestFramework/Support/Util/DefaultNamespaceTypeWrapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/Lucene.Net.TestFramework/Support/Util/DisposableResourceInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.