Skip to content

Commit 9f4aa1e

Browse files
author
Maddie Clayton
authored
Merge pull request Azure#8687 from cormacpayne/travis-fix
Attempt to split tests run on Travis into "core" and "non-core"
2 parents c55eca1 + 0b6cd4e commit 9f4aa1e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ dotnet: 2.1.400
55
dist: trusty
66

77
env:
8-
- NAME="azure-powershell-core" CONFIG="Debug"
8+
- NAME="azure-powershell-core" CONFIG="Debug" TESTS_TO_RUN="Core"
9+
- NAME="azure-powershell-core" CONFIG="Debug" TESTS_TO_RUN="NonCore"
910

1011
services:
1112
- docker
@@ -24,7 +25,7 @@ before_install:
2425

2526
# https://github.com/travis-ci/travis-ci/issues/1066#issuecomment-383489298
2627
script:
27-
- sudo dotnet msbuild build.proj /t:Full /p:ExcludeAuthenticators=true /p:Configuration=$CONFIG || travis_terminate 1
28+
- sudo dotnet msbuild build.proj /t:Full /p:ExcludeAuthenticators=true /p:Configuration=$CONFIG /p:TestsToRun=$TESTS_TO_RUN || travis_terminate 1
2829

2930
after_success:
3031
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then

build.proj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
6161
<NuGetPublishingSource Condition=" '$(NuGetPublishingSource)' == '' ">$(LibrarySourceFolder)</NuGetPublishingSource>
6262
<Scope Condition="$(Scope) == ''" >All</Scope>
63+
<TestsToRun Condition="$(TestsToRun) == ''" >All</TestsToRun>
6364
<BuildTasksPath>$(LibraryToolsFolder)/BuildPackagesTask/Microsoft.Azure.Build.Tasks/bin/$(Configuration)</BuildTasksPath>
6465
<StackPackageFolder>$(LibrarySourceFolder)/Stack</StackPackageFolder>
6566
<NetCore Condition="'$(NetCore)' != 'true'">false</NetCore>
@@ -379,6 +380,9 @@
379380
<PropertyGroup Condition="'$(ExcludeAuthenticators)' == 'true'">
380381
<AuthenticatorExclusions>$(LibraryRoot)src/**/Authenticators.csproj;</AuthenticatorExclusions>
381382
</PropertyGroup>
383+
<PropertyGroup Condition="'$(TestsToRun)' != 'All'" >
384+
<CoreTests>$(LibraryRoot)src/Compute/Compute.Test/Compute.Test.csproj;$(LibraryRoot)src/Network/Network.Test/Network.Test.csproj;$(LibraryRoot)src/Resources/Resources.Test/Resources.Test.csproj;$(LibraryRoot)src/Sql/Sql.Test/Sql.Test.csproj;$(LibraryRoot)src/Websites/Websites.Test/Websites.Test.csproj;</CoreTests>
385+
</PropertyGroup>
382386
<PropertyGroup Condition="'$(Framework)' == ''">
383387
<Framework>netcoreapp2.0</Framework>
384388
</PropertyGroup>
@@ -390,7 +394,9 @@
390394
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
391395
<Exec Command="dotnet new sln -n Azure.PowerShell --force" />
392396
<ItemGroup>
393-
<ModuleCsprojFiles Include="$(LibraryRoot)src/**/*.csproj" Exclude="$(AuthenticatorExclusions)"/>
397+
<ModuleCsprojFiles Include="$(LibraryRoot)src/**/*.csproj" Exclude="$(AuthenticatorExclusions)" Condition="'$(TestsToRun)' == 'All'" />
398+
<ModuleCsprojFiles Include="$(LibraryRoot)src/**/*.csproj" Exclude="$(AuthenticatorExclusions)$(CoreTests)" Condition="'$(TestsToRun)' == 'NonCore'" />
399+
<ModuleCsprojFiles Include="$(CoreTests)" Condition="'$(TestsToRun)' == 'Core'" />
394400
</ItemGroup>
395401
<!-- https://stackoverflow.com/a/35477012/294804 -->
396402
<ItemGroup>

0 commit comments

Comments
 (0)