Skip to content

Commit

Permalink
Ignore line ending differences in tests
Browse files Browse the repository at this point in the history
Use single build to run helix tests across different OS.

Resolves #19964
  • Loading branch information
smitpatel committed Mar 9, 2020
1 parent 8425e2d commit 7c9036e
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 46 deletions.
39 changes: 2 additions & 37 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ stages:
value: $(_BuildConfig)
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
- name: HelixTargetQueues
value: Windows.10.Amd64.Open
value: Windows.10.Amd64.Open;Ubuntu.1804.Amd64.Open;OSX.1014.Amd64.Open
- name: Creator
value: efcore
- name: _HelixAccessToken
value: '' # Needed for public queues
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- name: HelixTargetQueues
value: Windows.10.Amd64
value: Windows.10.Amd64;Ubuntu.1804.Amd64;OSX.1014.Amd64
- name: _HelixAccessToken
value: $(HelixApiAccessToken) # Needed for internal queues
steps:
Expand All @@ -231,41 +231,6 @@ stages:
HelixAccessToken: $(_HelixAccessToken)
SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops

- job: Helix_Linux
pool:
vmImage: ubuntu-16.04
variables:
- name: _HelixBuildConfig
value: $(_BuildConfig)
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
- name: HelixTargetQueues
value: Ubuntu.1804.Amd64.Open;OSX.1014.Amd64.Open
- name: Creator
value: efcore
- name: _HelixAccessToken
value: '' # Needed for public queues
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- name: HelixTargetQueues
value: Ubuntu.1804.Amd64;OSX.1014.Amd64
- name: _HelixAccessToken
value: $(HelixApiAccessToken) # Needed for internal queues
steps:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- task: Bash@3
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- script: ./restore.sh --restore -ci /p:configuration=$(_BuildConfig)
displayName: Restore packages
- script: .dotnet/dotnet msbuild eng/helix.proj /restore /t:Test /p:configuration=$(_BuildConfig) /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog
displayName: Send job to helix
env:
HelixAccessToken: $(_HelixAccessToken)
SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops

- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng\common\templates\post-build\post-build.yml
parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
}
}

[ConditionalFact]
[ConditionalFact(Skip = "#18682")]
public void Can_select_appropriate_provider_when_multiple_registered()
{
var serviceProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore.Internal;
using Microsoft.EntityFrameworkCore.Metadata;
Expand Down Expand Up @@ -246,8 +247,7 @@ public void ValueGenerated_works()
new ModelCodeGenerationOptions(),
code =>
{
Assert.Contains(@"Property(e => e.ValueGeneratedOnAdd)
.ValueGeneratedOnAdd()", code.ContextFile.Code);
Assert.Contains(@$"Property(e => e.ValueGeneratedOnAdd){Environment.NewLine} .ValueGeneratedOnAdd()", code.ContextFile.Code);
Assert.Contains("Property(e => e.ValueGeneratedOnAddOrUpdate).ValueGeneratedOnAddOrUpdate()", code.ContextFile.Code);
Assert.Contains("Property(e => e.ConcurrencyToken).IsConcurrencyToken()", code.ContextFile.Code);
Assert.Contains("Property(e => e.ValueGeneratedOnUpdate).ValueGeneratedOnUpdate()", code.ContextFile.Code);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public override void Can_query_all_animal_views()
@"DbSet<Bird>()
.Select(b => InheritanceInMemoryFixture.MaterializeView(b))
.OrderBy(a => a.CountryId)"),
message);
message,
ignoreLineEndingDifferences: true);
}

protected override bool EnforcesFkConstraints => false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public override void Can_query_all_animal_views()
@"DbSet<Bird>()
.Select(b => InheritanceInMemoryFixture.MaterializeView(b))
.OrderBy(a => a.CountryId)"),
message);
message,
ignoreLineEndingDifferences: true);
}

protected override bool EnforcesFkConstraints => false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override string FromSqlRaw_queryable_composed()
) AS ""c""
WHERE ('z' = '') OR (instr(""c"".""ContactName"", 'z') > 0)";

Assert.Equal(expected, queryString);
Assert.Equal(expected, queryString, ignoreLineEndingDifferences: true);

return null;
}
Expand All @@ -43,7 +43,7 @@ .param set @__contactTitle_1 'Sales Representative'
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;
}
Expand Down
6 changes: 4 additions & 2 deletions test/EFCore.Tests/Query/ExpressionPrinterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ public void Complex_MethodCall_printed_correctly()
Expression.Constant("Foobar"),
typeof(string).GetMethods().Single(m => m.Name == nameof(string.Substring) && m.GetParameters().Count() == 2),
Expression.Constant(0),
Expression.Constant(4))));
Expression.Constant(4))),
ignoreLineEndingDifferences: true);
}

[ConditionalFact]
Expand All @@ -193,7 +194,8 @@ public void Linq_methods_printed_as_extensions()
.Select(x => x.ToString())
.AsEnumerable()
.Where(x => x.Length > 1)",
_expressionPrinter.Print(expr.Body));
_expressionPrinter.Print(expr.Body),
ignoreLineEndingDifferences: true);
}
}
}

0 comments on commit 7c9036e

Please sign in to comment.