Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to VS 2017 #7542

Merged
merged 2 commits into from Feb 15, 2017
Merged

Upgrade to VS 2017 #7542

merged 2 commits into from Feb 15, 2017

Conversation

bricelam
Copy link
Contributor

@bricelam bricelam commented Feb 2, 2017

Resolves #7538

Providers/contributors:

  1. Specification tests now target net452 (xUnit.net dropped net451)
  2. EntityFramework.sln now requires Visual Studio 2017 RC. For running tests, TestDriven.NET still works

cc @ErikEJ @roji @tuespetre

@bricelam
Copy link
Contributor Author

bricelam commented Feb 3, 2017

I'm still verifying this, but it's getting close enough to start the review.

I can't get the VS Test runner to work (even after installing Microsoft.NETCore.App version 1.2.0), but TestDriven.NET works (so long as net451 is listed first).

VS 2017 RC.3 chokes during solution load and package restore, but d15rel works.

Looks like there are still issues with tests that compile:

InvalidOperationException: Assembly 'System.Runtime' not found.

Will investigate.

@natemcmaster Any tricks to PreserveCompilationContext?

Copy link
Contributor

@natemcmaster natemcmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor formatting suggestions, but looks good

<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<NoWarn>CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Serviceable>true</Serviceable>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be set automatically for Release builds by Internal.AspNetCore.Sdk

<Compile Include="Scaffolding\Internal\ScaffoldingServiceCollectionExtensions.cs" />
<Compile Include="Scaffolding\Internal\ScaffoldingUtilities.cs" />
<Compile Include="Scaffolding\Internal\StringBuilderCodeWriter.cs" />
<ProjectReference Include="..\Microsoft.EntityFrameworkCore.Relational.Design\Microsoft.EntityFrameworkCore.Relational.Design.csproj" />
</ItemGroup>
<ItemGroup>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: i've been condensing itemgroups so there is one block of package + project references. But up to your team to decide if you like separate blocks better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've observed that VS likes to create different groups for different item types. Following suit tends to keep edits via VS cleaner.

<NoWarn>1591</NoWarn>
<Description>Shared Entity Framework Core components for relational database providers.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<NoWarn>CS1591</NoWarn>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: concat nowarns.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YAGNI, but we might need it, so... 😉

</ProjectReference>
<ItemGroup Condition="'$(TargetFramework)' == 'net451'">
<!-- TODO: Make this a <frameworkAssembly> in the *.nuspec file. -->
<Reference Include="System.Transactions" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a nuget package for this? cref https://github.com/aspnet/Coherence-Signed/issues/389

Copy link
Contributor Author

@bricelam bricelam Feb 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not until 2.0. Will remove ASAP.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(But it will no longer be propagated to the nuspec)

<NoWarn>1591</NoWarn>
<Description>Shared test suite for Entity Framework Core database providers.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<NoWarn>CS1591</NoWarn>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: concat nowarn

<Name>Microsoft.EntityFrameworkCore</Name>
</ProjectReference>
<PackageReference Include="Microsoft.CSharp" Version="4.4.0-*" />
<PackageReference Include="Microsoft.Extensions.RuntimeEnvironment.Sources" Version="1.2.0-*">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: PrivateAssets can be an attribute instead of a nested element.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels more idiomatic as an element to me, but I might just be living in the past...

@natemcmaster
Copy link
Contributor

natemcmaster commented Feb 3, 2017

Does this assembly resolution depend on current working directory? cref microsoft/vstest#311

Also, is this just .NET Framework or .NET core too?

@natemcmaster
Copy link
Contributor

One more thing: add os: Visual Studio 2017 RC to appveyor.yml

@bricelam
Copy link
Contributor Author

bricelam commented Feb 3, 2017

Also, is this just .NET Framework or .NET core too?

Just .NET Core

@natemcmaster
Copy link
Contributor

🤔 hmm, not sure. Lmk if you figure out what's going on. I have similarly weird test failures on Entropy

@bricelam
Copy link
Contributor Author

bricelam commented Feb 3, 2017

Looks like DependencyContext.Load() was returning null. Updating to DependencyContext.Default works.

@bricelam
Copy link
Contributor Author

bricelam commented Feb 3, 2017

Getting closer. It looks like AppVeyor is getting an older build of Roslyn on net451.

@bricelam
Copy link
Contributor Author

bricelam commented Feb 3, 2017

Tests pass locally.

@natemcmaster
Copy link
Contributor

🎉

@natemcmaster
Copy link
Contributor

Curious, how does test time compare? We've seen a huge test slowdown in Kestrel and other projects. cref microsoft/vstest#349 (comment)

@natemcmaster
Copy link
Contributor

@bricelam I just pushed an update to KoreBuild which should make building big repos much faster. It builds solutions instead of individual csprojs. Can you verify it works with your changes?

@@ -6,19 +6,14 @@
using System.Reflection;
using Microsoft.CodeAnalysis;

#if NETSTANDARD1_7
#if !NET451
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will conflict with #7607 changes. Will need to rebase and deal with the fallout, sorry.

<FileAlignment>512</FileAlignment>
<NoWarn>1591</NoWarn>
<TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
<RuntimeIdentifier Condition="'$(TargetFramework)' != 'netcoreapp1.1'">win7-x64</RuntimeIdentifier>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Compile Include="SqlServerCrossStoreFixture.cs" />
<Compile Include="TestModels\CrossStoreContext.cs" />
<Compile Include="TestModels\SimpleEntity.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\Microsoft.EntityFrameworkCore.SqlServer.FunctionalTests\Northwind.sql">
<Link>Northwind.sql</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow @bricelam you are old school 😺 Haven't seen a <link> in forever.

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-*" />
<PackageReference Include="xunit" Version="2.2.0-*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-*" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of these test projects depend on each other or on Microsoft.EntityFrameworkCore.Specification.Tests. Should be bringing at least the xUnit package in transitively. Leave transitive dependencies out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... By default, I don't think build scripts of packages are brought in transitively. I think I have to leave these since both xunit & xunit.runner.visualstudio have build scripts.

@bricelam bricelam force-pushed the feature/msbuild branch 5 times, most recently from 0787416 to 5493d0a Compare February 15, 2017 17:45
@am11
Copy link
Member

am11 commented Feb 15, 2017

@bricelam, the travis build failed with:

The log length has exceeded the limit of 4 MB (this usually means that the test suite is raising the same exception over and over).

The job has been terminated

(https://api.travis-ci.org/jobs/201944010/log.txt?deansi=true)

Seems like this limitation is not configurable yet: travis-ci/travis-ci#3865.

Can the msbuild test target be configured from Korebuild so it only outputs errors and warnings from xunit execution, but not the passing tests (1>/dev/null for test runs only)?

@bricelam
Copy link
Contributor Author

@natemcmaster Any way to make make the test runner shut up about passed tests?

@natemcmaster
Copy link
Contributor

@bricelam not yet. See microsoft/vstest#301 (and add a vote for default output=minimal).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants