diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..4300731 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Can be changed to /.github/workflows/ if necessary. +/.github/ @CirrusRedOrg/ci-admins \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..49d3320 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,304 @@ +name: Build +on: + push: + branches: + - '**' + paths-ignore: + - '**.md' + pull_request: + branches: + - '**' + paths-ignore: + - '**.md' +env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_NOLOGO: true + buildConfiguration: 'Debug' + skipTests: false + deterministicTests: true +jobs: + BuildAndTest: + strategy: + fail-fast: false + matrix: + aceVersion: + - 2010 + - 2016 + aceArchitecture: + - x64 + - x86 + dataAccessProviderType: + - ODBC + - OLE DB + os: + - windows-latest + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set additional variables + shell: pwsh + run: | + $os = '${{ matrix.os }}'.Split('-')[0] + echo "os=$os" >> $env:GITHUB_ENV + + $dotnetInstallDirectory = '.\.dotnet_${{ matrix.aceArchitecture }}' + echo "dotnetInstallDirectory=$dotnetInstallDirectory" >> $env:GITHUB_ENV + + $dotnetExecutable = Join-Path $dotnetInstallDirectory 'dotnet.exe' + echo "dotnetExecutable=$dotnetExecutable" >> $env:GITHUB_ENV + + $aceUrls = @{ + '2010' = @{ + 'x64' = 'https://download.microsoft.com/download/2/4/3/24375141-E08D-4803-AB0E-10F2E3A07AAA/AccessDatabaseEngine_X64.exe' + 'x86' = 'https://download.microsoft.com/download/2/4/3/24375141-E08D-4803-AB0E-10F2E3A07AAA/AccessDatabaseEngine.exe' + 'silent' = '/passive /quiet /norestart REBOOT=ReallySuppress' + } + '2016' = @{ + 'x64' = 'https://download.microsoft.com/download/3/5/C/35C84C36-661A-44E6-9324-8786B8DBE231/AccessDatabaseEngine_X64.exe' + 'x86' = 'https://download.microsoft.com/download/3/5/C/35C84C36-661A-44E6-9324-8786B8DBE231/AccessDatabaseEngine.exe' + 'silent' = '/passive /quiet /norestart REBOOT=ReallySuppress' + } + } + + $aceUrl = $aceUrls['${{ matrix.aceVersion }}']['${{ matrix.aceArchitecture }}'] + echo "aceUrl=$aceUrl" >> $env:GITHUB_ENV + + $aceSilentInstallArgument = $aceUrls['${{ matrix.aceVersion }}']['silent'] + echo "aceSilentInstallArgument=$aceSilentInstallArgument" >> $env:GITHUB_ENV + + $defaultConnection = '${{ matrix.dataAccessProviderType }}' -eq 'ODBC' ? 'DBQ=Jet.accdb' : 'Data Source=Jet.accdb;Persist Security Info=False;' + echo "defaultConnection=$defaultConnection" >> $env:GITHUB_ENV + - name: Output Variables + shell: pwsh + run: | + echo "os: ${{ env.os }}" + echo "buildConfiguration: ${{ env.buildConfiguration }}" + echo "aceVersion: ${{ matrix.aceVersion }}" + echo "aceArchitecture: ${{ matrix.aceArchitecture }}" + echo "aceUrl: ${{ env.aceUrl }}" + echo "aceSilentInstallArgument: ${{ env.aceSilentInstallArgument }}" + echo "dataAccessProviderType: ${{ matrix.dataAccessProviderType }}" + echo "defaultConnection: ${{ env.defaultConnection }}" + echo "skipTests: ${{ env.skipTests }}" + echo "dotnetInstallDirectory: ${{ env.dotnetInstallDirectory }}" + echo "dotnetExecutable: ${{ env.dotnetExecutable }}" + + echo "github.event_name: ${{ github.event_name }}" + echo "github.repository: ${{ github.repository }}" + - name: .NET Information Before SDK Install + shell: pwsh + run: try { & '${{ env.dotnetExecutable }}' --info } catch { echo 'No ${{ matrix.aceArchitecture }} .NET SDK installed.' } + - name: Install .NET SDK + shell: pwsh + run: | + &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -JSonFile global.json -Architecture '${{ matrix.aceArchitecture }}' -InstallDir '${{ env.dotnetInstallDirectory }}' -Verbose + - name: .NET Information After SDK Install + shell: pwsh + run: try { & '${{ env.dotnetExecutable }}' --info } catch { echo 'No ${{ matrix.aceArchitecture }} .NET SDK installed.' } + - name: ACE Information Before ACE Install + shell: pwsh + run: | + 'DAO:' + Get-ChildItem 'HKLM:\SOFTWARE\Classes\DAO.DBEngine*' | Select-Object + + 'OLE DB:' + foreach ($provider in [System.Data.OleDb.OleDbEnumerator]::GetRootEnumerator()) + { + $v = New-Object PSObject + for ($i = 0; $i -lt $provider.FieldCount; $i++) + { + Add-Member -in $v NoteProperty $provider.GetName($i) $provider.GetValue($i) + } + $v + } + - name: Install Access Database Engine + shell: pwsh + run: | + $setupFileName = 'AccessDatabaseEngine_${{ matrix.aceVersion }}_${{ matrix.aceArchitecture }}.exe' + Invoke-WebRequest '${{ env.aceUrl }}' -OutFile $setupFileName + & ".\$setupFileName" ${{ env.aceSilentInstallArgument }} | Out-Default + - name: ACE Information After ACE Install + shell: pwsh + run: | + 'DAO:' + Get-ChildItem 'HKLM:\SOFTWARE\Classes\DAO.DBEngine*' | Select-Object + + 'OLE DB:' + foreach ($provider in [System.Data.OleDb.OleDbEnumerator]::GetRootEnumerator()) + { + $v = New-Object PSObject + for ($i = 0; $i -lt $provider.FieldCount; $i++) + { + Add-Member -in $v NoteProperty $provider.GetName($i) $provider.GetValue($i) + } + $v + } + - name: Build Solution + shell: pwsh + run: | + & '${{ env.dotnetExecutable }}' build --configuration ${{ env.buildConfiguration }} -p:FixedTestOrder=${{ env.deterministicTests }} + - name: 'Run Tests: EFCore.Jet.Data.Tests' + shell: pwsh + run: | + $env:EFCoreJet_DefaultConnection = '${{ env.defaultConnection }}' + & '${{ env.dotnetExecutable }}' test .\test\EFCore.Jet.Data.Tests -c '${{ env.buildConfiguration }}' --no-build --logger trx --verbosity detailed --blame-hang-timeout 3m + - name: 'Run Tests: EFCore.Jet.FunctionalTests' + shell: pwsh + continue-on-error: true + run: | + $env:EFCoreJet_DefaultConnection = '${{ env.defaultConnection }}' + & '${{ env.dotnetExecutable }}' test .\test\EFCore.Jet.FunctionalTests -c '${{ env.buildConfiguration }}' --no-build --logger trx --verbosity detailed --blame-hang-timeout 3m + exit 0 + - name: 'Run Tests: EFCore.Jet.Tests' + shell: pwsh + run: | + $env:EFCoreJet_DefaultConnection = '${{ env.defaultConnection }}' + & '${{ env.dotnetExecutable }}' test .\test\EFCore.Jet.Tests -c '${{ env.buildConfiguration }}' --no-build --logger trx --verbosity detailed --blame-hang-timeout 3m + NuGet: + needs: BuildAndTest + if: github.event_name == 'push' && github.repository == 'CirrusRedOrg/EntityFrameworkCore.Jet' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v3 + with: + global-json-file: global.json + - name: .NET Information + shell: pwsh + run: | + dotnet --info + - name: NuGet Pack + shell: pwsh + run: | + $officialBuild = '${{ github.ref }}' -match '(?<=^refs/tags/v)\d+\.\d+\.\d+.*$' + $officialVersion = $Matches.0 + $wipBuild = '${{ github.ref }}' -match '^refs/heads/.*-wip$' + $ciBuildOnly = $wipBuild -or ('${{ github.ref }}' -match '^refs/heads/(?:master|.*-servicing)$') + $continuousIntegrationTimestamp = Get-Date -Format yyyyMMddHHmmss + $buildSha = '${{ github.sha }}'.SubString(0, 7); + $pack = $officialBuild -or $ciBuildOnly + + $pushToAzureArtifacts = $pack + $pushToMygetOrg = $pack + $pushToNugetOrg = $pack -and $officialBuild + + echo "pushToAzureArtifacts: $pushToAzureArtifacts" + echo "pushToMygetOrg: $pushToMygetOrg" + echo "pushToNugetOrg: $pushToNugetOrg" + + echo "officialBuild: $officialBuild" + echo "officialVersion: $officialVersion" + echo "wipBuild: $wipBuild" + echo "ciBuildOnly: $ciBuildOnly" + echo "continuousIntegrationTimestamp: $continuousIntegrationTimestamp" + echo "buildSha: $buildSha" + echo "pack: $pack" + + if ($pack) + { + $projectFiles = Get-ChildItem src/*/*.csproj -Recurse | % { $_.FullName } + + $combinations = @('default', @('Release')), @('withPdbs', @('Release', 'Debug')) #, @('embeddedPdbs', @('Release', 'Debug')) + foreach ($combination in $combinations) + { + $type = $combination[0] + $configurations = $combination[1] + foreach ($configuration in $configurations) + { + $arguments = 'pack', '-c', $configuration, '-o', "nupkgs/$configuration/$type", '-p:ContinuousIntegrationBuild=true' + + if ($officialBuild) + { + $finalOfficialVersion = $officialVersion + + if ($configuration -eq 'Debug') + { + $finalOfficialVersion += '-debug' + } + + $arguments += "-p:OfficialVersion=$finalOfficialVersion" + } + + if ($ciBuildOnly) + { + $arguments += "-p:ContinuousIntegrationTimestamp=$continuousIntegrationTimestamp" + $arguments += "-p:BuildSha=$buildSha" + } + + switch ($type) + { + 'withPdbs' { $arguments += '-p:PackPdb=true', '-p:IncludeSymbols=false' } + 'embeddedPdbs' { $arguments += '-p:DebugType=embedded', '-p:IncludeSymbols=false' } + } + + foreach ($projectFile in $projectFiles) + { + echo "Type: $type, Configuration: $configuration, Project: $projectFile" + echo "Pack command: dotnet $(($arguments + $projectFile) -join ' ')" + & dotnet ($arguments + $projectFile) + } + } + } + } + + echo "pushToAzureArtifacts=$pushToAzureArtifacts" >> $env:GITHUB_ENV + echo "pushToMygetOrg=$pushToMygetOrg" >> $env:GITHUB_ENV + echo "pushToNugetOrg=$pushToNugetOrg" >> $env:GITHUB_ENV + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: nupkgs + path: nupkgs +# - name: "NuGet Push - AZDO Feed - Debug" +# if: ${{ env.pushToAzureArtifacts == 'true' }} +# working-directory: nupkgs +# shell: pwsh +# run: | +# # https://learn.microsoft.com/en-us/azure/devops/artifacts/nuget/dotnet-exe?view=azure-devops#publish-packages-from-external-sources +# dotnet new nugetconfig --output './azdo-nuget' --force +# try +# { +# nuget sources Add -ConfigFile './azdo-nuget/nuget.config' -Name 'azdo-efcore-jet-debug' -Source 'https://bubibubi.pkgs.visualstudio.com/EntityFrameworkCore.Jet/_packaging/public/nuget/v3/index.json' -UserName '${{ vars.AZUREDEVOPS_BUBIBUBI_ALLPACKAGES_PUSHNEW_USERNAME }}' -Password '${{ secrets.AZUREDEVOPS_BUBIBUBI_ALLPACKAGES_PUSHNEW_PASSWORD }}' -StorePasswordInClearText +# +# nuget push './Release/withPdbs/**/*.nupkg' -ConfigFile './azdo-nuget/nuget.config' -ApiKey 'foo' -Source 'https://bubibubi.pkgs.visualstudio.com/EntityFrameworkCore.Jet/_packaging/public/nuget/v3/index.json' +# } +# finally +# { +# Remove-Item ./azdo-nuget -Recurse -Force +# } +# - name: "NuGet Push - AZDO Feed - Release" +# if: ${{ env.pushToAzureArtifacts == 'true' }} +# working-directory: nupkgs +# shell: pwsh +# run: | +# # https://learn.microsoft.com/en-us/azure/devops/artifacts/nuget/dotnet-exe?view=azure-devops#publish-packages-from-external-sources +# dotnet new nugetconfig --output './azdo-nuget' --force +# try +# { +# nuget sources Add -ConfigFile './azdo-nuget/nuget.config' -Name 'azdo-efcore-jet-public' -Source 'https://bubibubi.pkgs.visualstudio.com/EntityFrameworkCore.Jet/_packaging/public/nuget/v3/index.json' -UserName '${{ vars.AZUREDEVOPS_POMELO_ALLPACKAGES_PUSHNEW_USERNAME }}' -Password '${{ secrets.AZUREDEVOPS_POMELO_ALLPACKAGES_PUSHNEW_PASSWORD }}' -StorePasswordInClearText +# +# nuget push './Release/withPdbs/**/*.nupkg' -ConfigFile './azdo-nuget/nuget.config' -ApiKey 'foo' -Source 'https://bubibubi.pkgs.visualstudio.com/EntityFrameworkCore.Jet/_packaging/public/nuget/v3/index.json' +# } +# finally +# { +# Remove-Item ./azdo-nuget -Recurse -Force +# } + - name: "NuGet Push - myget.org - Debug" + if: ${{ env.pushToMygetOrg == 'true' }} + working-directory: nupkgs + shell: pwsh + run: dotnet nuget push './Debug/withPdbs/**/*.nupkg' --api-key '${{ secrets.MYGETORG_CIRRUSRED_ALLPACKAGES_DEBUG_PUSHNEW }}' --source 'https://www.myget.org/F/cirrusred-debug/api/v3/index.json' + - name: "NuGet Push - myget.org - Release" + if: ${{ env.pushToMygetOrg == 'true' }} + working-directory: nupkgs + shell: pwsh + run: dotnet nuget push './Release/default/**/*.nupkg' --api-key '${{ secrets.MYGETORG_CIRRUSRED_ALLPACKAGES_PUSHNEW }}' --source 'https://www.myget.org/F/cirrusred/api/v3/index.json' + - name: "NuGet Push - nuget.org - Release" + if: ${{ env.pushToNugetOrg == 'true' }} + working-directory: nupkgs + shell: pwsh + run: dotnet nuget push './Release/default/**/*.nupkg' --api-key '${{ secrets.NUGETORG_EFCOREJET_ALLPACKAGES_PUSHNEW }}' --source 'https://api.nuget.org/v3/index.json' \ No newline at end of file diff --git a/Version.props b/Version.props index c9d24cd..c3e2b66 100644 --- a/Version.props +++ b/Version.props @@ -32,12 +32,17 @@ true - + $(PreReleaseVersionLabel).$(PreReleaseVersionIteration) $(VersionSuffix).ci.$(ContinuousIntegrationTimestamp) + $(VersionSuffix).debug $(VersionSuffix)+sha.$(BuildSha) + + debug + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index f815358..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,230 +0,0 @@ -trigger: - branches: - include: - - '*' - tags: - include: - - '*' -variables: - isPullRequest: $[eq(variables['Build.Reason'], 'PullRequest')] - pullRequestSourceBranch: $[variables['System.PullRequest.SourceBranch']] - buildConfiguration: 'Debug' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -jobs: - - job: BuildAndTest - displayName: Build and Test - strategy: - matrix: - ACE_2010_x64_with_ODBC: - aceVersion: '2010' - aceArchitecture: 'x64' - aceUrl: 'https://download.microsoft.com/download/2/4/3/24375141-E08D-4803-AB0E-10F2E3A07AAA/AccessDatabaseEngine_X64.exe' - aceSilentInstallArgument: '/passive' - dataAccessProviderType: 'ODBC' - defaultConnection: 'DBQ=Jet.accdb' - ACE_2010_x64_with_OLE_DB: - aceVersion: '2010' - aceArchitecture: 'x64' - aceUrl: 'https://download.microsoft.com/download/2/4/3/24375141-E08D-4803-AB0E-10F2E3A07AAA/AccessDatabaseEngine_X64.exe' - aceSilentInstallArgument: '/passive' - dataAccessProviderType: 'OLE DB' - defaultConnection: 'Data Source=Jet.accdb' - ACE_2010_x86_with_ODBC: - aceVersion: '2010' - aceArchitecture: 'x86' - aceUrl: 'https://download.microsoft.com/download/2/4/3/24375141-E08D-4803-AB0E-10F2E3A07AAA/AccessDatabaseEngine.exe' - aceSilentInstallArgument: '/passive' - dataAccessProviderType: 'ODBC' - defaultConnection: 'DBQ=Jet.accdb' - ACE_2010_x86_with_OLE_DB: - aceVersion: '2010' - aceArchitecture: 'x86' - aceUrl: 'https://download.microsoft.com/download/2/4/3/24375141-E08D-4803-AB0E-10F2E3A07AAA/AccessDatabaseEngine.exe' - aceSilentInstallArgument: '/passive' - dataAccessProviderType: 'OLE DB' - defaultConnection: 'Data Source=Jet.accdb' - pool: - vmImage: 'windows-latest' - steps: - - pwsh: | - if ('$(aceArchitecture)' -eq 'x86') - { - $dotnetInstallDirectory = 'C:\Program Files (x86)\dotnet' - } - else - { - $dotnetInstallDirectory = 'C:\Program Files\dotnet' - } - echo "##vso[task.setvariable variable=dotnetInstallDirectory]$dotnetInstallDirectory" - - $dotnetPath = Join-Path $dotnetInstallDirectory 'dotnet.exe' - echo "##vso[task.setvariable variable=dotnetPath]$dotnetPath" - - $path = $env:path.Replace('C:\Program Files\dotnet', $dotnetInstallDirectory) - echo "##vso[task.setvariable variable=path]$path" - displayName: Set additional variables - - pwsh: | - echo "isPullRequest: $(isPullRequest)" - echo "pullRequestSourceBranch: $(pullRequestSourceBranch)" - echo "Build.SourceBranch: $(Build.SourceBranch)" - echo "Build.SourceBranchName: $(Build.SourceBranchName)" - echo "Build.SourceVersion: $(Build.SourceVersion)" - echo "Build.SourceVersionMessage: $(Build.SourceVersionMessage)" - echo "aceVersion: $(aceVersion)" - echo "aceArchitecture: $(aceArchitecture)" - echo "aceUrl: $(aceUrl)" - echo "dotnetInstallDirectory: $(dotnetInstallDirectory)" - echo "dotnetPath: $(dotnetPath)" - displayName: Output Variables - - pwsh: | - try { dotnet --info } catch { echo 'No $(aceArchitecture) .NET SDK installed' } - displayName: .NET Information Before SDK Install - - pwsh: | - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; - &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -JSonFile global.json -Architecture $(aceArchitecture) -InstallDir '$(dotnetInstallDirectory)' -Verbose - displayName: Install .NET SDK - - pwsh: | - try { dotnet --info } catch { echo 'No $(aceArchitecture) .NET SDK installed' } - displayName: .NET Information After SDK Install - - pwsh: | - $setupFileName = 'AccessDatabaseEngine_$(aceVersion)_$(aceArchitecture).exe' - Invoke-WebRequest '$(aceUrl)' -OutFile $setupFileName - & ".\$setupFileName" $(aceSilentInstallArgument) - displayName: Install Access Database Engine - - pwsh: | - dotnet build --configuration $(buildConfiguration) - displayName: Build Solution - - pwsh: | - $env:EFCoreJet_DefaultConnection = '$(defaultConnection)' - dotnet test .\test\EFCore.Jet.Data.Tests -c $(buildConfiguration) --no-build --logger trx --verbosity detailed - displayName: 'Run Tests: EFCore.Jet.Data.Tests' - - pwsh: | - $env:EFCoreJet_DefaultConnection = '$(defaultConnection)' - dotnet test .\test\EFCore.Jet.FunctionalTests -c $(buildConfiguration) --no-build --logger trx --verbosity detailed - - # Ignore failure for now. - # TODO: Explicitly check for abort and either return a failure or repeat test task. - exit 0 - displayName: 'Run Tests: EFCore.Jet.FunctionalTests' - - pwsh: | - $env:EFCoreJet_DefaultConnection = '$(defaultConnection)' - dotnet test .\test\EFCore.Jet.Tests -c $(buildConfiguration) --no-build --logger trx --verbosity detailed - displayName: 'Run Tests: EFCore.Jet.Tests' - continueOnError: false - - task: PublishTestResults@2 - displayName: Publish Test Results - condition: succeededOrFailed() - inputs: - testResultsFormat: VSTest - testResultsFiles: test/**/*.trx - testRunTitle: ACE $(aceVersion) $(aceArchitecture) with $(dataAccessProviderType) - mergeTestResults: true - failTaskOnFailedTests: false - - job: NuGet - dependsOn: - - BuildAndTest - condition: and(ne(variables['isPullRequest'], true), eq(dependencies.BuildAndTest.result, 'Succeeded')) - pool: - vmImage: 'windows-latest' # must be Windows for PublishSymbols task - steps: - - pwsh: | - $dotnetInstallDirectory = Join-Path $env:ProgramFiles 'dotnet' - echo "##vso[task.setvariable variable=dotnetInstallDirectory]$dotnetInstallDirectory" - - $dotnetPath = Join-Path $dotnetInstallDirectory 'dotnet.exe' - echo "##vso[task.setvariable variable=dotnetPath]$dotnetPath" - displayName: Set additional variables - - pwsh: | - try { & '$(dotnetPath)' --info } catch { echo 'No .NET SDK installed' } - displayName: .NET Information Before SDK Install - - pwsh: | - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; - &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -JSonFile global.json -InstallDir '$(dotnetInstallDirectory)' -Verbose - displayName: Install .NET SDK - - pwsh: | - try { & '$(dotnetPath)' --info } catch { echo 'No .NET SDK installed' } - displayName: .NET Information After SDK Install - - pwsh: | - $officialBuild = '$(Build.SourceBranch)' -match '(?<=^refs/tags/v)\d+\.\d+\.\d+.*$' - $officialVersion = $Matches.0 - $wipBuild = '$(Build.SourceBranch)' -match '^refs/heads/.*-wip$' - $ciBuildOnly = $wipBuild -or ('$(Build.SourceBranch)' -match '^refs/heads/(?:master|.*-servicing)$') - $continuousIntegrationTimestamp = Get-Date -Format yyyyMMddHHmmss - $buildSha = '$(Build.SourceVersion)'.SubString(0, 7); - $pack = $officialBuild -or $ciBuildOnly -or $wipBuild - - echo "officialBuild: $officialBuild" - echo "officialVersion: $officialVersion" - echo "wipBuild: $wipBuild" - echo "ciBuildOnly: $ciBuildOnly" - echo "continuousIntegrationTimestamp: $continuousIntegrationTimestamp" - echo "buildSha: $buildSha" - echo "pack: $pack" - - if ($pack) - { - $arguments = 'pack', '-c', 'Release', '-o', '$(Build.ArtifactStagingDirectory)', '-p:ContinuousIntegrationBuild=true' - - if ($officialBuild) - { - $arguments += "-p:OfficialVersion=$officialVersion" - } - - if ($ciBuildOnly) - { - $arguments += "-p:ContinuousIntegrationTimestamp=$continuousIntegrationTimestamp" - $arguments += "-p:BuildSha=$buildSha" - } - - $projectFiles = Get-ChildItem src/*/*.csproj -Recurse | % { $_.FullName } - - foreach ($projectFile in $projectFiles) - { - try - { - echo "Pack command: & '$(dotnetPath)' $(($arguments + $projectFile) -join ' ')" - & '$(dotnetPath)' ($arguments + $projectFile) - } - catch - { - echo 'Failed to pack $(projectFile)' - exit 1 - } - } - - $pushToAzureArtifacts = $pack - $publishSymbolsForAzureArtifacts = $pushToAzureArtifacts - $pushToNugetOrg = $officialBuild - - echo "pushToAzureArtifacts: $pushToAzureArtifacts" - echo "publishSymbolsForAzureArtifacts: $publishSymbolsForAzureArtifacts" - echo "pushToNugetOrg: $pushToNugetOrg" - - echo "##vso[task.setvariable variable=Pack.PushToAzureArtifacts]$pushToAzureArtifacts" - echo "##vso[task.setvariable variable=Pack.PublishSymbolsForAzureArtifacts]$publishSymbolsForAzureArtifacts" - echo "##vso[task.setvariable variable=Pack.PushToNugetOrg]$pushToNugetOrg" - } - displayName: "NuGet Pack" - - task: NuGetCommand@2 - displayName: "NuGet Push - AZDO Feed" - inputs: - command: push - publishVstsFeed: 'EntityFrameworkCore.Jet/public' - packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' - condition: and(succeeded(), eq(variables['Pack.PushToAzureArtifacts'],'true')) - - task: PublishSymbols@2 # AZDO still has no snupkg support, so we need to publish the PDB files to a symbol server - displayName: "Publish Symbols to Azure Artifacts symbol server" - inputs: - symbolServerType: 'TeamServices' - treatNotIndexedAsWarning: false - indexSources: false - condition: and(succeeded(), eq(variables['Pack.PublishSymbolsForAzureArtifacts'],'true')) - - task: NuGetCommand@2 - displayName: "NuGet Push - nuget.org" - inputs: - command: push - nuGetFeedType: external - publishFeedCredentials: LauXjpn-NugetOrg-EFCoreJet-AllPackages-PushNew - packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' - condition: and(succeeded(), eq(variables['Pack.PushToNugetOrg'],'true')) diff --git a/test/EFCore.Jet.FunctionalTests/Properties/AssemblyInfo.cs b/test/EFCore.Jet.FunctionalTests/Properties/AssemblyInfo.cs index 684e3ba..79c1ec1 100644 --- a/test/EFCore.Jet.FunctionalTests/Properties/AssemblyInfo.cs +++ b/test/EFCore.Jet.FunctionalTests/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ using Xunit; #if FIXED_TEST_ORDER -[assembly: CollectionBehavior(DisableTestParallelization = true)] +[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true, MaxParallelThreads = 1)] [assembly: TestCollectionOrderer("EntityFrameworkCore.Jet.FunctionalTests.TestUtilities.Xunit." + nameof(AscendingTestCollectionOrderer), "EntityFrameworkCore.Jet.FunctionalTests")] [assembly: TestCaseOrderer("EntityFrameworkCore.Jet.FunctionalTests.TestUtilities.Xunit." + nameof(AscendingTestCaseOrderer), "EntityFrameworkCore.Jet.FunctionalTests")] diff --git a/test/Shared/TestUtilities/Xunit/AscendingTestCaseOrderer.cs b/test/Shared/TestUtilities/Xunit/AscendingTestCaseOrderer.cs index 4e4b424..401d272 100644 --- a/test/Shared/TestUtilities/Xunit/AscendingTestCaseOrderer.cs +++ b/test/Shared/TestUtilities/Xunit/AscendingTestCaseOrderer.cs @@ -11,5 +11,11 @@ public class AscendingTestCaseOrderer : ITestCaseOrderer { public IEnumerable OrderTestCases(IEnumerable testCases) where TTestCase : ITestCase - => testCases.OrderBy(c => c.DisplayName, StringComparer.OrdinalIgnoreCase); + { + var orderTestCases = testCases.OrderBy(c => c.TestMethod.TestClass.Class.Name, StringComparer.Ordinal) + .ThenBy(c => c.DisplayName, StringComparer.Ordinal) + .ToList(); + + return orderTestCases; + } } \ No newline at end of file diff --git a/test/Shared/TestUtilities/Xunit/AscendingTestCollectionOrderer.cs b/test/Shared/TestUtilities/Xunit/AscendingTestCollectionOrderer.cs index fbc2d8d..d695b81 100644 --- a/test/Shared/TestUtilities/Xunit/AscendingTestCollectionOrderer.cs +++ b/test/Shared/TestUtilities/Xunit/AscendingTestCollectionOrderer.cs @@ -10,5 +10,10 @@ namespace EntityFrameworkCore.Jet.FunctionalTests.TestUtilities.Xunit; public class AscendingTestCollectionOrderer : ITestCollectionOrderer { public IEnumerable OrderTestCollections(IEnumerable testCollections) - => testCollections.OrderBy(c => c.DisplayName, StringComparer.OrdinalIgnoreCase); + { + var orderTestCollections = testCollections.OrderBy(c => c.DisplayName, StringComparer.OrdinalIgnoreCase) + .ToList(); + + return orderTestCollections; + } } \ No newline at end of file diff --git a/test/xunit.runner.json b/test/xunit.runner.json index 1518af4..697e37e 100644 --- a/test/xunit.runner.json +++ b/test/xunit.runner.json @@ -1,6 +1,3 @@ { - "appDomain": "denied", - "parallelizeAssembly": false, - "parallelizeTestCollections": false, "diagnosticMessages": false }