@@ -241,6 +241,11 @@ jobs:
241
241
call $(sourcesPath)\build.cmd -ci -cleanWhileBuilding -prepareMachine /p:TargetOS=${{ parameters.targetOS }} /p:TargetArchitecture=${{ parameters.targetArchitecture }} ${{ parameters.extraProperties }}
242
242
displayName: Build
243
243
244
+ - ${{ if eq(parameters.runTests, 'True') }} :
245
+ - script : |
246
+ call $(sourcesPath)\build.cmd -ci -prepareMachine -test ${{ parameters.extraProperties }}
247
+ displayName: Run Tests
248
+
244
249
- ${{ else }} :
245
250
- ${{ if eq(parameters.buildSourceOnly, 'true') }} :
246
251
- script : |
@@ -356,14 +361,13 @@ jobs:
356
361
set -ex
357
362
358
363
dockerVolumeArgs="-v $(sourcesPath):/vmr"
359
- dockerEnvArgs="-e SMOKE_TESTS_EXCLUDE_OMNISHARP=${{ parameters.excludeOmniSharpTests }} -e SMOKE_TESTS_WARN_SDK_CONTENT_DIFFS=true -e SMOKE_TESTS_RUNNING_IN_CI=true"
360
364
poisonArg=''
361
365
362
366
if [[ '${{ parameters.enablePoison }}' == 'True' ]]; then
363
367
poisonArg='--poison'
364
368
fi
365
369
366
- docker run --rm $dockerVolumeArgs -w /vmr $dockerEnvArgs $ {{ parameters.container }} ./build.sh --source-only $poisonArg --test $(additionalBuildArgs) /p:SmokeTestConsoleVerbosity=detailed
370
+ docker run --rm $dockerVolumeArgs -w /vmr ${{ parameters.container }} ./build.sh /bl:artifacts/log/Release/Test.binlog --source-only --test $poisonArg $ (additionalBuildArgs) /p:SmokeTestsWarnOnSdkContentDiffs=true /p:SmokeTestsExcludeOmniSharpTests=${{ parameters.excludeOmniSharpTests }}
367
371
displayName: Run Tests
368
372
369
373
- ${{ if eq(parameters.targetOS, 'windows') }} :
@@ -383,14 +387,14 @@ jobs:
383
387
384
388
cd "$(sourcesPath)"
385
389
386
- CopyWithRelativeFolders "artifacts/" $targetFolder "*.binlog"
387
- CopyWithRelativeFolders "artifacts/" $targetFolder "*.log"
388
- CopyWithRelativeFolders "artifacts/" $targetFolder "*.diff"
390
+ CopyWithRelativeFolders "artifacts/log/" $targetFolder "*.binlog"
391
+ CopyWithRelativeFolders "artifacts/log/" $targetFolder "*.log"
392
+ CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "*.binlog"
393
+ CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "*.diff"
394
+ CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "Updated*.txt"
395
+ CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "*.trx"
389
396
CopyWithRelativeFolders "src/" $targetFolder "*.binlog"
390
397
CopyWithRelativeFolders "src/" $targetFolder "*.log"
391
- CopyWithRelativeFolders "test/" $targetFolder "*.binlog"
392
- CopyWithRelativeFolders "test/" $targetFolder "Updated*.diff"
393
- CopyWithRelativeFolders "test/" $targetFolder "Updated*.txt"
394
398
395
399
# check if we have assets to publish
396
400
if (Test-Path "artifacts/assets/Release/*") {
@@ -410,18 +414,20 @@ jobs:
410
414
mkdir -p ${targetFolder}
411
415
412
416
cd "$(sourcesPath)"
413
- find artifacts/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
414
- find artifacts/ -type f -name "*.log" -exec rsync -R {} -t ${targetFolder} \;
415
- find artifacts/ -type f -name "*.diff" -exec rsync -R {} -t ${targetFolder} \;
417
+ find artifacts/log/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
418
+ find artifacts/log/ -type f -name "*.log" -exec rsync -R {} -t ${targetFolder} \;
419
+ find artifacts/TestResults/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
420
+ find artifacts/TestResults/ -type f -name "*.diff" -exec rsync -R {} -t ${targetFolder} \;
421
+ find artifacts/TestResults/ -type f -name "Updated*.txt" -exec rsync -R {} -t ${targetFolder} \;
422
+ find artifacts/TestResults/ -type f -name "*.trx" -exec rsync -R {} -t ${targetFolder} \;
423
+
416
424
if [[ "${{ parameters.buildSourceOnly }}" == "True" ]]; then
417
425
find artifacts/prebuilt-report/ -exec rsync -R {} -t ${targetFolder} \;
418
426
find artifacts/log/binary-report/ -exec rsync -R {} -t ${targetFolder} \;
419
427
fi
428
+
420
429
find src/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
421
430
find src/ -type f -name "*.log" -exec rsync -R {} -t ${targetFolder} \;
422
- find test/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
423
- find test/ -type f -name "Updated*.diff" -exec rsync -R {} -t ${targetFolder} \;
424
- find test/ -type f -name "Updated*.txt" -exec rsync -R {} -t ${targetFolder} \;
425
431
426
432
# check if we have assets to publish
427
433
if [ -n "$(ls -A 'artifacts/assets/Release/')" ]; then
@@ -446,11 +452,11 @@ jobs:
446
452
continueOnError : true
447
453
inputs :
448
454
testRunner : vSTest
449
- testResultsFiles : ' test/** /*.trx'
455
+ testResultsFiles : ' artifacts/TestResults/Release /*.trx'
450
456
searchFolder : $(sourcesPath)
451
457
mergeTestResults : true
452
458
publishRunAttachments : true
453
- testRunTitle : SourceBuild_SmokeTests_ $(Agent.JobName)
459
+ testRunTitle : Tests_ $(Agent.JobName)
454
460
455
461
- task : CopyFiles@2
456
462
inputs :
@@ -460,6 +466,7 @@ jobs:
460
466
assets/**
461
467
TargetFolder : $(Build.ArtifactStagingDirectory)/publishing
462
468
displayName : Copy artifacts to Artifact Staging Directory
469
+ condition : succeededOrFailed()
463
470
464
471
# When building from source, the Private.SourceBuilt.Artifacts archive already contains the nuget packages
465
472
- ${{ if ne(parameters.buildSourceOnly, 'true') }} :
@@ -468,6 +475,7 @@ jobs:
468
475
SourceFolder : $(sourcesPath)/artifacts/packages
469
476
TargetFolder : $(Build.ArtifactStagingDirectory)/publishing/packages
470
477
displayName : Copy packages to Artifact Staging Directory
478
+ condition : succeededOrFailed()
471
479
472
480
- ${{ if or(ne(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'PullRequest')) }} :
473
481
- publish : $(Build.ArtifactStagingDirectory)/publishing
0 commit comments