From f2f8e76dcc9c23a747b088d508ecf837b7bf834a Mon Sep 17 00:00:00 2001 From: Laurents Meyer Date: Sun, 8 Oct 2023 16:43:26 +0200 Subject: [PATCH] Move CI from Azure DevOps (AZDO) to GitHub Actions (#1795) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding github actions for automated tests without an azure account. (#1697) * Adding github actions for automated tests on Ubuntu. Adding dependabot. Improving the test to follow the azure pipeline. * Adding github actions for automated tests without an azure account. Adding dependabot for easy testing of dependency updates. * Bumping the build script to use .net 7.0 instead of .net 6.0 * Adding MariaDB 10.9.1 and 10.11.1 to tests. * Updating github actions to also include latest MySQL and MariaDB. * Updating dependabot limit. * "Implementing" the missing method in StoredProcedureUpdateMySqlTest. * Fixing dotnet to 7.0.100 * Dependabot is independent of GitHub Actions and should have gotten its own PR. * Remove AZDO CI. * Rename GitHub Actions workflow file. * Fix and update GitHub Actions workflow. * Add package publishing. * Fix test on Windows. --------- Co-authored-by: René Schultz Madsen --- .github/workflows/build.yml | 416 ++++++++++++++ Dependencies.targets | 1 + azure-pipelines.yml | 544 ------------------ test/Directory.Build.props | 1 + .../MigrationsMySqlTest.cs | 27 +- 5 files changed, 443 insertions(+), 546 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..4c3dcf061 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,416 @@ +name: Build +on: + push: + branches: + - '**' + paths-ignore: + - '**.md' + pull_request: + branches: + - '**' + paths-ignore: + - '**.md' +env: + isPullRequest: ${{ github.event_name == 'pull_request' }} + pullRequestSourceBranch: ${{ github.ref }} + mysqlCurrentSqlMode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION + mysqlLegacySqlMode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION + # Currently no ONLY_FULL_GROUP_BY, see #1167: + mariadbSqlMode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION + maxConnections: 512 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + skipAllTests: false + skipWindowsTests: false +jobs: + BuildAndTest: + strategy: + fail-fast: false + matrix: + dbVersion: + - 8.0.34-mysql + - 5.7.43-mysql + - 11.1.2-mariadb + - 11.0.3-mariadb + - 10.11.5-mariadb + - 10.10.6-mariadb + - 10.6.15-mariadb + - 10.5.22-mariadb + - 10.4.31-mariadb + os: + - ubuntu-latest + - windows-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Set additional variables + shell: pwsh + run: | + $os = '${{ matrix.os }}'.Split('-')[0] -eq 'windows' ? 'windows' : 'linux' + echo "os=$os" >> $env:GITHUB_ENV + + $dbVersionParts = '${{ matrix.dbVersion }}'.Split('-') + + $databaseServerType = $dbVersionParts[1] + echo "databaseServerType=$databaseServerType" >> $env:GITHUB_ENV + + $databaseServerVersion = $dbVersionParts[0] + echo "databaseServerVersion=$databaseServerVersion" >> $env:GITHUB_ENV + + # The parenthesis around the right OR argument are mandatory for the expression to work correctly, because in PowerShell, AND and OR + # operators have the SAME precedence. + $skipTests = '${{ env.skipAllTests }}' -eq 'true' -or ($os -eq 'windows' -and '${{ env.skipWindowsTests }}' -eq 'true') + echo "skipTests=$skipTests" >> $env:GITHUB_ENV + + $sqlMode = $databaseServerType -eq 'mariadb' ? '${{ env.mariadbSqlMode }}' : $databaseServerType -eq 'mysql' -and $databaseServerVersion.Split('.')[0] -lt 8 ? '${{ env.mysqlLegacySqlMode }}' : '${{ env.mysqlCurrentSqlMode }}' + echo "sqlMode=$sqlMode" >> $env:GITHUB_ENV + + $serverExecutable = $databaseServerType -eq 'mariadb' -and $databaseServerVersion.Split('.')[0] -ge 11 ? 'mariadbd' : 'mysqld' + echo "serverExecutable=$serverExecutable" >> $env:GITHUB_ENV + + $clientExecutable = $databaseServerType -eq 'mariadb' -and $databaseServerVersion.Split('.')[0] -ge 11 ? 'mariadb' : 'mysql' + echo "clientExecutable=$clientExecutable" >> $env:GITHUB_ENV + + $clientCommandPrefix = $os -eq 'windows' ? $clientExecutable : "docker exec '$databaseServerType' $clientExecutable" + echo "clientCommandPrefix=$clientCommandPrefix" >> $env:GITHUB_ENV + + $windowsUserTempLocation = $os -eq 'windows' ? (Get-Item $env:Temp).FullName : '' + echo "windowsUserTempLocation=$windowsUserTempLocation" >> $env:GITHUB_ENV + - name: Output Variables + shell: pwsh + run: | + echo "pullRequestSourceBranch: ${{ env.pullRequestSourceBranch }}" + echo "isPullRequest: ${{ env.isPullRequest }}" + echo "os: ${{ env.os }}" + echo "databaseServerType: ${{ env.databaseServerType }}" + echo "databaseServerVersion: ${{ env.databaseServerVersion }}" + echo "sqlMode: ${{ env.sqlMode }}" + echo "skipTests: ${{ env.skipTests }}" + echo "skipAllTests: ${{ env.skipAllTests }}" + echo "skipWindowsTests: ${{ env.skipWindowsTests }}" + echo "serverExecutable: ${{ env.serverExecutable }}" + echo "clientExecutable: ${{ env.clientExecutable }}" + echo "clientCommandPrefix: ${{ env.clientCommandPrefix }}" + echo "windowsUserTempLocation: ${{ env.windowsUserTempLocation }}" + - name: Setup .NET SDK + uses: actions/setup-dotnet@v3 + with: + global-json-file: global.json + - name: .NET Information + shell: pwsh + run: | + dotnet --info + - name: Install EF Core Tools + shell: pwsh + run: | + dotnet tool restore + dotnet ef --version + - name: Cache - Database Image - Linux + id: cache-databaseImage-linux + uses: actions/cache@v3 + if: ${{ env.os == 'linux' }} + with: + path: cache/database + key: database-linux-${{ env.databaseServerType }}-${{ env.databaseServerVersion }}-v2 + - name: Cache - Database Image - Windows + id: cache-databaseImage-windows + uses: actions/cache@v3 + if: ${{ env.os == 'windows' }} + with: + path: ${{ env.windowsUserTempLocation }}\Pomelo.Chocolatey.${{ env.databaseServerType }}.Server + key: database-windows-${{ env.databaseServerType }}-${{ env.databaseServerVersion }}-v3 + - name: Install Database Server - Linux + if: ${{ env.os == 'linux' }} + shell: pwsh + run: | + sudo systemctl stop mysql + + $waitMinutes = 5 + $pollingIntervalSeconds = 1 + $started = $false + + dir './cache/database' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName + + if (Test-Path -PathType Leaf './cache/database/${{ env.databaseServerType }}_${{ env.databaseServerVersion }}.tar') + { + docker load --input './cache/database/${{ env.databaseServerType }}_${{ env.databaseServerVersion }}.tar' + } + else + { + if (-not (Test-Path -PathType Container './cache/database')) + { + New-Item -ItemType Directory './cache/database' + } + + docker pull '${{ env.databaseServerType }}:${{ env.databaseServerVersion }}' + docker save -o './cache/database/${{ env.databaseServerType }}_${{ env.databaseServerVersion }}.tar' '${{ env.databaseServerType }}:${{ env.databaseServerVersion }}' + + dir './cache/database' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName + } + + docker run --name '${{ env.databaseServerType }}' -e MYSQL_ROOT_PASSWORD=Password12! -p 127.0.0.1:3306:3306 -d '${{ env.databaseServerType }}:${{ env.databaseServerVersion }}' + $startTime = Get-Date + + while (!($started = ${{ env.clientCommandPrefix }} --protocol=tcp -h localhost -P 3306 -u root -pPassword12! -e 'select 1;') -and ((Get-Date) - $startTime).TotalMinutes -lt $waitMinutes) + { + Start-Sleep -Seconds $pollingIntervalSeconds + } + + if (!$started) + { + throw "${{ env.databaseServerType }}:${{ env.databaseServerVersion }} docker container failed to start in ${waitMinutes} minutes" + exit 1 + } + - name: Install Database Server - Windows + if: ${{ env.os == 'windows' }} + shell: pwsh + run: | + $mySqlServiceName = '${{ env.databaseServerType }}_${{ env.databaseServerVersion }}' + $lowerCaseTableNames = 2 + $packageName = 'Pomelo.Chocolatey.${{ env.databaseServerType }}.Server' + $mySqlBinPath = "C:\tools\${packageName}\current\bin" + $mySqlIniPath = "C:\tools\${packageName}\current\my.ini" + $mySqlDataPath = 'C:\ProgramData\${{ env.databaseServerType }}\data' + + dir "$env:Temp\${{ env.databaseServerType }}\${{ env.databaseServerVersion }}" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName + + $service = Get-Service '*${{ env.databaseServerType }}*' -ErrorAction SilentlyContinue + if ($service -ne $null) + { + throw "A service for ${{ env.databaseServerType }} appears to already exist." + exit 1 + } + + # choco config set cacheLocation '$(Pipeline.Workspace)/cache/database' + choco install $packageName '--version=${{ env.databaseServerVersion }}' --ignore-dependencies --source 'https://www.myget.org/F/pomelo/api/v2;https://community.chocolatey.org/api/v2' --params "/serviceName:$mySqlServiceName" + + Get-Service '*${{ env.databaseServerType }}*' -ErrorAction SilentlyContinue + Stop-Service $mySqlServiceName -Verbose + + echo "Update PATH environment variable" + $env:PATH = "$mySqlBinPath;$env:PATH" + echo "PATH=$env:PATH" >> $env:GITHUB_ENV + + echo "Update configuration file" + "lower_case_table_names=$lowerCaseTableNames" >> $mySqlIniPath + + Remove-Item $mySqlDataPath/* -Recurse -Force -Verbose + + echo "Reinitialize database server" + + if ('${{ env.databaseServerType }}' -eq 'mysql') + { + ${{ env.serverExecutable }} --defaults-file="$mySqlIniPath" --initialize-insecure + } + else + { + mysql_install_db --datadir="$mySqlDataPath" + } + + Start-Service $mySqlServiceName -Verbose + + echo "Setup credentials" + ${{ env.clientCommandPrefix }} -h localhost -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password12!';" + ${{ env.clientCommandPrefix }} -h localhost -u root -pPassword12! -e "SELECT @@version;" + + dir "$env:Temp\${packageName}\${{ env.databaseServerVersion }}" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName + - name: Setup Database + shell: pwsh + run: ${{ env.clientCommandPrefix }} -u root -pPassword12! -e "SET GLOBAL sql_mode = '${{ env.sqlMode }}'; SET GLOBAL max_connections = ${{ env.maxConnections }};" + - name: Database Information + shell: pwsh + run: ${{ env.clientCommandPrefix }} -u root -pPassword12! -e 'SHOW VARIABLES;' + - name: Restore dependencies + shell: pwsh + run: dotnet restore + - name: Setup Solution + shell: pwsh + run: | + Copy-Item test/EFCore.MySql.FunctionalTests/config.json.example test/EFCore.MySql.FunctionalTests/config.json + Copy-Item test/EFCore.MySql.IntegrationTests/appsettings.ci.json test/EFCore.MySql.IntegrationTests/appsettings.json + Copy-Item test/EFCore.MySql.IntegrationTests/config.json.example test/EFCore.MySql.IntegrationTests/config.json + - name: Setup Integration Tests + shell: pwsh + run: | + ./test/EFCore.MySql.IntegrationTests/scripts/rebuild.ps1 + - name: Build Solution + shell: pwsh + run: | + dotnet build -c Debug + dotnet build -c Release + - name: Functional Tests + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: dotnet test test/EFCore.MySql.FunctionalTests -c Debug --no-build --logger "GitHubActions;report-warnings=false" --verbosity detailed + - name: Tests + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: dotnet test --logger "GitHubActions;report-warnings=false" test/EFCore.MySql.Tests + - name: Integration Tests - Applying migrations + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: dotnet run --project test/EFCore.MySql.IntegrationTests -c Release testMigrate + - name: Integration Tests - Scaffolding + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: ./test/EFCore.MySql.IntegrationTests/scripts/scaffold.ps1 + - name: Integration Tests - With EF_BATCH_SIZE = 1 + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: | + $env:EF_BATCH_SIZE = "1" + dotnet test -c Release --no-build --logger "GitHubActions;report-warnings=false" test/EFCore.MySql.IntegrationTests + - name: Integration Tests - With EF_BATCH_SIZE = 10 + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: | + $env:EF_BATCH_SIZE = "10" + dotnet test -c Release --no-build --logger "GitHubActions;report-warnings=false" test/EFCore.MySql.IntegrationTests + - name: Integration Tests - With EF_BATCH_SIZE = 1 + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: | + $env:EF_RETRY_ON_FAILURE = "3" + dotnet test -c Release --no-build --logger "GitHubActions;report-warnings=false" test/EFCore.MySql.IntegrationTests + - name: Integration Tests - Legacy migrations + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: ./test/EFCore.MySql.IntegrationTests/scripts/legacy.ps1 + - name: Integration Tests - Building migrations with EF_DATABASE = pomelo_test2 + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: | + $env:EF_DATABASE = "pomelo_test2" + dotnet build ./test/EFCore.MySql.IntegrationTests -c Release + - name: Integration Tests - Setup migrations with EF_DATABASE = pomelo_test2 + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: | + $env:EF_DATABASE = "pomelo_test2" + ./test/EFCore.MySql.IntegrationTests/scripts/rebuild.ps1 + - name: Integration Tests - With EF_DATABASE = pomelo_test2 + if: ${{ env.skipTests != 'true' }} + shell: pwsh + run: | + $env:EF_DATABASE = "pomelo_test2" + dotnet test -c Release --no-build --logger "GitHubActions;report-warnings=false" test/EFCore.MySql.IntegrationTests + NuGet: + needs: BuildAndTest + if: github.event_name == 'push' && startsWith(github.repository, 'PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/') + runs-on: ubuntu-latest + steps: + - 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 = '${{ env.pullRequestSourceBranch }}' -match '(?<=^refs/tags/)\d+\.\d+\.\d+.*$' + $officialVersion = $Matches.0 + $wipBuild = '${{ env.pullRequestSourceBranch }}' -match '^refs/heads/.*-wip$' + $ciBuildOnly = $wipBuild -or ('${{ env.pullRequestSourceBranch }}' -match '^refs/heads/(?:master|release/.*)$') + $continuousIntegrationTimestamp = Get-Date -Format yyyyMMddHHmmss + $buildSha = '${{ github.sha }}'.SubString(0, 7); + $pack = '$(buildAndTestSucceeded)' -eq "true" -and ($officialBuild -or $ciBuildOnly -or $wipBuild) + + $pushToAzureArtifacts = $pack + $pushToMygetOrg = $pack + $pushToNugetOrg = $officialBuild + + echo "officialBuild: $officialBuild" + echo "officialVersion: $officialVersion" + echo "wipBuild: $wipBuild" + echo "ciBuildOnly: $ciBuildOnly" + echo "continuousIntegrationTimestamp: $continuousIntegrationTimestamp" + echo "buildSha: $buildSha" + echo "pack: $pack" + + echo "pushToAzureArtifacts: $pushToAzureArtifacts" + echo "pushToMygetOrg: $pushToMygetOrg" + echo "pushToNugetOrg: $pushToNugetOrg" + + 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: dotnet nuget push './Debug/withPdbs/**/*.nupkg' --api-key '${{ secrets.AZUREDEVOPS_POMELO_ALLPACKAGES_PUSHNEW }}' --source 'https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-debug/nuget/v3/index.json' + - name: "NuGet Push - AZDO Feed - Release" + if: ${{ env.pushToAzureArtifacts == 'true' }} + working-directory: nupkgs + shell: pwsh + run: dotnet nuget push './Release/withPdbs/**/*.nupkg' --api-key '${{ secrets.AZUREDEVOPS_POMELO_ALLPACKAGES_PUSHNEW }}' --source 'https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json' + - 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_POMELO_ALLPACKAGES_DEBUG_PUSHNEW }}' --source 'https://www.myget.org/F/pomelo-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_POMELO_ALLPACKAGES_PUSHNEW }}' --source 'https://www.myget.org/F/pomelo/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_POMELO_ALLPACKAGES_PUSHNEW }}' --source 'https://api.nuget.org/v3/index.json' \ No newline at end of file diff --git a/Dependencies.targets b/Dependencies.targets index 4e2832827..739819cab 100644 --- a/Dependencies.targets +++ b/Dependencies.targets @@ -35,6 +35,7 @@ + diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 4d1f3ea47..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,544 +0,0 @@ -trigger: - branches: - include: - - '*' - tags: - include: - - '*' -variables: - isPullRequest: $[eq(variables['Build.Reason'], 'PullRequest')] - pullRequestSourceBranch: $[variables['System.PullRequest.SourceBranch']] - skipAllTests: false - skipWindowsTests: $[or(eq(variables['skipAllTests'], true), and(eq(variables['isPullRequest'], 'True'), ne(contains(variables['pullRequestSourceBranch'], 'windows'), 'True')))] - mysqlCurrentSqlMode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION - mysqlLegacySqlMode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION - # Currently no ONLY_FULL_GROUP_BY, see #1167: - mariadbSqlMode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION - maxConnections: 512 - runIntegrationTests: true - - # Dotnet + Tools versioning: - majorDotnetVersion: 8 # empty uses global.json (for rtm/servicing releases), otherwise the major version, e.g. 6 - includeDotnetPrereleases: true - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -jobs: - - job: BuildAndTest - displayName: Build and Test - strategy: - matrix: - MySQL 8.0 (Windows): # Apr 2026 - vmImageName: 'windows-latest' - databaseServerType: 'mysql' - databaseServerVersion: '8.0.31' - clientExecutable: 'mysql' - sqlMode: $(mysqlCurrentSqlMode) - skipTests: $(skipWindowsTests) - MySQL 8.0 (Linux): # Apr 2026 - vmImageName: 'ubuntu-latest' - databaseServerType: 'mysql' - databaseServerVersion: '8.0.34' - clientExecutable: 'mysql' - sqlMode: $(mysqlCurrentSqlMode) - skipTests: $(skipAllTests) - MySQL 5.7 (Linux): # Oct 2023 - vmImageName: 'ubuntu-latest' - databaseServerType: 'mysql' - databaseServerVersion: '5.7.43' - clientExecutable: 'mysql' - sqlMode: $(mysqlLegacySqlMode) - skipTests: $(skipAllTests) - MariaDB 11.1 (Linux): # Aug 2024 - vmImageName: 'ubuntu-latest' - databaseServerType: 'mariadb' - databaseServerVersion: '11.1.2' - clientExecutable: 'mariadb' - sqlMode: $(mariadbSqlMode) - skipTests: $(skipAllTests) - MariaDB 11.0 (Linux): # Jun 2024 - vmImageName: 'ubuntu-latest' - databaseServerType: 'mariadb' - databaseServerVersion: '11.0.3' - clientExecutable: 'mariadb' - sqlMode: $(mariadbSqlMode) - skipTests: $(skipAllTests) - MariaDB 10.11 (Linux): # Feb 2028 - vmImageName: 'ubuntu-latest' - databaseServerType: 'mariadb' - databaseServerVersion: '10.11.5' - clientExecutable: 'mysql' - sqlMode: $(mariadbSqlMode) - skipTests: $(skipAllTests) - MariaDB 10.10 (Linux): # Nov 2023 - vmImageName: 'ubuntu-latest' - databaseServerType: 'mariadb' - databaseServerVersion: '10.10.6' - clientExecutable: 'mysql' - sqlMode: $(mariadbSqlMode) - skipTests: $(skipAllTests) -# MariaDB 10.9 (Linux): # EoL -# vmImageName: 'ubuntu-latest' -# databaseServerType: 'mariadb' -# databaseServerVersion: '10.9.8' -# clientExecutable: 'mysql' -# sqlMode: $(mariadbSqlMode) -# skipTests: $(skipAllTests) -# MariaDB 10.8 (Linux): # EoL -# vmImageName: 'ubuntu-latest' -# databaseServerType: 'mariadb' -# databaseServerVersion: '10.8.8' -# clientExecutable: 'mysql' -# sqlMode: $(mariadbSqlMode) -# skipTests: $(skipAllTests) -# MariaDB 10.7 (Linux): # EoL -# vmImageName: 'ubuntu-latest' -# databaseServerType: 'mariadb' -# databaseServerVersion: '10.7.8' -# clientExecutable: 'mysql' -# sqlMode: $(mariadbSqlMode) -# skipTests: $(skipAllTests) - MariaDB 10.6 (Linux): # Jul 2026 - vmImageName: 'ubuntu-latest' - databaseServerType: 'mariadb' - databaseServerVersion: '10.6.15' - clientExecutable: 'mysql' - sqlMode: $(mariadbSqlMode) - skipTests: $(skipAllTests) - MariaDB 10.5 (Linux): # Jun 2025 - vmImageName: 'ubuntu-latest' - databaseServerType: 'mariadb' - databaseServerVersion: '10.5.22' - clientExecutable: 'mysql' - sqlMode: $(mariadbSqlMode) - skipTests: $(skipAllTests) - MariaDB 10.4 (Linux): # Jun 2024 - vmImageName: 'ubuntu-latest' - databaseServerType: 'mariadb' - databaseServerVersion: '10.4.31' - clientExecutable: 'mysql' - sqlMode: $(mariadbSqlMode) - skipTests: $(skipAllTests) -# MariaDB 10.3 (Linux): # EoL -# vmImageName: 'ubuntu-latest' -# databaseServerType: 'mariadb' -# databaseServerVersion: '10.3.39' -# sqlMode: $(mariadbSqlMode) -# skipTests: $(skipAllTests) - pool: - vmImage: $(vmImageName) - steps: - - pwsh: | - $dotnetVersion = '' - $dotnetEfToolUpdateVersion = '' - $useGlobalJson = $false - - if ('$(majorDotnetVersion)' -ne '') - { - $dotnetVersion = '$(majorDotnetVersion).x' - - if ('$(includeDotnetPrereleases)' -eq 'true') - { - $dotnetEfToolUpdateVersion = '$(majorDotnetVersion).*-*' - } - else - { - $dotnetEfToolUpdateVersion = '$(majorDotnetVersion).*' - } - } - else - { - $useGlobalJson = $true - } - - echo "##vso[task.setvariable variable=dotnetVersion]$dotnetVersion" - echo "##vso[task.setvariable variable=dotnetEfToolUpdateVersion]$dotnetEfToolUpdateVersion" - echo "##vso[task.setvariable variable=useGlobalJson]$useGlobalJson" - displayName: Set additional variables - - pwsh: | - echo "Agent.OS: $(Agent.OS)" - echo "skipTests: $(skipTests)" - echo "skipWindowsTests: $(skipWindowsTests)" - echo "pullRequestSourceBranch: $(pullRequestSourceBranch)" - echo "isPullRequest: $(isPullRequest)" - echo "Build.SourceBranchName: $(Build.SourceBranchName)" - echo "Build.SourceVersionMessage: $(Build.SourceVersionMessage)" - echo "dotnetVersion: $(dotnetVersion)" - echo "includeDotnetPrereleases: $(includeDotnetPrereleases)" - echo "useGlobalJson: $(useGlobalJson)" - displayName: Output Variables - - task: UseDotNet@2 - displayName: 'Use .NET Core SDK' - inputs: - version: $(dotnetVersion) - includePreviewVersions: $(includeDotnetPrereleases) - useGlobalJson: $(useGlobalJson) - - task: Cache@2 - displayName: Restore Cache - Database Image - Linux - condition: and(not(canceled()), not(failed()), ne(variables['Agent.OS'], 'Windows_NT')) - inputs: - key: 'database | Linux | "$(databaseServerType)" | "$(databaseServerVersion)" | v1' - path: $(Pipeline.Workspace)/cache/database - cacheHitVar: cacheRestoredDatabaseLinux - - task: Cache@2 - displayName: Restore Cache - Database Image - Windows - condition: and(not(canceled()), not(failed()), eq(variables['Agent.OS'], 'Windows_NT')) - inputs: - key: 'database | Windows_NT | "$(databaseServerType)" | "$(databaseServerVersion)" | v1' - path: C:\Users\VssAdministrator\AppData\Local\Temp\mysql - cacheHitVar: cacheRestoredDatabaseWindows - - pwsh: | - if ('$(Agent.OS)' -eq 'Windows_NT') - { - $mySqlServiceName = '$(databaseServerType)_$(databaseServerVersion)' - $lowerCaseTableNames = 2 - $mySqlBinPath = 'C:\tools\mysql\current\bin' - $mySqlIniPath = 'C:\tools\mysql\current\my.ini' - $mySqlDataPath = 'C:\ProgramData\MySQL\data' - - dir 'C:\Users\VssAdministrator\AppData\Local\Temp\$(databaseServerType)\$(databaseServerVersion)' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName - - # choco config set cacheLocation '$(Pipeline.Workspace)/cache/database' - - echo "Chocolatey command: choco install '$(databaseServerType)' '--version=$(databaseServerVersion)' --params `"/serviceName:$mySqlServiceName`"" - choco install '$(databaseServerType)' '--version=$(databaseServerVersion)' --params "/serviceName:$mySqlServiceName" - - Get-Service *MySQL* -ErrorAction SilentlyContinue - Stop-Service $mySqlServiceName -Verbose - - echo "Update PATH environment variable" - Write-Host "##vso[task.prependpath]$mySqlBinPath" - $env:PATH = "$mySqlBinPath;$env:PATH" - - echo "Update configuration file" - "lower_case_table_names=$lowerCaseTableNames" >> $mySqlIniPath - - Remove-Item $mySqlDataPath/* -Recurse -Force -Verbose - - echo "Reinitialize database server" - mysqld --defaults-file="$mySqlIniPath" --initialize-insecure - - Start-Service $mySqlServiceName -Verbose - - echo "Setup credentials" - mysql -h localhost -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password12!';" - mysql -h localhost -u root -pPassword12! -e "SELECT @@version;" - - dir 'C:\Users\VssAdministrator\AppData\Local\Temp\$(databaseServerType)\$(databaseServerVersion)' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName - } - else - { - sudo systemctl stop mysql - - $waitMinutes = 5 - $pollingIntervalSeconds = 1 - $started = $false - - dir '$(Pipeline.Workspace)/cache/database' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName - - if (Test-Path -PathType Leaf '$(Pipeline.Workspace)/cache/database/$(databaseServerType)_$(databaseServerVersion).tar') - { - docker load --input '$(Pipeline.Workspace)/cache/database/$(databaseServerType)_$(databaseServerVersion).tar' - } - else - { - if (-not (Test-Path -PathType Container '$(Pipeline.Workspace)/cache/database')) - { - New-Item -ItemType Directory '$(Pipeline.Workspace)/cache/database' - } - - docker pull '$(databaseServerType):$(databaseServerVersion)' - docker save -o '$(Pipeline.Workspace)/cache/database/$(databaseServerType)_$(databaseServerVersion).tar' '$(databaseServerType):$(databaseServerVersion)' - - dir '$(Pipeline.Workspace)/cache/database' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName - } - - docker run --name $(databaseServerType) -e MYSQL_ROOT_PASSWORD=Password12! -p 127.0.0.1:3306:3306 -d '$(databaseServerType):$(databaseServerVersion)' - $startTime = Get-Date - - while (!($started = docker exec $(databaseServerType) $(clientExecutable) --protocol=tcp -h localhost -P 3306 -u root -pPassword12! -e 'select 1;') -and ((Get-Date) - $startTime).TotalMinutes -lt $waitMinutes) - { - Start-Sleep -Seconds $pollingIntervalSeconds - } - - if (!$started) - { - throw "$(databaseServerType):$(databaseServerVersion) docker container failed to start in ${waitMinutes} minutes" - exit 1 - } - } - displayName: Install Database Server - - pwsh: | - $mySqlCommand = "$(clientExecutable) -u root -pPassword12! -e ""SET GLOBAL sql_mode = '$(sqlMode)'; SET GLOBAL max_connections = $(maxConnections);""" - - if ('$(Agent.OS)' -ne 'Windows_NT') - { - $mySqlCommand = 'docker exec $(databaseServerType) ' + $mySqlCommand - } - - $mySqlCommand - Invoke-Expression $mySqlCommand - echo "Exit code: $?" - displayName: Setup Database - ignoreLASTEXITCODE: true - - pwsh: | - $mySqlCommand = "$(clientExecutable) -u root -pPassword12! -e 'SHOW VARIABLES;'" - - if ('$(Agent.OS)' -ne 'Windows_NT') - { - $mySqlCommand = 'docker exec $(databaseServerType) ' + $mySqlCommand - } - - $mySqlCommand - Invoke-Expression $mySqlCommand - echo "Exit code: $?" - displayName: Database Information - continueOnError: true - failOnStderr: false - ignoreLASTEXITCODE: true - - pwsh: dotnet --info - displayName: .NET Information - - pwsh: | - if ('$(dotnetEfToolUpdateVersion)' -ne '') - { - dotnet tool update dotnet-ef --version $(dotnetEfToolUpdateVersion) - } - - dotnet tool restore - dotnet ef --version - displayName: Install EF Core Tools - - pwsh: | - cp test/EFCore.MySql.FunctionalTests/config.json.example test/EFCore.MySql.FunctionalTests/config.json - cp test/EFCore.MySql.IntegrationTests/appsettings.ci.json test/EFCore.MySql.IntegrationTests/appsettings.json - cp test/EFCore.MySql.IntegrationTests/config.json.example test/EFCore.MySql.IntegrationTests/config.json - displayName: Setup Solution - - pwsh: | - ./test/EFCore.MySql.IntegrationTests/scripts/rebuild.ps1 - displayName: Setup Integration Tests - condition: and(ne(variables['skipTests'], true), eq(variables['runIntegrationTests'],'true')) - - pwsh: | - dotnet build -c Debug - dotnet build -c Release - displayName: Build Solution - - pwsh: | - dotnet test test/EFCore.MySql.FunctionalTests -c Debug --no-build --logger trx --verbosity detailed - displayName: Functional Tests - condition: ne(variables['skipTests'], true) - - pwsh: | - dotnet test --logger trx test/EFCore.MySql.Tests - displayName: Tests - condition: ne(variables['skipTests'], true) - - pwsh: | - Get-ChildItem QueryBaseline.txt -Recurse | % { $_.FullName } - Get-Content QueryBaseline.txt -ErrorAction Ignore - displayName: Show Query Baseline - condition: ne(variables['skipTests'], true) - - pwsh: | - dotnet run --project test/EFCore.MySql.IntegrationTests -c Release testMigrate - displayName: Integration Tests - Applying migrations - condition: and(ne(variables['skipTests'], true), eq(variables['runIntegrationTests'],'true')) - - pwsh: | - ./test/EFCore.MySql.IntegrationTests/scripts/scaffold.ps1 - displayName: Integration Tests - Scaffolding - condition: and(ne(variables['skipTests'], true), eq(variables['runIntegrationTests'],'true')) - - pwsh: | - $env:EF_BATCH_SIZE = "1" - dotnet test -c Release --no-build --logger trx test/EFCore.MySql.IntegrationTests - displayName: Integration Tests - With EF_BATCH_SIZE = 1 - condition: and(ne(variables['skipTests'], true), eq(variables['runIntegrationTests'],'true')) - - pwsh: | - $env:EF_BATCH_SIZE = "10" - dotnet test -c Release --no-build --logger trx test/EFCore.MySql.IntegrationTests - displayName: Integration Tests - With EF_BATCH_SIZE = 10 - condition: and(ne(variables['skipTests'], true), eq(variables['runIntegrationTests'],'true')) - - pwsh: | - $env:EF_RETRY_ON_FAILURE = "3" - dotnet test -c Release --no-build --logger trx test/EFCore.MySql.IntegrationTests - displayName: Integration Tests - With EF_RETRY_ON_FAILURE = 3 - condition: and(ne(variables['skipTests'], true), eq(variables['runIntegrationTests'],'true')) - - pwsh: ./test/EFCore.MySql.IntegrationTests/scripts/legacy.ps1 - displayName: Integration Tests - Legacy migrations - condition: and(ne(variables['skipTests'], true), eq(variables['runIntegrationTests'],'true')) - - pwsh: | - $env:EF_DATABASE = "pomelo_test2" - dotnet build ./test/EFCore.MySql.IntegrationTests -c Release - displayName: Integration Tests - Building migrations with EF_DATABASE = pomelo_test2 - condition: and(ne(variables['skipTests'], true), eq(variables['runIntegrationTests'],'true')) - - pwsh: | - $env:EF_DATABASE = "pomelo_test2" - ./test/EFCore.MySql.IntegrationTests/scripts/rebuild.ps1 - displayName: Integration Tests - Setup migrations with EF_DATABASE = pomelo_test2 - condition: and(ne(variables['skipTests'], true), eq(variables['runIntegrationTests'],'true')) - - pwsh: | - $env:EF_DATABASE = "pomelo_test2" - dotnet test -c Release --no-build --logger trx test/EFCore.MySql.IntegrationTests - displayName: Integration Tests - With EF_DATABASE = pomelo_test2 - condition: and(ne(variables['skipTests'], true), eq(variables['runIntegrationTests'],'true')) - - task: PublishTestResults@2 - displayName: Publish Test Results - condition: and(ne(variables['skipTests'], true), succeededOrFailed()) - inputs: - testResultsFormat: VSTest - testResultsFiles: test/**/*.trx - testRunTitle: $(Agent.OS) $(databaseServerType):$(databaseServerVersion) - mergeTestResults: true - failTaskOnFailedTests: true - - job: NuGet - dependsOn: - - BuildAndTest - condition: and(succeededOrFailed(), ne(variables['isPullRequest'], true)) - variables: - runDespiteIssues: $[endsWith(variables['Build.SourceBranch'], '-wip')] - buildAndTestSucceeded: $[or(eq(dependencies.BuildAndTest.result, 'Succeeded'), and(eq(dependencies.BuildAndTest.result, 'SucceededWithIssues'), variables['runDespiteIssues']))] - pool: - vmImage: 'ubuntu-latest' - steps: - - pwsh: | - $dotnetVersion = '' - $dotnetEfToolUpdateVersion = '' - $useGlobalJson = $false - - if ('$(majorDotnetVersion)' -ne '') - { - $dotnetVersion = '$(majorDotnetVersion).x' - - if ('$(includeDotnetPrereleases)' -eq 'true') - { - $dotnetEfToolUpdateVersion = '$(majorDotnetVersion).*-*' - } - else - { - $dotnetEfToolUpdateVersion = '$(majorDotnetVersion).*' - } - } - else - { - $useGlobalJson = $true - } - - echo "##vso[task.setvariable variable=dotnetVersion]$dotnetVersion" - echo "##vso[task.setvariable variable=dotnetEfToolUpdateVersion]$dotnetEfToolUpdateVersion" - echo "##vso[task.setvariable variable=useGlobalJson]$useGlobalJson" - displayName: Set additional variables - - task: UseDotNet@2 - displayName: 'Use .NET Core SDK' - inputs: - version: $(dotnetVersion) - includePreviewVersions: $(includeDotnetPrereleases) - useGlobalJson: $(useGlobalJson) - - pwsh: dotnet --info - displayName: .NET Information - - pwsh: | - $officialBuild = '$(Build.SourceBranch)' -match '(?<=^refs/tags/)\d+\.\d+\.\d+.*$' - $officialVersion = $Matches.0 - $wipBuild = '$(Build.SourceBranch)' -match '^refs/heads/.*-wip$' - $ciBuildOnly = $wipBuild -or ('$(Build.SourceBranch)' -match '^refs/heads/(?:master|release/.*)$') - $continuousIntegrationTimestamp = Get-Date -Format yyyyMMddHHmmss - $buildSha = '$(Build.SourceVersion)'.SubString(0, 7); - $pack = '$(buildAndTestSucceeded)' -eq "true" -and ($officialBuild -or $ciBuildOnly -or $wipBuild) - - $pushToAzureArtifacts = $pack - $pushToMygetOrg = $pack - $pushToNugetOrg = $officialBuild - - echo "officialBuild: $officialBuild" - echo "officialVersion: $officialVersion" - echo "wipBuild: $wipBuild" - echo "ciBuildOnly: $ciBuildOnly" - echo "continuousIntegrationTimestamp: $continuousIntegrationTimestamp" - echo "buildSha: $buildSha" - echo "pack: $pack" - - echo "pushToAzureArtifacts: $pushToAzureArtifacts" - echo "pushToMygetOrg: $pushToMygetOrg" - echo "pushToNugetOrg: $pushToNugetOrg" - - 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', "$(Build.ArtifactStagingDirectory)/$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 "##vso[task.setvariable variable=Pack.PushToAzureArtifacts]$pushToAzureArtifacts" - echo "##vso[task.setvariable variable=Pack.PushToMygetOrg]$pushToMygetOrg" - echo "##vso[task.setvariable variable=Pack.PushToNugetOrg]$pushToNugetOrg" - displayName: "NuGet Pack" - - task: NuGetCommand@2 - displayName: "NuGet Push - AZDO Feed - Debug" - inputs: - command: push - publishVstsFeed: 'Pomelo.EntityFrameworkCore.MySql/pomelo-efcore-debug' - packagesToPush: '$(Build.ArtifactStagingDirectory)/Debug/withPdbs/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/Debug/withPdbs/**/*.symbols.nupkg' - condition: and(succeededOrFailed(), eq(variables['Pack.PushToAzureArtifacts'],'true')) - - task: NuGetCommand@2 - displayName: "NuGet Push - AZDO Feed - Release" - inputs: - command: push - publishVstsFeed: 'Pomelo.EntityFrameworkCore.MySql/pomelo-efcore-public' - packagesToPush: '$(Build.ArtifactStagingDirectory)/Release/withPdbs/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/Release/withPdbs/**/*.symbols.nupkg' - condition: and(succeededOrFailed(), eq(variables['Pack.PushToAzureArtifacts'],'true')) - - task: NuGetCommand@2 - displayName: "NuGet Push - myget.org - Debug" - inputs: - command: push - nuGetFeedType: external - publishFeedCredentials: MygetOrg-Pomelo-AllPackages-Debug-PushNew - packagesToPush: '$(Build.ArtifactStagingDirectory)/Debug/withPdbs/**/*.nupkg' - condition: and(succeededOrFailed(), eq(variables['Pack.PushToMygetOrg'],'true')) - - task: NuGetCommand@2 - displayName: "NuGet Push - myget.org - Release" - inputs: - command: push - nuGetFeedType: external - publishFeedCredentials: MygetOrg-Pomelo-AllPackages-PushNew - packagesToPush: '$(Build.ArtifactStagingDirectory)/Release/default/**/*.nupkg' - condition: and(succeededOrFailed(), eq(variables['Pack.PushToMygetOrg'],'true')) - - task: NuGetCommand@2 - displayName: "NuGet Push - nuget.org - Release" - inputs: - command: push - nuGetFeedType: external - publishFeedCredentials: NugetOrg-PomeloFoundation-AllPackages-PushNew - packagesToPush: '$(Build.ArtifactStagingDirectory)/Release/default/**/*.nupkg' - condition: and(succeededOrFailed(), eq(variables['Pack.PushToNugetOrg'],'true')) \ No newline at end of file diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 2592c4060..09501c267 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -13,5 +13,6 @@ + diff --git a/test/EFCore.MySql.FunctionalTests/MigrationsMySqlTest.cs b/test/EFCore.MySql.FunctionalTests/MigrationsMySqlTest.cs index 7b8dfaa85..d4619331c 100644 --- a/test/EFCore.MySql.FunctionalTests/MigrationsMySqlTest.cs +++ b/test/EFCore.MySql.FunctionalTests/MigrationsMySqlTest.cs @@ -541,12 +541,35 @@ public override Task Move_table() [SupportedServerVersionCondition(nameof(ServerVersionSupport.Sequences))] public override async Task Rename_sequence() { - await base.Rename_sequence(); + if (OperatingSystem.IsWindows()) + { + // On Windows, with `lower_case_table_names = 2`, renaming `TestSequence` to `testsequence` doesn't do anything, because + // `TestSequence` is internally being transformed to lower case, before it is processes further. + await Test( + builder => { }, + builder => builder.HasSequence("TestSequence"), + builder => builder.HasSequence("testsequence2"), + builder => builder.RenameSequence(name: "TestSequence", newName: "testsequence2"), + model => + { + var sequence = Assert.Single(model.Sequences); + Assert.Equal("testsequence2", sequence.Name); + }); - AssertSql( + AssertSql( +""" +ALTER TABLE `TestSequence` RENAME `testsequence2`; +"""); + } + else + { + await base.Rename_sequence(); + + AssertSql( """ ALTER TABLE `TestSequence` RENAME `testsequence`; """); + } } [ConditionalTheory(Skip = "TODO")]