Skip to content

Commit c9ec20b

Browse files
Handle integration tests and nightly build testing (#5509)
* Make -integrationTests work * Update .yml file * Added the TargetArchitecture properties * Try out -integrationTest * Missed -integrationTest flag * Renamed FunctionalTestBaseClass to IntegrationTestBaseClass * Missed rename * Modified tests to make them more stable
1 parent 8e84aa3 commit c9ec20b

30 files changed

+79
-70
lines changed

Microsoft.ML.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.TestFramework"
3333
EndProject
3434
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Predictor.Tests", "test\Microsoft.ML.Predictor.Tests\Microsoft.ML.Predictor.Tests.csproj", "{6B047E09-39C9-4583-96F3-685D84CA4117}"
3535
EndProject
36-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Functional.Tests", "test\Microsoft.ML.Functional.Tests\Microsoft.ML.Functional.Tests.csproj", "{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}"
36+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.IntegrationTests", "test\Microsoft.ML.IntegrationTests\Microsoft.ML.IntegrationTests.csproj", "{CFED9F0C-FF81-4C96-8D5E-0436264CA7B5}"
3737
EndProject
3838
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.ResultProcessor", "src\Microsoft.ML.ResultProcessor\Microsoft.ML.ResultProcessor.csproj", "{3769FCC3-9AFF-4C37-97E9-6854324681DF}"
3939
EndProject

build/ci/job-template.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
dotnetPath: $(Build.SourcesDirectory)/.dotnet/dotnet
2626
nugetFeed: https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json
2727
nightlyBuildProjPath: $(Build.SourcesDirectory)/test/Microsoft.ML.NightlyBuild.Tests/Microsoft.ML.NightlyBuild.Tests.csproj
28-
nightlyBuildRunPath: $(Build.SourcesDirectory)/bin/AnyCPU.$(_configuration)/Microsoft.ML.NightlyBuild.Tests/$(_targetFramework)
28+
nightlyBuildRunPath: $(Build.SourcesDirectory)/artifacts/bin/Microsoft.ML.NightlyBuild.Tests/$(_configuration)/$(_targetFramework)
29+
runNightlyBuildProj: $(Build.SourcesDirectory)/test/run-night-build-tests.proj
2930
packageUpdaterProjPath: $(Build.SourcesDirectory)/test/Microsoft.ML.NugetPackageVersionUpdater/Microsoft.ML.NugetPackageVersionUpdater.csproj
3031
versionFilePath: $(Build.SourcesDirectory)/test/Microsoft.ML.NugetPackageVersionUpdater/latest_versions.txt
3132
PROCDUMP_PATH: '$(Build.SourcesDirectory)/Tools/ProcDump/'
@@ -100,25 +101,25 @@ jobs:
100101
displayName: Update package versions for nightly build
101102
- ${{ if eq(parameters.buildScript, 'build.cmd') }}:
102103
- powershell: |
103-
Get-ChildItem -Path '.\bin\AnyCPU.*' -Recurse |
104+
Get-ChildItem -Path '.\artifacts\bin\*' -Recurse |
104105
Select -ExpandProperty FullName |
105-
Where {$_ -notlike '*\Microsoft.ML.NightlyBuild.Tests*'} |
106+
Where {$_ -NotMatch '.*\\Microsoft\.ML\.NightlyBuild\.Tests.*|.*\\Native.*'} |
106107
sort length -Descending |
107108
Remove-Item -force
108109
Write-Output "Done cleaning up usless project..."
109110
displayName: Clean up useless project
110-
- script: $(dotnetPath) msbuild -restore $(nightlyBuildProjPath) /p:ReferenceTypeForTestFramework="Nuget" -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }}
111+
- script: $(dotnetPath) msbuild -restore $(nightlyBuildProjPath) /p:ReferenceTypeForTestFramework="Nuget" /p:Configuration=$(_configuration) /p:TargetArchitecture=${{ parameters.architecture }}
111112
displayName: Build Nightly-Build Project with latest package versions
112-
- script: ${{ parameters.buildScript }} /p:Build=false -$(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} -runnightlybuildtests /p:RestorePackagesPath=$(Build.SourcesDirectory)\packages /p:NUGET_PACKAGES=$(Build.SourcesDirectory)\packages
113+
- script: $(dotnetPath) msbuild $(runNightlyBuildProj) /t:RunNightlyBuildTests /p:Configuration=$(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }}
113114
displayName: Run Nightly Build Tests
114115
- ${{ if eq(parameters.nightlyBuild, 'false') }}:
115116
- ${{ if eq(parameters.innerLoop, 'false') }}:
116117
- ${{ if and(eq(parameters.runSpecific, 'false'), eq(parameters.useVSTestTask, 'false')) }}:
117118
# TODO: Code coverage needs to be fixed.
118-
- script: ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} -test -ci #-coverage=${{ parameters.codeCoverage }}
119+
- script: ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} -test -integrationTest -ci #-coverage=${{ parameters.codeCoverage }}
119120
displayName: Run All Tests.
120121
- ${{ if and(eq(parameters.runSpecific, 'true'), eq(parameters.useVSTestTask, 'false')) }}:
121-
- script: ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} -test -ci /p:TestRunnerAdditionalArguments='-trait$(spaceValue)Category=RunSpecificTest' /p:RestorePackagesPath=$(Build.SourcesDirectory)\packages /p:NUGET_PACKAGES=$(Build.SourcesDirectory)\packages #-coverage=${{ parameters.codeCoverage }}
122+
- script: ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} -test -integrationTest -ci /p:TestRunnerAdditionalArguments='-trait$(spaceValue)Category=RunSpecificTest' /p:RestorePackagesPath=$(Build.SourcesDirectory)\packages /p:NUGET_PACKAGES=$(Build.SourcesDirectory)\packages #-coverage=${{ parameters.codeCoverage }}
122123
displayName: Run Specific Tests.
123124
- ${{ if and(eq(parameters.buildScript, 'build.cmd'), eq(parameters.useVSTestTask, 'true')) }}:
124125
- task: VSTest@2
@@ -142,7 +143,7 @@ jobs:
142143
collectDumpOn: onAbortOnly
143144
publishRunAttachments: true
144145
- ${{ if eq(parameters.innerLoop, 'true') }}:
145-
- script: ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} -test -ci /p:TestRunnerAdditionalArguments='-notrait$(spaceValue)Category=SkipInCI' /p:RestorePackagesPath=$(Build.SourcesDirectory)\packages /p:NUGET_PACKAGES=$(Build.SourcesDirectory)\packages #-coverage=${{ parameters.codeCoverage }}
146+
- script: ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} -test -integrationTest -ci /p:TestRunnerAdditionalArguments='-notrait$(spaceValue)Category=SkipInCI' /p:RestorePackagesPath=$(Build.SourcesDirectory)\packages /p:NUGET_PACKAGES=$(Build.SourcesDirectory)\packages #-coverage=${{ parameters.codeCoverage }}
146147
displayName: Run CI Tests.
147148
- script: $(dotnetPath) msbuild -restore build/Codecoverage.proj
148149
displayName: Upload coverage to codecov.io

