From 3e58f168c6720781479f0ca30c56fc0e456283f9 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 15:43:22 -0800 Subject: [PATCH 01/51] Add coverlet to generate code coverage files for test projects. --- test/Directory.Build.props | 1 + test/Directory.Build.targets | 10 +++++++++- test/run-tests.proj | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 30b80439f1..e8a7756e2a 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -31,6 +31,7 @@ + diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 88f693b838..a8a55b3f03 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -1,5 +1,13 @@ - + + + true + opencover + $(MSBuildThisFileDirectory)..\bin\coverage\$(AssemblyName).xml + [Microsoft.ML.*]* + $(MSBuildThisFileDirectory)**\*.* + + \ No newline at end of file diff --git a/test/run-tests.proj b/test/run-tests.proj index a5afe75dd3..3f435cd975 100644 --- a/test/run-tests.proj +++ b/test/run-tests.proj @@ -10,7 +10,7 @@ + Properties="VSTestNoBuild=true;Coverage=true" /> From 4abf24f3ebd0d78e2e8849639361732ef6c9f6f6 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 16:31:28 -0800 Subject: [PATCH 02/51] build fix. --- test/Directory.Build.targets | 1 + test/run-tests.proj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index a8a55b3f03..08edbc76b4 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -4,6 +4,7 @@ true + true opencover $(MSBuildThisFileDirectory)..\bin\coverage\$(AssemblyName).xml [Microsoft.ML.*]* diff --git a/test/run-tests.proj b/test/run-tests.proj index 3f435cd975..fec7a530db 100644 --- a/test/run-tests.proj +++ b/test/run-tests.proj @@ -10,7 +10,7 @@ + Properties="VSTestNoBuild=true;Coverage=true;CopyLocalLockFileAssemblies=true" /> From c9e1c488d4e919c3572f98321ec0ad4ffbc0b161 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 16:43:54 -0800 Subject: [PATCH 03/51] PR feedback. --- test/Directory.Build.targets | 1 - 1 file changed, 1 deletion(-) diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 08edbc76b4..e0fd57e748 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -8,7 +8,6 @@ opencover $(MSBuildThisFileDirectory)..\bin\coverage\$(AssemblyName).xml [Microsoft.ML.*]* - $(MSBuildThisFileDirectory)**\*.* \ No newline at end of file From ff53ec2f281aa6f5f530c3f218e25a45f46e97f1 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 17:12:02 -0800 Subject: [PATCH 04/51] build fix. --- test/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index e8a7756e2a..d385386dfd 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -31,7 +31,7 @@ - + From b982a4d24992711d72234012e1b4ed266d9bc382 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 18:01:21 -0800 Subject: [PATCH 05/51] build fix. --- test/Directory.Build.props | 2 +- test/Directory.Build.targets | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index d385386dfd..e8a7756e2a 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -31,7 +31,7 @@ - + diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index e0fd57e748..69a70dd9de 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -2,7 +2,7 @@ - + true true opencover From 687754b8ad16412b6c5c47c005f4fddc51829c31 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 18:03:51 -0800 Subject: [PATCH 06/51] build fix. --- test/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 69a70dd9de..37a060668a 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -2,7 +2,7 @@ - + true true opencover From cd0146d5d604ef78aa1259cc2cfdf771ce869b7a Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 18:11:22 -0800 Subject: [PATCH 07/51] build fix. --- test/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 37a060668a..56ba92cbb7 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -2,7 +2,7 @@ - + true true opencover From a1b92b2629cb98ed6d009e2043b8e04a8147abeb Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 18:13:41 -0800 Subject: [PATCH 08/51] build fix. --- test/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 56ba92cbb7..e225ddff21 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -2,7 +2,7 @@ - + true true opencover From ebd2daa33f6cab5549574639f6e84e8586a18d45 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 18:25:51 -0800 Subject: [PATCH 09/51] build fix. --- test/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index e225ddff21..29b0ca41e9 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -2,7 +2,7 @@ - + true true opencover From c7de1d13ea1c99e26218a1b11dcb9fde9e83d0a1 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 19:47:18 -0800 Subject: [PATCH 10/51] build fix. --- test/Directory.Build.targets | 8 -------- test/run-tests.proj | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 29b0ca41e9..534df0c677 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -2,12 +2,4 @@ - - true - true - opencover - $(MSBuildThisFileDirectory)..\bin\coverage\$(AssemblyName).xml - [Microsoft.ML.*]* - - \ No newline at end of file diff --git a/test/run-tests.proj b/test/run-tests.proj index fec7a530db..1b59b3503d 100644 --- a/test/run-tests.proj +++ b/test/run-tests.proj @@ -10,7 +10,7 @@ + Properties="VSTestNoBuild=true;Coverage=true;CopyLocalLockFileAssemblies=true;CoverletOutputFormat=opencover;CoverletOutput=$(MSBuildThisFileDirectory)..\bin\coverage\$(AssemblyName).xml;Include=[Microsoft.ML.*]*" /> From b8fa15c413064a906a0bcbadceae644a8ccea47c Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 19:58:09 -0800 Subject: [PATCH 11/51] build fix. --- test/run-tests.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run-tests.proj b/test/run-tests.proj index 1b59b3503d..4d916964a7 100644 --- a/test/run-tests.proj +++ b/test/run-tests.proj @@ -10,7 +10,7 @@ + Properties="VSTestNoBuild=true;CollectCoverage=true;CopyLocalLockFileAssemblies=true;CoverletOutputFormat=opencover;CoverletOutput=$(MSBuildThisFileDirectory)..\bin\coverage\$(AssemblyName).xml;Include=[Microsoft.ML.*]*" /> From 648edbf3ebc95a9d07f132b093315473db75a6c5 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 10 Jan 2019 20:15:32 -0800 Subject: [PATCH 12/51] build fix. --- test/Directory.Build.targets | 8 ++++++++ test/run-tests.proj | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 534df0c677..29b0ca41e9 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -2,4 +2,12 @@ + + true + true + opencover + $(MSBuildThisFileDirectory)..\bin\coverage\$(AssemblyName).xml + [Microsoft.ML.*]* + + \ No newline at end of file diff --git a/test/run-tests.proj b/test/run-tests.proj index 4d916964a7..5b47e5b7ad 100644 --- a/test/run-tests.proj +++ b/test/run-tests.proj @@ -10,7 +10,7 @@ + Properties="VSTestNoBuild=true;Coverage=true;" /> From 8b016adb21fbf15f06f2975a25c6138e8c69140a Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 11 Jan 2019 15:02:55 -0800 Subject: [PATCH 13/51] pr feedback --- test/Directory.Build.props | 11 ++++++++++- test/Directory.Build.targets | 8 -------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index e8a7756e2a..2719b90542 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -32,6 +32,15 @@ + - + + true + true + opencover + $(BaseOutputPath)$(PlatformConfig)\coverage\$(AssemblyName).xml + [Microsoft.ML.*]* + 0 + + diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 29b0ca41e9..534df0c677 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -2,12 +2,4 @@ - - true - true - opencover - $(MSBuildThisFileDirectory)..\bin\coverage\$(AssemblyName).xml - [Microsoft.ML.*]* - - \ No newline at end of file From 622690f3101bbd7a27a203318f339cff88ba3ef3 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 11 Jan 2019 15:32:58 -0800 Subject: [PATCH 14/51] PR feedback. --- test/Directory.Build.props | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 2719b90542..b642071f0a 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -34,11 +34,12 @@ - + true true opencover - $(BaseOutputPath)$(PlatformConfig)\coverage\$(AssemblyName).xml + $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml + $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml [Microsoft.ML.*]* 0 From c45b4cbae469bad5bac4051220f073093b055906 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 11 Jan 2019 17:25:30 -0800 Subject: [PATCH 15/51] move coverlet to a stable version that doesn't contain bug. --- test/Directory.Build.props | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index b642071f0a..17e157749b 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -31,17 +31,16 @@ - + true true opencover - $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml - $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml + $(BaseOutputPath)$(PlatformConfig)\coverage\ + $(MSBuildProjectName).xml [Microsoft.ML.*]* - 0 From 2bdafa905dd16d4bcf4e603d45eef5f0d4daa789 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 11 Jan 2019 18:18:29 -0800 Subject: [PATCH 16/51] PR feedback. --- test/Directory.Build.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 17e157749b..b4a1e45d07 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -31,7 +31,7 @@ - + @@ -40,6 +40,7 @@ opencover $(BaseOutputPath)$(PlatformConfig)\coverage\ $(MSBuildProjectName).xml + $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml [Microsoft.ML.*]* From 3040ede2d1dad9c9100ae1752c42ad15eceaae53 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 11 Jan 2019 19:46:13 -0800 Subject: [PATCH 17/51] fix. --- test/Directory.Build.props | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index b4a1e45d07..7ea60cac31 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -31,15 +31,13 @@ - + true true opencover - $(BaseOutputPath)$(PlatformConfig)\coverage\ - $(MSBuildProjectName).xml $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml [Microsoft.ML.*]* From 3ffe2031d8e78bf4ed4063098bdd1f0d1dc53a5d Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 11 Jan 2019 20:06:15 -0800 Subject: [PATCH 18/51] fix. --- .../ScenariosWithDirectInstantiation/TensorflowTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs b/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs index 4699131680..d1e40bd837 100644 --- a/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs +++ b/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs @@ -602,7 +602,7 @@ public void TensorFlowTransformCifar() } } - [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only + [Fact(Skip="temp")]//ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TensorFlowTransformCifarSavedModel() { var modelLocation = "cifar_saved_model"; From dfdb963b1d6454baa32ae6c1381f942a7c137d13 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 11 Jan 2019 20:24:22 -0800 Subject: [PATCH 19/51] fix. --- .../ScenariosWithDirectInstantiation/TensorflowTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs b/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs index d1e40bd837..4699131680 100644 --- a/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs +++ b/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs @@ -602,7 +602,7 @@ public void TensorFlowTransformCifar() } } - [Fact(Skip="temp")]//ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TensorFlowTransformCifarSavedModel() { var modelLocation = "cifar_saved_model"; From 84c9f6fa3680296c3a1767705f71d873c656e832 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 11 Jan 2019 20:30:37 -0800 Subject: [PATCH 20/51] fix. --- test/run-tests.proj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/run-tests.proj b/test/run-tests.proj index 5b47e5b7ad..fde36b1007 100644 --- a/test/run-tests.proj +++ b/test/run-tests.proj @@ -10,7 +10,8 @@ + Properties="VSTestNoBuild=true;Coverage=true;" + ContinueOnError="WarnAndContinue"/> From c781aaff595f8c08275b8fdc898b0623e1fe192d Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 17 Jan 2019 09:45:46 -0800 Subject: [PATCH 21/51] update coverlet nuget version to get the latest and greatest. --- test/Directory.Build.props | 2 +- test/run-tests.proj | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 7ea60cac31..c8e9ef87ea 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -31,7 +31,7 @@ - + diff --git a/test/run-tests.proj b/test/run-tests.proj index fde36b1007..44305e84f2 100644 --- a/test/run-tests.proj +++ b/test/run-tests.proj @@ -10,8 +10,7 @@ + Properties="VSTestNoBuild=true;Coverage=true;"/> From d21d981c418aaf09f03b3c9327b0b660a4ae7d87 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 17 Jan 2019 10:45:59 -0800 Subject: [PATCH 22/51] increase build timeout to get clean builds. --- build/ci/phase-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index c7a9303c60..2eacc36450 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -12,7 +12,7 @@ phases: _phaseName: ${{ parameters.name }} _arch: ${{ parameters.architecture }} queue: - timeoutInMinutes: 45 + timeoutInMinutes: 75 parallel: 99 matrix: ${{ if eq(parameters.customMatrixes, '') }}: From b57f108e5cd46485c13a921ba2bed1659f78ed29 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 17 Jan 2019 12:41:41 -0800 Subject: [PATCH 23/51] exclude coverage from hot and trivial code paths to improve perf and increase build timeout. --- build/ci/phase-template.yml | 2 +- src/Microsoft.ML.Core/Data/VBuffer.cs | 2 ++ src/Microsoft.ML.Core/Utilities/Contracts.cs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index 2eacc36450..ded50d3bd2 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -12,7 +12,7 @@ phases: _phaseName: ${{ parameters.name }} _arch: ${{ parameters.architecture }} queue: - timeoutInMinutes: 75 + timeoutInMinutes: 200 parallel: 99 matrix: ${{ if eq(parameters.customMatrixes, '') }}: diff --git a/src/Microsoft.ML.Core/Data/VBuffer.cs b/src/Microsoft.ML.Core/Data/VBuffer.cs index 949857bc2b..f7ac903594 100644 --- a/src/Microsoft.ML.Core/Data/VBuffer.cs +++ b/src/Microsoft.ML.Core/Data/VBuffer.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using Microsoft.ML.Internal.Utilities; namespace Microsoft.ML.Data @@ -78,6 +79,7 @@ public VBuffer(int length, T[] values, int[] indices = null) /// /// Construct a possibly sparse representation. /// + [ExcludeFromCodeCoverage] public VBuffer(int length, int count, T[] values, int[] indices) { Contracts.CheckParam(length >= 0, nameof(length)); diff --git a/src/Microsoft.ML.Core/Utilities/Contracts.cs b/src/Microsoft.ML.Core/Utilities/Contracts.cs index 6fc94f6304..77ba12e593 100644 --- a/src/Microsoft.ML.Core/Utilities/Contracts.cs +++ b/src/Microsoft.ML.Core/Utilities/Contracts.cs @@ -12,6 +12,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Threading; @@ -831,6 +832,7 @@ private static void DbgFailEmpty(IExceptionContext ctx, string msg) #endregion Private assert handling [Conditional("DEBUG")] + [ExcludeFromCodeCoverage] public static void Assert(bool f) { if (!f) From 741a5171df1048f76c546156efeae69ac95fea2b Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Thu, 17 Jan 2019 16:54:31 -0800 Subject: [PATCH 24/51] exclude utils classes from CC to measure pref improvements. --- test/Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index c8e9ef87ea..27641e7be7 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -40,6 +40,7 @@ opencover $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml [Microsoft.ML.*]* + [*]Microsoft.ML.*Contracts*,[*]Microsoft.ML.Internal.Utilities*,[*]Microsoft.ML.Data.VBuffer* From 355b8a4a30e5605384477a705cc5796fa197fcd4 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 11:35:20 -0800 Subject: [PATCH 25/51] limit code coverage to just win x64 debug. --- test/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 27641e7be7..b839152c77 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -34,7 +34,7 @@ - + true true opencover From aebd03802f4d5665a0b56f2f0a3f60b1743b25f5 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 12:07:08 -0800 Subject: [PATCH 26/51] add code cov. --- build/Codecov.proj | 33 +++++++++++++++++++++++++++++++++ build/Dependencies.props | 1 + test/Directory.Build.props | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 build/Codecov.proj diff --git a/build/Codecov.proj b/build/Codecov.proj new file mode 100644 index 0000000000..823bba9f80 --- /dev/null +++ b/build/Codecov.proj @@ -0,0 +1,33 @@ + + + + $(MSBuildThisFileDirectory)..\ + + + + + <_CodecovPath>$(NuGetPackageRoot)codecov\$(CodecovVersion)\tools\Codecov.exe + + <_BranchName Condition="'$(_BranchName)' == ''">$(ghprbTargetBranch) + <_BranchName Condition="'$(_BranchName)' == ''">$(BranchName) + + + + <_CoverageReports Include="$(ArtifactsTestResultsDir)*.coverage" /> + + <_CodecovArgs Include="-f;@(_CoverageReports)" /> + <_CodecovArgs Include="-r;$(QualifiedRepoName)" Condition="'$(QualifiedRepoName)' != ''" /> + <_CodecovArgs Include="--pr;$(ghprbPullId)" Condition="'$(ghprbPullId)' != ''" /> + <_CodecovArgs Include="-b;$(BUILD_NUMBER)" Condition="'$(BUILD_NUMBER)' != ''" /> + <_CodecovArgs Include="--branch;$(_BranchName)" Condition="'$(_BranchName)' != ''" /> + <_CodecovArgs Include="-c;$(ghprbActualCommit)" Condition="'$(ghprbActualCommit)' != ''" /> + <_CodecovArgs Include="-n;$(JOB_NAME)" Condition="'$(JOB_NAME)' != ''" /> + <_CodecovArgs Include="--flag;$(Configuration)" Condition="'$(Configuration)' != ''" /> + + + + + + + \ No newline at end of file diff --git a/build/Dependencies.props b/build/Dependencies.props index d10339d749..f0e114d565 100644 --- a/build/Dependencies.props +++ b/build/Dependencies.props @@ -34,6 +34,7 @@ 1.0.0-beta-62824-02 + 1.1.0 diff --git a/test/Directory.Build.props b/test/Directory.Build.props index b839152c77..a29d70f918 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -32,7 +32,7 @@ - + true From 8f5388973caf02976f71ebd244a422b9baa870cf Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 12:09:00 -0800 Subject: [PATCH 27/51] add code cov. --- test/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index a29d70f918..2534e4f794 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -32,7 +32,7 @@ - + true From 24ad24a3d45917773ca3197e12d7ca5ff441a48d Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 12:47:41 -0800 Subject: [PATCH 28/51] add code cov. --- build/Codecov.proj | 20 +++++++++++--------- build/ci/phase-template.yml | 5 +++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/build/Codecov.proj b/build/Codecov.proj index 823bba9f80..c263a76498 100644 --- a/build/Codecov.proj +++ b/build/Codecov.proj @@ -8,25 +8,27 @@ <_CodecovPath>$(NuGetPackageRoot)codecov\$(CodecovVersion)\tools\Codecov.exe - <_BranchName Condition="'$(_BranchName)' == ''">$(ghprbTargetBranch) - <_BranchName Condition="'$(_BranchName)' == ''">$(BranchName) + <_BranchName Condition="'$(_BranchName)' == ''">$(SYSTEM_PULLREQUEST_TARGETBRANCH) + <_BranchName Condition="'$(_BranchName)' == ''">$(BUILD_SOURCEBRANCHNAME) <_CoverageReports Include="$(ArtifactsTestResultsDir)*.coverage" /> <_CodecovArgs Include="-f;@(_CoverageReports)" /> - <_CodecovArgs Include="-r;$(QualifiedRepoName)" Condition="'$(QualifiedRepoName)' != ''" /> - <_CodecovArgs Include="--pr;$(ghprbPullId)" Condition="'$(ghprbPullId)' != ''" /> - <_CodecovArgs Include="-b;$(BUILD_NUMBER)" Condition="'$(BUILD_NUMBER)' != ''" /> + <_CodecovArgs Include="-r;$(BUILD_REPOSITORY_NAME)" Condition="'$(BUILD_REPOSITORY_NAME)' != ''" /> + <_CodecovArgs Include="--pr;$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)" Condition="'$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)' != ''" /> + <_CodecovArgs Include="-b;$(BUILD_BUILDNUMBER)" Condition="'$(BUILD_BUILDNUMBER)' != ''" /> <_CodecovArgs Include="--branch;$(_BranchName)" Condition="'$(_BranchName)' != ''" /> - <_CodecovArgs Include="-c;$(ghprbActualCommit)" Condition="'$(ghprbActualCommit)' != ''" /> - <_CodecovArgs Include="-n;$(JOB_NAME)" Condition="'$(JOB_NAME)' != ''" /> + <_CodecovArgs Include="-c;$(BUILD_SOURCEVERSION)" Condition="'$(BUILD_SOURCEVERSION)' != ''" /> + <_CodecovArgs Include="-n;$(BUILD_DEFINITIONNAME)" Condition="'$(BUILD_DEFINITIONNAME)' != ''" /> <_CodecovArgs Include="--flag;$(Configuration)" Condition="'$(Configuration)' != ''" /> - + + + diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index ded50d3bd2..04351025c8 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -37,6 +37,11 @@ phases: displayName: Install runtime dependencies - script: $(_buildScript) -$(_configuration) -runtests displayName: Run Tests + - script: msbuild build/Codecov.proj /t:Codecov /p:UseCodecov=true + env: + CODECOV_TOKEN: $(CODECOV_TOKEN) + displayName: Upload coverage to codecov.io + condition: and(eq(parameters.name, 'Windows_x64'), eq(_configuration, 'Debug')) - task: PublishTestResults@2 displayName: Publish Test Results condition: succeededOrFailed() From 8a52e13fedc90f26c69ceb9204b8d9f831629eca Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 12:55:15 -0800 Subject: [PATCH 29/51] build break. --- build/Codecov.proj | 6 ++---- build/ci/phase-template.yml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/build/Codecov.proj b/build/Codecov.proj index c263a76498..ee80ca9333 100644 --- a/build/Codecov.proj +++ b/build/Codecov.proj @@ -1,8 +1,7 @@ - - $(MSBuildThisFileDirectory)..\ - + + @@ -31,5 +30,4 @@ - \ No newline at end of file diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index 04351025c8..081243cfbb 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -41,7 +41,7 @@ phases: env: CODECOV_TOKEN: $(CODECOV_TOKEN) displayName: Upload coverage to codecov.io - condition: and(eq(parameters.name, 'Windows_x64'), eq(_configuration, 'Debug')) + condition: and(eq(Agent.JobName, 'Windows_x64'), eq(_configuration, 'Debug')) - task: PublishTestResults@2 displayName: Publish Test Results condition: succeededOrFailed() From 03cb6d5a7ac8300b95b7179afbad7ea453e75f62 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 12:56:28 -0800 Subject: [PATCH 30/51] build break. --- build/ci/phase-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index 081243cfbb..6a8c8d9ee9 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -41,7 +41,7 @@ phases: env: CODECOV_TOKEN: $(CODECOV_TOKEN) displayName: Upload coverage to codecov.io - condition: and(eq(Agent.JobName, 'Windows_x64'), eq(_configuration, 'Debug')) + condition: eq(Agent.JobName, 'Windows_x64 Build_Debug') - task: PublishTestResults@2 displayName: Publish Test Results condition: succeededOrFailed() From d6db6ff99538371d08c52211fbafc7352aab72ac Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 12:58:56 -0800 Subject: [PATCH 31/51] build break. --- build/ci/phase-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index 6a8c8d9ee9..cc349aad0b 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -41,7 +41,7 @@ phases: env: CODECOV_TOKEN: $(CODECOV_TOKEN) displayName: Upload coverage to codecov.io - condition: eq(Agent.JobName, 'Windows_x64 Build_Debug') + condition: and(eq($(_phaseName), 'Windows_x64'), eq($(_configuration), 'Debug')) - task: PublishTestResults@2 displayName: Publish Test Results condition: succeededOrFailed() From 8498f057b6cd75f4d0bd6a158b5ebb9cdafe1220 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 13:00:18 -0800 Subject: [PATCH 32/51] build break. --- build/ci/phase-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index cc349aad0b..9b59214487 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -41,7 +41,7 @@ phases: env: CODECOV_TOKEN: $(CODECOV_TOKEN) displayName: Upload coverage to codecov.io - condition: and(eq($(_phaseName), 'Windows_x64'), eq($(_configuration), 'Debug')) + condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) - task: PublishTestResults@2 displayName: Publish Test Results condition: succeededOrFailed() From 662c4d9560a80ea8a1694edd48d5eabae5db7387 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 13:03:33 -0800 Subject: [PATCH 33/51] build break. --- build/ci/phase-template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index 9b59214487..7f4ccfe3d9 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -35,13 +35,13 @@ phases: - ${{ if eq(parameters.name, 'MacOS') }}: - script: brew update && brew install libomp mono-libgdiplus gettext && brew link gettext --force displayName: Install runtime dependencies - - script: $(_buildScript) -$(_configuration) -runtests - displayName: Run Tests - script: msbuild build/Codecov.proj /t:Codecov /p:UseCodecov=true env: CODECOV_TOKEN: $(CODECOV_TOKEN) displayName: Upload coverage to codecov.io condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) + - script: $(_buildScript) -$(_configuration) -runtests + displayName: Run Tests - task: PublishTestResults@2 displayName: Publish Test Results condition: succeededOrFailed() From ec6c4769cc928b7e5dce02bf0548e0d781413859 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 13:27:38 -0800 Subject: [PATCH 34/51] build break. --- build/ci/phase-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index 7f4ccfe3d9..a58da33d80 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -35,7 +35,7 @@ phases: - ${{ if eq(parameters.name, 'MacOS') }}: - script: brew update && brew install libomp mono-libgdiplus gettext && brew link gettext --force displayName: Install runtime dependencies - - script: msbuild build/Codecov.proj /t:Codecov /p:UseCodecov=true + - script: dotnet msbuild build/Codecov.proj /t:Codecov /p:UseCodecov=true env: CODECOV_TOKEN: $(CODECOV_TOKEN) displayName: Upload coverage to codecov.io From 8508b3bec1c2976cf3238f8b98d3641b1eae384a Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 13:45:56 -0800 Subject: [PATCH 35/51] build break. --- build/Codecov.proj | 1 + 1 file changed, 1 insertion(+) diff --git a/build/Codecov.proj b/build/Codecov.proj index ee80ca9333..816dc95a4b 100644 --- a/build/Codecov.proj +++ b/build/Codecov.proj @@ -22,6 +22,7 @@ <_CodecovArgs Include="-c;$(BUILD_SOURCEVERSION)" Condition="'$(BUILD_SOURCEVERSION)' != ''" /> <_CodecovArgs Include="-n;$(BUILD_DEFINITIONNAME)" Condition="'$(BUILD_DEFINITIONNAME)' != ''" /> <_CodecovArgs Include="--flag;$(Configuration)" Condition="'$(Configuration)' != ''" /> + <_CodecovArgs Include="-t;$(CODECOV_TOKEN)" Condition="'$(CODECOV_TOKEN)' != ''" /> From 95831d251585f4ea10aabf65f69a09a5adee98af Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 14:06:13 -0800 Subject: [PATCH 36/51] fix codecov args. --- build/Codecov.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Codecov.proj b/build/Codecov.proj index 816dc95a4b..fa6be89eb8 100644 --- a/build/Codecov.proj +++ b/build/Codecov.proj @@ -1,6 +1,6 @@ - + @@ -12,7 +12,7 @@ - <_CoverageReports Include="$(ArtifactsTestResultsDir)*.coverage" /> + <_CoverageReports Include="$(MSBuildThisFileDirectory)..\bin\AnyCPU.Debug\coverage\*.coverage" /> <_CodecovArgs Include="-f;@(_CoverageReports)" /> <_CodecovArgs Include="-r;$(BUILD_REPOSITORY_NAME)" Condition="'$(BUILD_REPOSITORY_NAME)' != ''" /> From 229f0e1226baec007d02d38908c94ca642366a42 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 14:06:38 -0800 Subject: [PATCH 37/51] fix codecov args. --- build/NuGet.props | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 build/NuGet.props diff --git a/build/NuGet.props b/build/NuGet.props new file mode 100644 index 0000000000..45475b7e76 --- /dev/null +++ b/build/NuGet.props @@ -0,0 +1,9 @@ + + + + $(NUGET_PACKAGES) + $(UserProfile)\.nuget\packages\ + $([System.Environment]::GetFolderPath(SpecialFolder.Personal))\.nuget\packages\ + $(NuGetPackageRoot)\ + + \ No newline at end of file From d250b1a5d8ee4065e70dfae5e6642a70c05d241e Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 14:08:14 -0800 Subject: [PATCH 38/51] fix codecov args. --- build/Codecov.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Codecov.proj b/build/Codecov.proj index fa6be89eb8..899affb5e6 100644 --- a/build/Codecov.proj +++ b/build/Codecov.proj @@ -1,6 +1,6 @@ - + From 4a3d686633e8c750b9b2b14b9aa0e4012a5bc13d Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 14:18:49 -0800 Subject: [PATCH 39/51] Enable uploading of code coverage reports to codecov. --- build/Codecov.proj | 7 +++---- build/ci/phase-template.yml | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build/Codecov.proj b/build/Codecov.proj index 899affb5e6..a37b35db64 100644 --- a/build/Codecov.proj +++ b/build/Codecov.proj @@ -12,7 +12,7 @@ - <_CoverageReports Include="$(MSBuildThisFileDirectory)..\bin\AnyCPU.Debug\coverage\*.coverage" /> + <_CoverageReports Include="$(MSBuildThisFileDirectory)..\bin\AnyCPU.Debug\coverage\*.xml" /> <_CodecovArgs Include="-f;@(_CoverageReports)" /> <_CodecovArgs Include="-r;$(BUILD_REPOSITORY_NAME)" Condition="'$(BUILD_REPOSITORY_NAME)' != ''" /> @@ -25,10 +25,9 @@ <_CodecovArgs Include="-t;$(CODECOV_TOKEN)" Condition="'$(CODECOV_TOKEN)' != ''" /> - - + \ No newline at end of file diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index a58da33d80..1e144ea558 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -34,14 +34,14 @@ phases: displayName: Download Benchmark Data - ${{ if eq(parameters.name, 'MacOS') }}: - script: brew update && brew install libomp mono-libgdiplus gettext && brew link gettext --force - displayName: Install runtime dependencies + displayName: Install runtime dependencies + - script: $(_buildScript) -$(_configuration) -runtests + displayName: Run Tests - script: dotnet msbuild build/Codecov.proj /t:Codecov /p:UseCodecov=true env: CODECOV_TOKEN: $(CODECOV_TOKEN) displayName: Upload coverage to codecov.io - condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) - - script: $(_buildScript) -$(_configuration) -runtests - displayName: Run Tests + condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) - task: PublishTestResults@2 displayName: Publish Test Results condition: succeededOrFailed() From 717d20775e2c3dd9675b45f366ecfad45b2823f8 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 15:13:56 -0800 Subject: [PATCH 40/51] Enable uploading of code coverage reports to codecov. --- build/Codecov.proj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/Codecov.proj b/build/Codecov.proj index a37b35db64..09f652d1b4 100644 --- a/build/Codecov.proj +++ b/build/Codecov.proj @@ -2,10 +2,11 @@ - + + - <_CodecovPath>$(NuGetPackageRoot)codecov\$(CodecovVersion)\tools\Codecov.exe + <_CodecovPath>$(RestorePackagesPath)codecov\$(CodecovVersion)\tools\Codecov.exe <_BranchName Condition="'$(_BranchName)' == ''">$(SYSTEM_PULLREQUEST_TARGETBRANCH) <_BranchName Condition="'$(_BranchName)' == ''">$(BUILD_SOURCEBRANCHNAME) From ceb4a4514e343648ce8d4f08df677aee15665f99 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 15:26:38 -0800 Subject: [PATCH 41/51] Enable uploading of code coverage reports to codecov. --- build/Codecov.proj | 2 -- 1 file changed, 2 deletions(-) diff --git a/build/Codecov.proj b/build/Codecov.proj index 09f652d1b4..636be0233c 100644 --- a/build/Codecov.proj +++ b/build/Codecov.proj @@ -1,7 +1,5 @@ - - From 4c0cf5a7d53be5769aedd24c0b0d8b701bdc5252 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Fri, 18 Jan 2019 16:07:13 -0800 Subject: [PATCH 42/51] Enable uploading of code coverage reports to codecov. --- build/Codecov.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Codecov.proj b/build/Codecov.proj index 636be0233c..abd4bb39bb 100644 --- a/build/Codecov.proj +++ b/build/Codecov.proj @@ -1,6 +1,6 @@ - + From e4850946056d1022e9cab83903924f7f99f2603b Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Sat, 19 Jan 2019 15:19:05 -0800 Subject: [PATCH 43/51] Add option for code coverage. --- build/Codecov.proj | 2 +- build/ci/phase-template.yml | 8 ++++++-- config.json | 6 ++++++ test/Directory.Build.props | 2 +- test/run-tests.proj | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/build/Codecov.proj b/build/Codecov.proj index abd4bb39bb..075b4cc5fb 100644 --- a/build/Codecov.proj +++ b/build/Codecov.proj @@ -11,7 +11,7 @@ - <_CoverageReports Include="$(MSBuildThisFileDirectory)..\bin\AnyCPU.Debug\coverage\*.xml" /> + <_CoverageReports Include="$(BaseOutputPath)$(PlatformConfig)\coverage\*.xml" /> <_CodecovArgs Include="-f;@(_CoverageReports)" /> <_CodecovArgs Include="-r;$(BUILD_REPOSITORY_NAME)" Condition="'$(BUILD_REPOSITORY_NAME)' != ''" /> diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index 1e144ea558..50ffe0cdab 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -15,7 +15,7 @@ phases: timeoutInMinutes: 200 parallel: 99 matrix: - ${{ if eq(parameters.customMatrixes, '') }}: + ${{ if ne(parameters.customMatrixes, '') }}: Build_Debug: _configuration: Debug _config_short: D @@ -35,8 +35,12 @@ phases: - ${{ if eq(parameters.name, 'MacOS') }}: - script: brew update && brew install libomp mono-libgdiplus gettext && brew link gettext --force displayName: Install runtime dependencies + - script: $(_buildScript) -$(_configuration) -runtests -coverage=true + displayName: Run Tests with code coverage. + condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) - script: $(_buildScript) -$(_configuration) -runtests - displayName: Run Tests + displayName: Run Tests without code coverage. + condition: not(and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug'))) - script: dotnet msbuild build/Codecov.proj /t:Codecov /p:UseCodecov=true env: CODECOV_TOKEN: $(CODECOV_TOKEN) diff --git a/config.json b/config.json index c870004f32..eb89171bf7 100644 --- a/config.json +++ b/config.json @@ -78,6 +78,12 @@ "values": [], "defaultValue": "" }, + "Coverage": { + "description": "Turn on code coverge.", + "valueType": "property", + "values": ["false", "true"], + "defaultValue": "false" + }, "CleanAllProjects": { "description": "MsBuild target that deletes the binary output directory.", "valueType": "target", diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 2534e4f794..1ccab27472 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -34,7 +34,7 @@ - + true true opencover diff --git a/test/run-tests.proj b/test/run-tests.proj index 44305e84f2..821970d000 100644 --- a/test/run-tests.proj +++ b/test/run-tests.proj @@ -10,7 +10,7 @@ + Properties="VSTestNoBuild=true;"/> From 455bceb8b66cb1fd57003d67ae1079275e7f5015 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Sat, 19 Jan 2019 15:21:48 -0800 Subject: [PATCH 44/51] Add option for code coverage. --- build/NuGet.props | 9 --------- build/ci/phase-template.yml | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 build/NuGet.props diff --git a/build/NuGet.props b/build/NuGet.props deleted file mode 100644 index 45475b7e76..0000000000 --- a/build/NuGet.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - $(NUGET_PACKAGES) - $(UserProfile)\.nuget\packages\ - $([System.Environment]::GetFolderPath(SpecialFolder.Personal))\.nuget\packages\ - $(NuGetPackageRoot)\ - - \ No newline at end of file diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index 50ffe0cdab..fbb750fa8c 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -15,7 +15,7 @@ phases: timeoutInMinutes: 200 parallel: 99 matrix: - ${{ if ne(parameters.customMatrixes, '') }}: + ${{ if eq(parameters.customMatrixes, '') }}: Build_Debug: _configuration: Debug _config_short: D From 0f1f293b1b031a59d9f3df2bb46cc8eabd48d003 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Sat, 19 Jan 2019 16:03:19 -0800 Subject: [PATCH 45/51] cleanup. --- README.md | 2 +- build/Dependencies.props | 1 + build/ci/phase-template.yml | 8 ++++---- src/Microsoft.ML.Core/Data/VBuffer.cs | 2 -- src/Microsoft.ML.Core/Utilities/Contracts.cs | 2 -- test/Directory.Build.props | 2 +- test/Directory.Build.targets | 2 +- test/run-tests.proj | 2 +- 8 files changed, 9 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 35785adbf4..eb5fc6ac10 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ To build ML.NET from source please visit our [developers guide](docs/project-doc |**Windows x64**|[![x64-debug](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=Windows_x64&configuration=Build_Debug)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=Windows_x64&configuration=Build_Release)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)| |**Windows x86**|[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobName=Windows_x86&configuration=Build_Debug)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=104?branchName=master)|[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobName=Windows_x86&configuration=Build_Release)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=104?branchName=master)| |**Core 3.0**|[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobName=core30&configuration=Build_Debug_Intrinsics)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=104?branchName=master)|[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobName=core30&configuration=Build_Release_Intrinsics)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=104?branchName=master)| - +|**Code Coverage**|[![codecov](https://codecov.io/gh/dotnet/machinelearning/branch/master/graph/badge.svg)](https://codecov.io/gh/dotnet/machinelearning)|| ## Contributing We welcome contributions! Please review our [contribution guide](CONTRIBUTING.md). diff --git a/build/Dependencies.props b/build/Dependencies.props index f0e114d565..bf0155acd9 100644 --- a/build/Dependencies.props +++ b/build/Dependencies.props @@ -35,6 +35,7 @@ 1.0.0-beta-62824-02 1.1.0 + 2.5.1 diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index fbb750fa8c..c70b11f55d 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -12,7 +12,7 @@ phases: _phaseName: ${{ parameters.name }} _arch: ${{ parameters.architecture }} queue: - timeoutInMinutes: 200 + timeoutInMinutes: 45 parallel: 99 matrix: ${{ if eq(parameters.customMatrixes, '') }}: @@ -37,15 +37,15 @@ phases: displayName: Install runtime dependencies - script: $(_buildScript) -$(_configuration) -runtests -coverage=true displayName: Run Tests with code coverage. - condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) + condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) - script: $(_buildScript) -$(_configuration) -runtests displayName: Run Tests without code coverage. - condition: not(and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug'))) + condition: not(and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug'))) - script: dotnet msbuild build/Codecov.proj /t:Codecov /p:UseCodecov=true env: CODECOV_TOKEN: $(CODECOV_TOKEN) displayName: Upload coverage to codecov.io - condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) + condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) - task: PublishTestResults@2 displayName: Publish Test Results condition: succeededOrFailed() diff --git a/src/Microsoft.ML.Core/Data/VBuffer.cs b/src/Microsoft.ML.Core/Data/VBuffer.cs index f7ac903594..949857bc2b 100644 --- a/src/Microsoft.ML.Core/Data/VBuffer.cs +++ b/src/Microsoft.ML.Core/Data/VBuffer.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using Microsoft.ML.Internal.Utilities; namespace Microsoft.ML.Data @@ -79,7 +78,6 @@ public VBuffer(int length, T[] values, int[] indices = null) /// /// Construct a possibly sparse representation. /// - [ExcludeFromCodeCoverage] public VBuffer(int length, int count, T[] values, int[] indices) { Contracts.CheckParam(length >= 0, nameof(length)); diff --git a/src/Microsoft.ML.Core/Utilities/Contracts.cs b/src/Microsoft.ML.Core/Utilities/Contracts.cs index 77ba12e593..6fc94f6304 100644 --- a/src/Microsoft.ML.Core/Utilities/Contracts.cs +++ b/src/Microsoft.ML.Core/Utilities/Contracts.cs @@ -12,7 +12,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Threading; @@ -832,7 +831,6 @@ private static void DbgFailEmpty(IExceptionContext ctx, string msg) #endregion Private assert handling [Conditional("DEBUG")] - [ExcludeFromCodeCoverage] public static void Assert(bool f) { if (!f) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 1ccab27472..9d8860a075 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -31,7 +31,7 @@ - + diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 534df0c677..88f693b838 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/test/run-tests.proj b/test/run-tests.proj index 821970d000..a3ee03d2b8 100644 --- a/test/run-tests.proj +++ b/test/run-tests.proj @@ -10,7 +10,7 @@ + Properties="VSTestNoBuild=true;" /> From feee80482666d46e7c052a9ba2f0f5ad93d1b7da Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Sat, 19 Jan 2019 16:37:21 -0800 Subject: [PATCH 46/51] clean up. --- README.md | 4 +++- test/Directory.Build.props | 4 ++-- test/run-tests.proj | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eb5fc6ac10..74ab332c5f 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ Daily NuGet builds of the project are also available in our [MyGet](https://dotn To build ML.NET from source please visit our [developers guide](docs/project-docs/developer-guide.md). +[![codecov](https://codecov.io/gh/dotnet/machinelearning/branch/master/graph/badge.svg)](https://codecov.io/gh/dotnet/machinelearning) + | | Debug | Release | |:---|----------------:|------------------:| |**Linux**|[![x64-debug](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=Linux&configuration=Build_Debug)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=Linux&configuration=Build_Release)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)| @@ -49,7 +51,7 @@ To build ML.NET from source please visit our [developers guide](docs/project-doc |**Windows x64**|[![x64-debug](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=Windows_x64&configuration=Build_Debug)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobname=Windows_x64&configuration=Build_Release)](https://dnceng.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)| |**Windows x86**|[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobName=Windows_x86&configuration=Build_Debug)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=104?branchName=master)|[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobName=Windows_x86&configuration=Build_Release)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=104?branchName=master)| |**Core 3.0**|[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobName=core30&configuration=Build_Debug_Intrinsics)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=104?branchName=master)|[![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=master&jobName=core30&configuration=Build_Release_Intrinsics)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=104?branchName=master)| -|**Code Coverage**|[![codecov](https://codecov.io/gh/dotnet/machinelearning/branch/master/graph/badge.svg)](https://codecov.io/gh/dotnet/machinelearning)|| + ## Contributing We welcome contributions! Please review our [contribution guide](CONTRIBUTING.md). diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 9d8860a075..cb9c01485f 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -34,13 +34,13 @@ + true - true opencover $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml [Microsoft.ML.*]* [*]Microsoft.ML.*Contracts*,[*]Microsoft.ML.Internal.Utilities*,[*]Microsoft.ML.Data.VBuffer* - + diff --git a/test/run-tests.proj b/test/run-tests.proj index a3ee03d2b8..a5afe75dd3 100644 --- a/test/run-tests.proj +++ b/test/run-tests.proj @@ -10,7 +10,7 @@ + Properties="VSTestNoBuild=true" /> From 661793f2d880efac697152a2b942edac50f1b0a1 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Sat, 19 Jan 2019 16:39:31 -0800 Subject: [PATCH 47/51] clean up. --- test/Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index cb9c01485f..4bc31e1335 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -37,6 +37,7 @@ true + true opencover $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml [Microsoft.ML.*]* From f9fea940e190a2003156103ac9365a639d4632e9 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Sat, 19 Jan 2019 16:41:59 -0800 Subject: [PATCH 48/51] cleanup. --- build/ci/phase-template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index c70b11f55d..a7ff3f0b60 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -39,12 +39,12 @@ phases: displayName: Run Tests with code coverage. condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) - script: $(_buildScript) -$(_configuration) -runtests - displayName: Run Tests without code coverage. + displayName: Run Tests without code coverage. condition: not(and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug'))) - script: dotnet msbuild build/Codecov.proj /t:Codecov /p:UseCodecov=true env: CODECOV_TOKEN: $(CODECOV_TOKEN) - displayName: Upload coverage to codecov.io + displayName: Upload coverage to codecov.io condition: and(eq(variables._phaseName, 'Windows_x64'), eq(variables._configuration, 'Debug')) - task: PublishTestResults@2 displayName: Publish Test Results From 1e216c382e834aad52ed33032514fa57f36cf885 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Sat, 19 Jan 2019 16:43:25 -0800 Subject: [PATCH 49/51] cleanup. --- test/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 4bc31e1335..889fc51d50 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -37,7 +37,7 @@ true - true + true opencover $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml [Microsoft.ML.*]* From 8f985dbff28ca26d5983145127c25e5ffb5ef51c Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Sat, 19 Jan 2019 16:47:55 -0800 Subject: [PATCH 50/51] cleanup. --- test/Directory.Build.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 889fc51d50..57d0efd606 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -41,6 +41,8 @@ opencover $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml [Microsoft.ML.*]* + [*]Microsoft.ML.*Contracts*,[*]Microsoft.ML.Internal.Utilities*,[*]Microsoft.ML.Data.VBuffer* From 93f29550a5e8a4da55e982a892179bdc18084080 Mon Sep 17 00:00:00 2001 From: Zeeshan Siddiqui Date: Sat, 19 Jan 2019 16:49:52 -0800 Subject: [PATCH 51/51] clean up. --- test/Directory.Build.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 57d0efd606..101ef520e9 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -42,7 +42,8 @@ $(BaseOutputPath)$(PlatformConfig)\coverage\$(MSBuildProjectName).xml [Microsoft.ML.*]* + but they need to be migrated. Excluding these classes should have very minimal effect on code coverage. + --> [*]Microsoft.ML.*Contracts*,[*]Microsoft.ML.Internal.Utilities*,[*]Microsoft.ML.Data.VBuffer*