| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,14 +25,20 @@ addons: | |||
| 25 | 25 | - nunit-console | |
| 26 | 26 | ||
| 27 | 27 | install: | |
| 28 | - - pip install six | ||
| 29 | - - pip install pycparser | ||
| 30 | - - python setup.py build_ext --inplace | ||
| 28 | + - pip install pycparser coverage codecov six | ||
| 29 | + - coverage run setup.py build_ext --inplace | ||
| 31 | 30 | ||
| 32 | 31 | script: | |
| 33 | 32 | - export PYTHONPATH=`pwd`:$PYTHONPATH | |
| 34 | 33 | - python src/tests/runtests.py | |
| 35 | 34 | # - nunit-console src/embed_tests/bin/x64/ReleaseMono/Python.EmbeddingTest.dll | |
| 36 | 35 | ||
| 36 | + after_success: | ||
| 37 | + # Uncomment if need to geninterop, ie. py37 final | ||
| 38 | + # - python tools/geninterop/geninterop.py | ||
| 39 | + | ||
| 40 | + # Waiting on mono-cov support or SharpCover | ||
| 41 | + - codecov | ||
| 42 | + | ||
| 37 | 43 | notifications: | |
| 38 | 44 | email: false | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | [![appveyor shield][]](https://ci.appveyor.com/project/pythonnet/pythonnet/branch/master) | |
| 4 | 4 | [![travis shield][]](https://travis-ci.org/pythonnet/pythonnet) | |
| 5 | + [![codecov shield][]](https://codecov.io/github/pythonnet/pythonnet) | ||
| 5 | 6 | [![license shield][]](./LICENSE) | |
| 6 | 7 | [![pypi package version][]](https://pypi.python.org/pypi/pythonnet) | |
| 7 | 8 | [![python supported shield][]](https://pypi.python.org/pypi/pythonnet) | |
@@ -80,6 +81,8 @@ int32 | |||
| 80 | 81 | ||
| 81 | 82 | [appveyor shield]: https://img.shields.io/appveyor/ci/pythonnet/pythonnet/master.svg?label=AppVeyor | |
| 82 | 83 | ||
| 84 | + [codecov shield]: https://img.shields.io/codecov/c/github/pythonnet/pythonnet/pytest.svg?label=codecov | ||
| 85 | + | ||
| 83 | 86 | [license shield]: https://img.shields.io/badge/license-MIT-blue.svg | |
| 84 | 87 | ||
| 85 | 88 | [pypi package version]: https://img.shields.io/pypi/v/pythonnet.svg | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,6 @@ environment: | |||
| 10 | 10 | PYTHONUNBUFFERED: True | |
| 11 | 11 | PYTHONWARNINGS: 'ignore:::wheel.pep425tags:' | |
| 12 | 12 | PYTHONPATH: C:\testdir | |
| 13 | - NUNIT: nunit-console | ||
| 14 | 13 | CONDA_BLD: C:\conda | |
| 15 | 14 | CONDA_BLD_VERSION: 3.5 | |
| 16 | 15 | ||
@@ -35,7 +34,6 @@ init: | |||
| 35 | 34 | - set CONDA_BLD_ARCH=%PLATFORM:x=% | |
| 36 | 35 | - set PYTHON=C:\PYTHON%PYTHON_VERSION:.=% | |
| 37 | 36 | - if %PLATFORM%==x86 (set CONDA_BLD_ARCH=32) | |
| 38 | - - if %PLATFORM%==x86 (set NUNIT=%NUNIT%-x86) | ||
| 39 | 37 | - if %PLATFORM%==x64 (set PYTHON=%PYTHON%-x64) | |
| 40 | 38 | ||
| 41 | 39 | # Prepend newly installed Python to the PATH of this build | |
@@ -47,21 +45,29 @@ init: | |||
| 47 | 45 | - python -c "import ctypes; print(ctypes.sizeof(ctypes.c_wchar))" | |
| 48 | 46 | ||
| 49 | 47 | install: | |
| 50 | - # install for wheels | ||
| 51 | - - pip install --upgrade pip wheel six | ||
| 48 | + # install for wheels & coverage | ||
| 49 | + - pip install --upgrade pip wheel coverage codecov six | ||
| 50 | + | ||
| 51 | + # Install OpenCover. Can't put on packages.config; not Linux/Mono compatible | ||
| 52 | + - .\tools\nuget\nuget.exe install OpenCover -OutputDirectory packages | ||
| 52 | 53 | ||
| 53 | 54 | build_script: | |
| 54 | - # build clean sdist & wheel | ||
| 55 | - - python setup.py sdist bdist_wheel | ||
| 55 | + # build clean sdist & wheel with coverage of setup.py, install local wheel | ||
| 56 | + - coverage run setup.py sdist bdist_wheel | ||
| 56 | 57 | ||
| 57 | 58 | test_script: | |
| 58 | 59 | - pip install --no-index --find-links=.\dist\ pythonnet | |
| 59 | 60 | - ps: Copy-Item (Resolve-Path .\build\*\Python.Test.dll) C:\testdir | |
| 60 | - - python src\tests\runtests.py | ||
| 61 | - # - "%NUNIT% src/embed_tests/bin/%PLATFORM%/ReleaseWin/Python.EmbeddingTest.dll" | ||
| 61 | + | ||
| 62 | + # Test runner | ||
| 63 | + - ps: .\ci\appveyor_run_tests.ps1 | ||
| 62 | 64 | ||
| 63 | 65 | # Build conda-recipe on Pull Requests | |
| 64 | 66 | - ps: .\ci\appveyor_build_recipe.ps1 | |
| 65 | 67 | ||
| 68 | + on_finish: | ||
| 69 | + # Upload coverage | ||
| 70 | + - codecov | ||
| 71 | + | ||
| 66 | 72 | artifacts: | |
| 67 | 73 | - path: dist\* | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,33 @@ | |||
| 1 | + # Script to simplify appveyor configuration and resolve path to tools | ||
| 2 | + | ||
| 3 | + # Executable paths for OpenCover | ||
| 4 | + # Note if OpenCover fails, it won't affect the exit codes. | ||
| 5 | + $OPENCOVER = Resolve-Path .\packages\OpenCover.*\tools\OpenCover.Console.exe | ||
| 6 | + $NUNIT = Resolve-Path .\packages\NUnit.ConsoleRunner*\tools\nunit3-console.exe | ||
| 7 | + $PY = Get-Command python | ||
| 8 | + | ||
| 9 | + # Can't use ".\build\*\Python.EmbeddingTest.dll". Missing framework files. | ||
| 10 | + $CS_TESTS = Resolve-Path .\src\embed_tests\bin\*\*\Python.EmbeddingTest.dll | ||
| 11 | + $RUNTIME_DIR = Resolve-Path .\src\runtime\bin\*\ReleaseWin\ | ||
| 12 | + | ||
| 13 | + # Run python tests with C# coverage | ||
| 14 | + # why `2>&1 | %{ "$_" }`? see: http://stackoverflow.com/a/20950421/5208670 | ||
| 15 | + .$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:py.coverage -target:"$PY" -targetargs:src\tests\runtests.py -returntargetcode 2>&1 | %{ "$_" } | ||
| 16 | + $PYTHON_STATUS = $LastExitCode | ||
| 17 | + if ($PYTHON_STATUS -ne 0) { | ||
| 18 | + Write-Host "Python tests failed, continuing to embedded tests" -ForegroundColor "Red" | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + # Run Embedded tests with C# coverage | ||
| 22 | + # .$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:cs.coverage -target:"$NUNIT" -targetargs:"$CS_TESTS" -returntargetcode | ||
| 23 | + # $NUNIT_STATUS = $LastExitCode | ||
| 24 | + # if ($NUNIT_STATUS -ne 0) { | ||
| 25 | + # Write-Host "Embedded tests failed" -ForegroundColor "Red" | ||
| 26 | + # } | ||
| 27 | + | ||
| 28 | + # Embedded tests failing due to open issues, pass/fail only on Python exit code | ||
| 29 | + # if ($PYTHON_STATUS -ne 0 -or $NUNIT_STATUS -ne 0) { | ||
| 30 | + if ($PYTHON_STATUS -ne 0) { | ||
| 31 | + Write-Host "Tests failed" -ForegroundColor "Red" | ||
| 32 | + $host.SetShouldExit(1) | ||
| 33 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> | |
| 2 | 2 | <packages> | |
| 3 | 3 | <package id="NUnit" version="3.5.0" targetFramework="net40" /> | |
| 4 | + <package id="NUnit.ConsoleRunner" version="3.5.0" targetFramework="net40" /> | ||
| 4 | 5 | </packages> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments