|
178 | 178 | </Target>
|
179 | 179 |
|
180 | 180 | <!-- Tests -->
|
| 181 | + |
| 182 | + <!-- Run all unit tests applicable to the host OS. --> |
181 | 183 | <Target Name="RunTests" DependsOnTargets="RunFunctionalTests;RunManualTests"/>
|
182 |
| - <Target Name="RunFunctionalTests"> |
183 |
| - <!-- Windows --> |
184 |
| - <Exec ConsoleToMsBuild="true" Command="$(DotnetPath)dotnet test "@(FunctionalTestsProj)" -p:Configuration=$(Configuration) -p:Target$(TFGroup)Version=$(TF) -p:ReferenceType=$(ReferenceType) --no-build -v n --collect "Code coverage" -p:TestSet=$(TestSet) --results-directory $(ResultsDirectory) -p:TestTargetOS=Windows$(TargetGroup) --filter "category!=non$(TargetGroup)tests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Functional-Windows$(TargetGroup)-$(TestSet)"" Condition="'$(IsEnabledWindows)' == 'true'"/> |
185 |
| - <!-- Unix --> |
186 |
| - <Exec ConsoleToMsBuild="true" Command="$(DotnetPath)dotnet test "@(FunctionalTestsProj)" -p:Configuration=$(Configuration) -p:TargetNetCoreVersion=$(TF) -p:ReferenceType=$(ReferenceType) --no-build -v n -p:TestSet=$(TestSet) --results-directory $(ResultsDirectory) -p:TestTargetOS=Unixnetcoreapp --collect "Code coverage" --filter "category!=nonnetcoreapptests&category!=failing&category!=nonlinuxtests&category!=nonuaptests" "--logger:trx;LogFilePrefix=Functional-Unixnetcoreapp-$(TestSet)"" Condition="'$(IsEnabledWindows)' != 'true'"/> |
| 184 | + |
| 185 | + <!-- Run all Functional tests applicable to the host OS. --> |
| 186 | + <Target Name="RunFunctionalTests" DependsOnTargets="RunFunctionalTestsWindows;RunFunctionalTestsUnix"/> |
| 187 | + |
| 188 | + <!-- Run all Functional tests applicable to Windows. --> |
| 189 | + <Target Name="RunFunctionalTestsWindows" Condition="'$(IsEnabledWindows)' == 'true'"> |
| 190 | + <PropertyGroup> |
| 191 | + <TestCommand> |
| 192 | + $(DotnetPath)dotnet test "@(FunctionalTestsProj)" |
| 193 | + --no-build |
| 194 | + -v n |
| 195 | + -p:Configuration=$(Configuration) |
| 196 | + -p:Target$(TFGroup)Version=$(TF) |
| 197 | + -p:ReferenceType=$(ReferenceType) |
| 198 | + -p:TestSet=$(TestSet) |
| 199 | + -p:TestTargetOS=Windows$(TargetGroup) |
| 200 | + --collect "Code coverage" |
| 201 | + --results-directory $(ResultsDirectory) |
| 202 | + --filter "category!=non$(TargetGroup)tests&category!=failing&category!=nonwindowstests" |
| 203 | + --logger:"trx;LogFilePrefix=Functional-Windows$(TargetGroup)-$(TestSet)" |
| 204 | + </TestCommand> |
| 205 | + <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand> |
| 206 | + </PropertyGroup> |
| 207 | + <Message Text=">>> Running Functional test for Windows via command: $(TestCommand)"/> |
| 208 | + <Exec ConsoleToMsBuild="true" Command="$(TestCommand)"/> |
| 209 | + </Target> |
| 210 | + |
| 211 | + <!-- Run all Functional tests applicable to Unix. --> |
| 212 | + <Target Name="RunFunctionalTestsUnix" Condition="'$(IsEnabledWindows)' != 'true'"> |
| 213 | + <PropertyGroup> |
| 214 | + <TestCommand> |
| 215 | + $(DotnetPath)dotnet test "@(FunctionalTestsProj)" |
| 216 | + --no-build |
| 217 | + -v n |
| 218 | + -p:Configuration=$(Configuration) |
| 219 | + -p:TargetNetCoreVersion=$(TF) |
| 220 | + -p:ReferenceType=$(ReferenceType) |
| 221 | + -p:TestSet=$(TestSet) |
| 222 | + -p:TestTargetOS=Unixnetcoreapp |
| 223 | + --collect "Code coverage" |
| 224 | + --results-directory $(ResultsDirectory) |
| 225 | + --filter "category!=nonnetcoreapptests&category!=failing&category!=nonlinuxtests&category!=nonuaptests" |
| 226 | + --logger:"trx;LogFilePrefix=Functional-Unixnetcoreapp-$(TestSet)" |
| 227 | + </TestCommand> |
| 228 | + <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand> |
| 229 | + </PropertyGroup> |
| 230 | + <Message Text=">>> Running Functional test for Unix via command: $(TestCommand)"/> |
| 231 | + <Exec ConsoleToMsBuild="true" Command="$(TestCommand)"/> |
| 232 | + </Target> |
| 233 | + |
| 234 | + <!-- Run all Manual tests applicable to the host OS. --> |
| 235 | + <Target Name="RunManualTests" DependsOnTargets="RunManualTestsWindows;RunManualTestsUnix"/> |
| 236 | + |
| 237 | + <!-- Run all Manual tests applicable to Windows. --> |
| 238 | + <Target Name="RunManualTestsWindows" Condition="'$(IsEnabledWindows)' == 'true'"> |
| 239 | + <PropertyGroup> |
| 240 | + <TestCommand> |
| 241 | + $(DotnetPath)dotnet test "@(ManualTestsProj)" |
| 242 | + --no-build |
| 243 | + -v n |
| 244 | + -p:Configuration=$(Configuration) |
| 245 | + -p:Target$(TFGroup)Version=$(TF) |
| 246 | + -p:ReferenceType=$(ReferenceType) |
| 247 | + -p:TestSet=$(TestSet) |
| 248 | + -p:TestTargetOS=Windows$(TargetGroup) |
| 249 | + --collect "Code coverage" |
| 250 | + --results-directory $(ResultsDirectory) |
| 251 | + --filter "category!=non$(TargetGroup)tests&category!=failing&category!=nonwindowstests" |
| 252 | + --logger:"trx;LogFilePrefix=Manual-Windows$(TargetGroup)-$(TestSet)" |
| 253 | + </TestCommand> |
| 254 | + <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand> |
| 255 | + </PropertyGroup> |
| 256 | + <Message Text=">>> Running Manual test for Windows via command: $(TestCommand)"/> |
| 257 | + <Exec ConsoleToMsBuild="true" Command="$(TestCommand)"/> |
187 | 258 | </Target>
|
188 | 259 |
|
189 |
| - <Target Name="RunManualTests"> |
190 |
| - <!-- Windows --> |
191 |
| - <Exec ConsoleToMsBuild="true" Command="$(DotnetPath)dotnet test "@(ManualTestsProj)" -p:Configuration=$(Configuration) -p:Target$(TFGroup)Version=$(TF) -p:ReferenceType=$(ReferenceType) --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=$(TestSet) --results-directory $(ResultsDirectory) -p:TestTargetOS=Windows$(TargetGroup) --filter "category!=non$(TargetGroup)tests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windows$(TargetGroup)-$(TestSet)"" Condition="'$(IsEnabledWindows)' == 'true'"/> |
192 |
| - <!-- Unix --> |
193 |
| - <Exec ConsoleToMsBuild="true" Command="$(DotnetPath)dotnet test "@(ManualTestsProj)" -p:Configuration=$(Configuration) -p:TargetNetCoreVersion=$(TF) -p:ReferenceType=$(ReferenceType) --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=$(TestSet) --results-directory $(ResultsDirectory) -p:TestTargetOS=Unixnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonlinuxtests&category!=nonuaptests" "--logger:trx;LogFilePrefix=Manual-Unixnetcoreapp-$(TestSet)"" Condition="'$(IsEnabledWindows)' != 'true'"/> |
| 260 | + <!-- Run all Manual tests applicable to Unix. --> |
| 261 | + <Target Name="RunManualTestsUnix" Condition="'$(IsEnabledWindows)' != 'true'"> |
| 262 | + <PropertyGroup> |
| 263 | + <TestCommand> |
| 264 | + $(DotnetPath)dotnet test "@(ManualTestsProj)" |
| 265 | + --no-build |
| 266 | + -v n |
| 267 | + -p:Configuration=$(Configuration) |
| 268 | + -p:TargetNetCoreVersion=$(TF) |
| 269 | + -p:ReferenceType=$(ReferenceType) |
| 270 | + -p:TestSet=$(TestSet) |
| 271 | + -p:TestTargetOS=Unixnetcoreapp |
| 272 | + --collect "Code coverage" |
| 273 | + --results-directory $(ResultsDirectory) |
| 274 | + --filter "category!=nonnetcoreapptests&category!=failing&category!=nonlinuxtests&category!=nonuaptests" |
| 275 | + --logger:"trx;LogFilePrefix=Manual-Unixnetcoreapp-$(TestSet)" |
| 276 | + </TestCommand> |
| 277 | + <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand> |
| 278 | + </PropertyGroup> |
| 279 | + <Message Text=">>> Running Manual test for Unix via command: $(TestCommand)"/> |
| 280 | + <Exec ConsoleToMsBuild="true" Command="$(TestCommand)"/> |
194 | 281 | </Target>
|
195 | 282 |
|
| 283 | + <!-- Clean --> |
196 | 284 | <Target Name="Clean">
|
197 | 285 | <RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".","artifacts", SearchOption.AllDirectories))' />
|
198 | 286 | <RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".","bin", SearchOption.AllDirectories))' />
|
|
201 | 289 | <RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".",".nuget", SearchOption.AllDirectories))' />
|
202 | 290 | </Target>
|
203 | 291 |
|
| 292 | + <!-- AKV Targets ========================================================= --> |
| 293 | + <Target Name="BuildAkv"> |
| 294 | + <!-- @TODO: TestTargetOS for restore poisons the project.assets.json file... We should remove it. --> |
| 295 | + <!-- @TODO: TestTargetOS makes this far more complicated than it needs to be. We should remove it. --> |
| 296 | + <!-- @TODO: RemoveProperties shouldn't be necessary --> |
| 297 | + <Message Text=">>> Restoring AKV project" /> |
| 298 | + <MSBuild Projects="@(AKVProvider)" Targets="Restore"/> |
| 299 | + |
| 300 | + <PropertyGroup> |
| 301 | + <BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netfx;Platform=AnyCPU;$(ProjectProperties);$(NugetPackProperties)</BuildAkvProperties> |
| 302 | + </PropertyGroup> |
| 303 | + <Message Text=">>> Building AKV project for netfx [$(BuildAkvProperties)]" /> |
| 304 | + <MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties);" /> |
| 305 | + |
| 306 | + <PropertyGroup> |
| 307 | + <BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;</BuildAkvProperties> |
| 308 | + </PropertyGroup> |
| 309 | + <Message Text=">>> Building AKV project for netcore/unix [$(BuildAkvProperties)]" /> |
| 310 | + <MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties)" RemoveProperties="TargetsWindows;TargetsUnix;" /> |
| 311 | + |
| 312 | + <PropertyGroup> |
| 313 | + <BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT</BuildAkvProperties> |
| 314 | + </PropertyGroup> |
| 315 | + <Message Text=">>> Building AKV project for netcore/windows [$(BuildAkvProperties)]" /> |
| 316 | + <MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties);" RemoveProperties="TargetsWindows;TargetsUnix;" /> |
| 317 | + |
| 318 | + <PropertyGroup> |
| 319 | + <BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;</BuildAkvProperties> |
| 320 | + </PropertyGroup> |
| 321 | + <Message Text=">>> Building AKV project for netcore/anyos [$(BuildAkvProperties)]" /> |
| 322 | + <MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties)" RemoveProperties="TargetsWindows;TargetsUnix;" /> |
| 323 | + </Target> |
| 324 | + |
204 | 325 | <Target Name="BuildAKVNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
|
205 | 326 | <MSBuild Projects="@(AKVProvider)" Targets="restore" Properties="TestTargetOS=$(TestOS)netfx" />
|
206 | 327 | <Message Text=">>> Building AKVNetFx [$(CI);TestTargetOS=$(TestOS)netfx;Platform=AnyCPU;$(TestProjectProperties)] ..." Condition="!$(ReferenceType.Contains('Package'))"/>
|
|
0 commit comments