Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76cc8e6

Browse files
committed
report AppVeyor build timings
1 parent f5548e3 commit 76cc8e6

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

ci/appveyor_build_recipe.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Build `conda.recipe` only if this is a Pull_Request. Saves time for CI.
22

3+
$stopwatch = [Diagnostics.Stopwatch]::StartNew()
4+
35
$env:CONDA_PY = "$env:PY_VER"
46
# Use pre-installed miniconda. Note that location differs if 64bit
57
$env:CONDA_BLD = "C:\miniconda36"
@@ -30,7 +32,9 @@ if ($env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_REPO_TAG_NAME -or $env:F
3032

3133
$CONDA_PKG=(conda build conda.recipe --output)
3234
Copy-Item $CONDA_PKG .\dist\
33-
Write-Host "Completed conda build recipe" -ForegroundColor "Green"
35+
36+
$timeSpent = $stopwatch.Elapsed
37+
Write-Host "Completed conda build recipe in " $timeSpent -ForegroundColor "Green"
3438

3539
# Restore PATH back to original
3640
$env:path = $old_path

ci/appveyor_run_tests.ps1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Script to simplify AppVeyor configuration and resolve path to tools
22

3+
$stopwatch = [Diagnostics.Stopwatch]::StartNew()
4+
35
# Test Runner framework being used for embedded tests
46
$CS_RUNNER = "nunit3-console"
57

@@ -25,6 +27,16 @@ $PY = Get-Command python
2527
$CS_TESTS = ".\src\embed_tests\bin\Python.EmbeddingTest.dll"
2628
$RUNTIME_DIR = ".\src\runtime\bin\"
2729

30+
function ReportTime {
31+
param([string] $action)
32+
33+
$timeSpent = $stopwatch.Elapsed
34+
Write-Host $action " in " $timeSpent -ForegroundColor "Green"
35+
$stopwatch.Restart()
36+
}
37+
38+
ReportTime "Preparation done"
39+
2840
# Run python tests with C# coverage
2941
Write-Host ("Starting Python tests") -ForegroundColor "Green"
3042
.$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:py.coverage `
@@ -33,6 +45,9 @@ Write-Host ("Starting Python tests") -ForegroundColor "Green"
3345
$PYTHON_STATUS = $LastExitCode
3446
if ($PYTHON_STATUS -ne 0) {
3547
Write-Host "Python tests failed, continuing to embedded tests" -ForegroundColor "Red"
48+
ReportTime ""
49+
} else {
50+
ReportTime "Python tests completed"
3651
}
3752

3853
# Run Embedded tests with C# coverage
@@ -44,7 +59,10 @@ Write-Host ("Starting embedded tests") -ForegroundColor "Green"
4459
$CS_STATUS = $LastExitCode
4560
if ($CS_STATUS -ne 0) {
4661
Write-Host "Embedded tests failed" -ForegroundColor "Red"
62+
ReportTime ""
4763
} else {
64+
ReportTime "Embedded tests completed"
65+
4866
# NuGet for pythonnet-2.3 only has 64-bit binary for Python 3.5
4967
# the test is only built using modern stack
5068
if (($env:PLATFORM -eq "x64") -and ($XPLAT) -and ($env:PYTHON_VERSION -eq "3.5")) {
@@ -60,6 +78,9 @@ if ($CS_STATUS -ne 0) {
6078
$CS_PERF_STATUS = $LastExitCode
6179
if ($CS_PERF_STATUS -ne 0) {
6280
Write-Host "Performance tests (C#) failed" -ForegroundColor "Red"
81+
ReportTime ""
82+
} else {
83+
ReportTime "Performance tests (C#) completed"
6384
}
6485
} else {
6586
Write-Host ("Skipping performance tests for ", $env:PYTHON_VERSION) -ForegroundColor "Yellow"
@@ -82,6 +103,9 @@ if ($XPLAT){
82103
$CS_STATUS = $LastExitCode
83104
if ($CS_STATUS -ne 0) {
84105
Write-Host "Embedded tests for netcoreapp2.0 failed" -ForegroundColor "Red"
106+
ReportTime ""
107+
} else {
108+
ReportTime ".NET Core 2.0 tests completed"
85109
}
86110
}
87111

0 commit comments

Comments
 (0)