From 77a6fbdc34c2d9d34e72001e74461d345b6fb144 Mon Sep 17 00:00:00 2001 From: Smit Patel Date: Mon, 2 Nov 2020 16:19:06 -0800 Subject: [PATCH] Test SqlServer test on Ubuntu in helix Resolves #19974 Resolves #20128 --- azure-pipelines.yml | 5 +++-- eng/helix.proj | 22 +++++++++++++------ .../Query/FromSqlQuerySqlServerTest.cs | 4 ++-- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4e7c0e0a420..fb284f27e9b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -191,12 +191,12 @@ stages: value: $(_BuildConfig) - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: HelixTargetQueues - value: Windows.10.Amd64.Open;Ubuntu.1804.Amd64.Open;OSX.1014.Amd64.Open + value: Windows.10.Amd64.Open;Ubuntu.1804.Amd64.Open;OSX.1014.Amd64.Open;Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-sqlserver-amd64-20201109180804-3069967 - name: _HelixAccessToken value: '' # Needed for public queues - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: HelixTargetQueues - value: Windows.10.Amd64;Ubuntu.1804.Amd64;OSX.1014.Amd64 + value: Windows.10.Amd64;Ubuntu.1804.Amd64;OSX.1014.Amd64;Ubuntu.1604.Amd64@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-sqlserver-amd64-20201109180804-3069967 - name: _HelixAccessToken value: $(HelixApiAccessToken) # Needed for internal queues steps: @@ -221,6 +221,7 @@ stages: env: HelixAccessToken: $(_HelixAccessToken) SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops + MSSQL_SA_PASSWORD: "Password12!" - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - template: eng\common\templates\post-build\post-build.yml diff --git a/eng/helix.proj b/eng/helix.proj index 2598c32b2a4..25d02e3b937 100644 --- a/eng/helix.proj +++ b/eng/helix.proj @@ -14,11 +14,12 @@ true true true + $(RepoRoot)/test/EFCore.SqlServer.FunctionalTests/*.csproj;$(RepoRoot)/test/EFCore.OData.FunctionalTests/*.csproj - Windows.10.Amd64.Open;Ubuntu.1804.Amd64.Open;OSX.1014.Amd64.Open + Windows.10.Amd64.Open;Ubuntu.1804.Amd64.Open;OSX.1014.Amd64.Open;Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-sqlserver-amd64-20201109180804-3069967 false false efcore/localbuild/ @@ -33,17 +34,24 @@ - + $(PreCommands); SqlLocalDB start - - $(PreCommands); SqlLocalDB start - - - $(PreCommands); SqlLocalDB start + + + + + + + $(PreCommands); export MSSQL_SA_PASSWORD=$(MSSQL_SA_PASSWORD); /opt/mssql/bin/sqlservr --accept-eula &; export Test__SqlServer__DefaultConnection="Data Source=localhost;;Database=master;;User=sa;;Password=$(MSSQL_SA_PASSWORD);;Connect Timeout=60;;ConnectRetryCount=0"; sleep 120 + + + + + net5.0 netcoreapp2.0 diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/FromSqlQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/FromSqlQuerySqlServerTest.cs index a758a8fe5f9..f2901e03d6c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/FromSqlQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/FromSqlQuerySqlServerTest.cs @@ -55,7 +55,7 @@ public override async Task FromSqlRaw_queryable_composed(bool async) WHERE [c].[ContactName] LIKE N'%z%'"; AssertSql(expected); - Assert.Equal(expected, queryString); + Assert.Equal(expected, queryString, ignoreLineEndingDifferences: true); return null; } @@ -355,7 +355,7 @@ public override async Task FromSqlRaw_queryable_with_parameters_and_clos FROM ( SELECT * FROM ""Customers"" WHERE ""City"" = @p0 ) AS [c] -WHERE [c].[ContactTitle] = @__contactTitle_1", queryString); +WHERE [c].[ContactTitle] = @__contactTitle_1", queryString, ignoreLineEndingDifferences: true); return null; }