src/Redist/Microsoft.ML.DnnImageFeaturizer.ModelRedist/Microsoft.ML.DnnImageFeaturizer.ModelRedist.proj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@
116116
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)" -->
117117
</Target>
118118

119+
<!-- The targets below are needed for arcade -->
120+
119121
<Target Name="Build"
120122
DependsOnTargets="CopyDnnModelFiles" />
121123

@@ -125,4 +127,6 @@
125127

126128
<Target Name="PerformanceTest"/>
127129

130+
<Target Name="IntegrationTest"/>
131+
128132
</Project>

test/Microsoft.ML.Functional.Tests/Common.cs renamed to test/Microsoft.ML.IntegrationTests/Common.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
using System.Collections.Generic;
77
using System.Linq;
88
using Microsoft.ML.Data;
9-
using Microsoft.ML.Functional.Tests.Datasets;
9+
using Microsoft.ML.IntegrationTests.Datasets;
1010
using Xunit;
1111
using Xunit.Sdk;
1212

13-
namespace Microsoft.ML.Functional.Tests
13+
namespace Microsoft.ML.IntegrationTests
1414
{
1515
internal static class Common
1616
{

test/Microsoft.ML.Functional.Tests/DataIO.cs renamed to test/Microsoft.ML.IntegrationTests/DataIO.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System.IO;
6-
using Microsoft.ML.Functional.Tests.Datasets;
6+
using Microsoft.ML.IntegrationTests.Datasets;
77
using Microsoft.ML.TestFrameworkCommon;
88
using Xunit;
99
using Xunit.Abstractions;
1010

11-
namespace Microsoft.ML.Functional.Tests
11+
namespace Microsoft.ML.IntegrationTests
1212
{
1313
/// <summary>
1414
/// Test data input and output formats.
1515
/// </summary>
16-
public class DataIO : FunctionalTestBaseClass
16+
public class DataIO : IntegrationTestBaseClass
1717
{
1818
// Separators to test
1919
private readonly char[] _separators;

test/Microsoft.ML.Functional.Tests/DataTransformation.cs renamed to test/Microsoft.ML.IntegrationTests/DataTransformation.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
using Microsoft.ML.Functional.Tests.Datasets;
6+
using Microsoft.ML.IntegrationTests.Datasets;
77
using Microsoft.ML.TestFrameworkCommon;
88
using Microsoft.ML.Trainers;
99
using Microsoft.ML.Transforms.Text;
1010
using Xunit;
1111
using Xunit.Abstractions;
1212
using static Microsoft.ML.Transforms.HashingEstimator;
1313

14-
namespace Microsoft.ML.Functional.Tests
14+
namespace Microsoft.ML.IntegrationTests
1515
{
16-
public class DataTransformation : FunctionalTestBaseClass
16+
public class DataTransformation : IntegrationTestBaseClass
1717
{
1818
public DataTransformation(ITestOutputHelper output) : base(output)
1919
{

test/Microsoft.ML.Functional.Tests/Datasets/Adult.cs renamed to test/Microsoft.ML.IntegrationTests/Datasets/Adult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
using Microsoft.ML.Data;
66

7-
namespace Microsoft.ML.Functional.Tests.Datasets
7+
namespace Microsoft.ML.IntegrationTests.Datasets
88
{
99
/// <summary>
1010
/// A class for the Adult test dataset.

test/Microsoft.ML.Functional.Tests/Datasets/CommonColumns.cs renamed to test/Microsoft.ML.IntegrationTests/Datasets/CommonColumns.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
namespace Microsoft.ML.Functional.Tests.Datasets
5+
namespace Microsoft.ML.IntegrationTests.Datasets
66
{
77
/// <summary>
88
/// A class to hold a feature column.

test/Microsoft.ML.Functional.Tests/Datasets/HousingRegression.cs renamed to test/Microsoft.ML.IntegrationTests/Datasets/HousingRegression.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
using Microsoft.ML.Data;
66

7-
namespace Microsoft.ML.Functional.Tests.Datasets
7+
namespace Microsoft.ML.IntegrationTests.Datasets
88
{
99
/// <summary>
1010
/// A schematized class for loading the HousingRegression dataset.

test/Microsoft.ML.Functional.Tests/Datasets/Iris.cs renamed to test/Microsoft.ML.IntegrationTests/Datasets/Iris.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System;
77
using Microsoft.ML.Data;
88

9-
namespace Microsoft.ML.Functional.Tests.Datasets
9+
namespace Microsoft.ML.IntegrationTests.Datasets
1010
{
1111
/// <summary>
1212
/// A class for the Iris test dataset.

0 commit comments

Comments
 (0)