From 08e3e0b77f39028bd17311efbbeb62c764ad5cbb Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 13 Dec 2016 09:59:11 -0800 Subject: [PATCH] Cleanup dotnet-watch testing --- ...oft.Extensions.Caching.SqlConfig.Tools.csproj | 2 +- ...crosoft.Extensions.SecretManager.Tools.csproj | 4 ++-- src/dir.props | 2 +- ...t.DotNet.Watcher.Tools.FunctionalTests.csproj | 16 ++++++++++++++-- .../Scenario/ProjectToolScenario.cs | 14 ++++++++++++++ .../TestProjects/AppWithDeps/AppWithDeps.csproj | 5 ++++- .../TestProjects/AppWithDeps/NuGet.config | 8 -------- .../TestProjects/Dependency/Dependency.csproj | 5 ++++- .../TestProjects/Dependency/NuGet.config | 8 -------- .../TestProjects/GlobbingApp/GlobbingApp.csproj | 5 ++++- .../TestProjects/GlobbingApp/NuGet.config | 8 -------- .../TestProjects/NoDepsApp/NoDepsApp.csproj | 5 ++++- .../TestProjects/NoDepsApp/NuGet.config | 8 -------- .../Microsoft.DotNet.Watcher.Tools.Tests.csproj | 9 +++++++-- ...t.Extensions.SecretManager.Tools.Tests.csproj | 7 ++++++- .../Microsoft.Extensions.Tools.Tests.csproj | 7 ++++++- test/dir.props | 1 - 17 files changed, 67 insertions(+), 47 deletions(-) delete mode 100644 test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/NuGet.config delete mode 100644 test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/NuGet.config delete mode 100644 test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/NuGet.config delete mode 100644 test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NuGet.config diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj index b80470dad0..6a05d21dde 100644 --- a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj +++ b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj @@ -3,7 +3,7 @@ netcoreapp1.0 dotnet-sql-cache - Exe + exe Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching. cache;distributedcache;sqlserver diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj b/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj index a7a16434b8..142fbcbabe 100644 --- a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj +++ b/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj @@ -3,7 +3,7 @@ netcoreapp1.0 dotnet-user-secrets - Exe + exe Command line tool to manage user secrets for Microsoft.Extensions.Configuration. configuration;secrets;usersecrets false @@ -17,6 +17,6 @@ - + \ No newline at end of file diff --git a/src/dir.props b/src/dir.props index e60794fbbe..addeb75498 100644 --- a/src/dir.props +++ b/src/dir.props @@ -11,6 +11,6 @@ - + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj index 274d05f92e..2cb75f63ab 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj @@ -1,9 +1,12 @@  + + - netcoreapp1.0 - Exe + netcoreapp1.0;netcoreapp1.1 + exe + @@ -15,7 +18,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs index effcb9de32..2b62d17db9 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs @@ -127,6 +127,20 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests args.Add("--runtimeconfig"); args.Add(Path.Combine(AppContext.BaseDirectory, thisAssembly + ".runtimeconfig.json")); + var currentFxVersion = AppContext.GetData("FX_DEPS_FILE") as string; + if (currentFxVersion != null) + { + // This overrides the version of shared fx in the runtimeconfig.json file. + // Tests do this to ensure dotnet-watch is executing on the version of Microsoft.NETCore.App + // used by the current test project. The test project can target multiple version of + // netcoreapp1.x in order to ensure the tool runs when it is lifted to higher netcore versions + // due to inclusion of the 'prefercliruntime' file in our nupkg. + + var version = new FileInfo(currentFxVersion).Directory.Name; + args.Add("--fx-version"); + args.Add(version); + } + args.Add(Path.Combine(AppContext.BaseDirectory, "dotnet-watch.dll")); return args; diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj index a0446a8118..40b6fd7ae2 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj @@ -1,12 +1,15 @@ + netcoreapp1.0 - Exe + exe + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/NuGet.config b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/NuGet.config deleted file mode 100644 index d8093c7fa9..0000000000 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/NuGet.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj index c48eaffb24..f800ba3b09 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj @@ -1,11 +1,14 @@ + netstandard1.5 - Library + library + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/NuGet.config b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/NuGet.config deleted file mode 100644 index d8093c7fa9..0000000000 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/NuGet.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj index 380a05f12b..7a6df0e8bc 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj @@ -1,11 +1,14 @@  + netcoreapp1.0 - Exe + exe + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/NuGet.config b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/NuGet.config deleted file mode 100644 index d8093c7fa9..0000000000 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/NuGet.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj index 7ad3f30ac9..5cbd709f53 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj @@ -1,11 +1,14 @@  + netcoreapp1.0 - Exe + exe + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NuGet.config b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NuGet.config deleted file mode 100644 index d8093c7fa9..0000000000 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NuGet.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj b/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj index c4885a4fab..d4201a9e72 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj @@ -1,9 +1,12 @@  + + netcoreapp1.0 - Exe + exe + @@ -11,5 +14,7 @@ + - \ No newline at end of file + + diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj b/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj index 503a9ed18f..29ea81b6aa 100644 --- a/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj +++ b/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj @@ -1,12 +1,17 @@  + + netcoreapp1.0 - Exe + exe + + + \ No newline at end of file diff --git a/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj b/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj index 57f7f2c63b..775ec194cd 100644 --- a/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj +++ b/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj @@ -1,11 +1,16 @@  + + netcoreapp1.0 - Exe + exe + + + \ No newline at end of file diff --git a/test/dir.props b/test/dir.props index 1fff509174..a0553297be 100644 --- a/test/dir.props +++ b/test/dir.props @@ -2,7 +2,6 @@ -