| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,7 @@ | |||
| 1 | 1 | # Build `conda.recipe` only if this is a Pull_Request. Saves time for CI. | |
| 2 | 2 | ||
| 3 | + $stopwatch = [Diagnostics.Stopwatch]::StartNew() | ||
| 4 | + | ||
| 3 | 5 | $env:CONDA_PY = "$env:PY_VER" | |
| 4 | 6 | # Use pre-installed miniconda. Note that location differs if 64bit | |
| 5 | 7 | $env:CONDA_BLD = "C:\miniconda36" | |
@@ -30,7 +32,9 @@ if ($env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_REPO_TAG_NAME -or $env:F | |||
| 30 | 32 | ||
| 31 | 33 | $CONDA_PKG=(conda build conda.recipe --output) | |
| 32 | 34 | 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" | ||
| 34 | 38 | ||
| 35 | 39 | # Restore PATH back to original | |
| 36 | 40 | $env:path = $old_path | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,8 @@ | |||
| 1 | 1 | # Script to simplify AppVeyor configuration and resolve path to tools | |
| 2 | 2 | ||
| 3 | + $stopwatch = [Diagnostics.Stopwatch]::StartNew() | ||
| 4 | + [array]$timings = @() | ||
| 5 | + | ||
| 3 | 6 | # Test Runner framework being used for embedded tests | |
| 4 | 7 | $CS_RUNNER = "nunit3-console" | |
| 5 | 8 | ||
@@ -25,6 +28,17 @@ $PY = Get-Command python | |||
| 25 | 28 | $CS_TESTS = ".\src\embed_tests\bin\Python.EmbeddingTest.dll" | |
| 26 | 29 | $RUNTIME_DIR = ".\src\runtime\bin\" | |
| 27 | 30 | ||
| 31 | + function ReportTime { | ||
| 32 | + param([string] $action) | ||
| 33 | + | ||
| 34 | + $timeSpent = $stopwatch.Elapsed | ||
| 35 | + $timings += [pscustomobject]@{action=$action; timeSpent=$timeSpent} | ||
| 36 | + Write-Host $action " in " $timeSpent -ForegroundColor "Green" | ||
| 37 | + $stopwatch.Restart() | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + ReportTime "Preparation done" | ||
| 41 | + | ||
| 28 | 42 | # Run python tests with C# coverage | |
| 29 | 43 | Write-Host ("Starting Python tests") -ForegroundColor "Green" | |
| 30 | 44 | .$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:py.coverage ` | |
@@ -33,6 +47,9 @@ Write-Host ("Starting Python tests") -ForegroundColor "Green" | |||
| 33 | 47 | $PYTHON_STATUS = $LastExitCode | |
| 34 | 48 | if ($PYTHON_STATUS -ne 0) { | |
| 35 | 49 | Write-Host "Python tests failed, continuing to embedded tests" -ForegroundColor "Red" | |
| 50 | + ReportTime "" | ||
| 51 | + } else { | ||
| 52 | + ReportTime "Python tests completed" | ||
| 36 | 53 | } | |
| 37 | 54 | ||
| 38 | 55 | # Run Embedded tests with C# coverage | |
@@ -44,7 +61,10 @@ Write-Host ("Starting embedded tests") -ForegroundColor "Green" | |||
| 44 | 61 | $CS_STATUS = $LastExitCode | |
| 45 | 62 | if ($CS_STATUS -ne 0) { | |
| 46 | 63 | Write-Host "Embedded tests failed" -ForegroundColor "Red" | |
| 64 | + ReportTime "" | ||
| 47 | 65 | } else { | |
| 66 | + ReportTime "Embedded tests completed" | ||
| 67 | + | ||
| 48 | 68 | # NuGet for pythonnet-2.3 only has 64-bit binary for Python 3.5 | |
| 49 | 69 | # the test is only built using modern stack | |
| 50 | 70 | if (($env:PLATFORM -eq "x64") -and ($XPLAT) -and ($env:PYTHON_VERSION -eq "3.5")) { | |
@@ -60,6 +80,9 @@ if ($CS_STATUS -ne 0) { | |||
| 60 | 80 | $CS_PERF_STATUS = $LastExitCode | |
| 61 | 81 | if ($CS_PERF_STATUS -ne 0) { | |
| 62 | 82 | Write-Host "Performance tests (C#) failed" -ForegroundColor "Red" | |
| 83 | + ReportTime "" | ||
| 84 | + } else { | ||
| 85 | + ReportTime "Performance tests (C#) completed" | ||
| 63 | 86 | } | |
| 64 | 87 | } else { | |
| 65 | 88 | Write-Host ("Skipping performance tests for ", $env:PYTHON_VERSION) -ForegroundColor "Yellow" | |
@@ -82,9 +105,14 @@ if ($XPLAT){ | |||
| 82 | 105 | $CS_STATUS = $LastExitCode | |
| 83 | 106 | if ($CS_STATUS -ne 0) { | |
| 84 | 107 | Write-Host "Embedded tests for netcoreapp2.0 failed" -ForegroundColor "Red" | |
| 108 | + ReportTime "" | ||
| 109 | + } else { | ||
| 110 | + ReportTime ".NET Core 2.0 tests completed" | ||
| 85 | 111 | } | |
| 86 | 112 | } | |
| 87 | 113 | ||
| 114 | + Write-Host "Timings:" ($timings | Format-Table | Out-String) -ForegroundColor "Green" | ||
| 115 | + | ||
| 88 | 116 | # Set exit code to fail if either Python or Embedded tests failed | |
| 89 | 117 | if ($PYTHON_STATUS -ne 0 -or $CS_STATUS -ne 0 -or $CS_PERF_STATUS -ne 0) { | |
| 90 | 118 | Write-Host "Tests failed" -ForegroundColor "Red" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ public void ReadInt64Property() | |||
| 19 | 19 | locals.SetItem("a", new NetObject().ToPython()); | |
| 20 | 20 | PythonEngine.Exec($@" | |
| 21 | 21 | s = 0 | |
| 22 | - for i in range(300000): | ||
| 22 | + for i in range(50000): | ||
| 23 | 23 | s += a.{nameof(NetObject.LongProperty)} | |
| 24 | 24 | ", locals: locals.Handle); | |
| 25 | 25 | } | |
@@ -32,7 +32,7 @@ public void WriteInt64Property() { | |||
| 32 | 32 | locals.SetItem("a", new NetObject().ToPython()); | |
| 33 | 33 | PythonEngine.Exec($@" | |
| 34 | 34 | s = 0 | |
| 35 | - for i in range(300000): | ||
| 35 | + for i in range(50000): | ||
| 36 | 36 | a.{nameof(NetObject.LongProperty)} += i | |
| 37 | 37 | ", locals: locals.Handle); | |
| 38 | 38 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments