From 1b0a2307b8e3d5de7fe443ac62b89fb6e324ee5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 13 Oct 2018 14:06:11 +0200 Subject: [PATCH 1/9] add pytest to appveyor --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 46a72a30d..0bbbcf3ce 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ environment: PYTHON: 'C:\Python37-x64\python.exe' init: -- cmd: '%PYTHON% -m pip install -U nose wheel' +- cmd: '%PYTHON% -m pip install -U nose wheel pytest' build_script: - cmd: | From 9803a75cd8bc07094206e276735b0a609514ff09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 13 Oct 2018 14:13:38 +0200 Subject: [PATCH 2/9] use pytest as runner --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0bbbcf3ce..f341a2bd5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -49,11 +49,11 @@ build_script: test_script: - ps: | cp build\Release\git2.dll . - &$env:PYTHON setup.py nosetests --with-xunit + &$env:PYTHON -m pytest --junitxml=testresults.xml if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } # upload results to AppVeyor $wc = New-Object 'System.Net.WebClient' - $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nosetests.xml)) + $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\testresults.xml)) artifacts: - path: dist\*.whl From 16073a8f9fe1d55eb5e58ceb9f7686927bc890f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 13 Oct 2018 14:28:34 +0200 Subject: [PATCH 3/9] use tox --- appveyor.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f341a2bd5..5b58cdf7e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,27 +9,37 @@ environment: matrix: - GENERATOR: 'Visual Studio 10' PYTHON: 'C:\Python27\python.exe' + TOXENV: py27 - GENERATOR: 'Visual Studio 10 Win64' PYTHON: 'C:\Python27-x64\python.exe' + TOXENV: py27 - GENERATOR: 'Visual Studio 10' PYTHON: 'C:\Python34\python.exe' + TOXENV: py34 - GENERATOR: 'Visual Studio 10 Win64' PYTHON: 'C:\Python34-x64\python.exe' + TOXENV: py34 - GENERATOR: 'Visual Studio 14' PYTHON: 'C:\Python35\python.exe' + TOXENV: py35 - GENERATOR: 'Visual Studio 14 Win64' PYTHON: 'C:\Python35-x64\python.exe' + TOXENV: py35 - GENERATOR: 'Visual Studio 14' PYTHON: 'C:\Python36\python.exe' + TOXENV: py36 - GENERATOR: 'Visual Studio 14 Win64' PYTHON: 'C:\Python36-x64\python.exe' + TOXENV: py36 - GENERATOR: 'Visual Studio 14' PYTHON: 'C:\Python37\python.exe' + TOXENV: py37 - GENERATOR: 'Visual Studio 14 Win64' PYTHON: 'C:\Python37-x64\python.exe' + TOXENV: py37 init: -- cmd: '%PYTHON% -m pip install -U nose wheel pytest' +- cmd: '%PYTHON% -m pip install -U wheel tox' build_script: - cmd: | @@ -49,7 +59,7 @@ build_script: test_script: - ps: | cp build\Release\git2.dll . - &$env:PYTHON -m pytest --junitxml=testresults.xml + &$env:PYTHON -m tox -e $env:TOXENV if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } # upload results to AppVeyor $wc = New-Object 'System.Net.WebClient' From 87f0eba6b39abf016d291dae50ae07c67a85f47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 13 Oct 2018 14:35:18 +0200 Subject: [PATCH 4/9] add libgit location --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 5b58cdf7e..20af977c1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -59,6 +59,7 @@ build_script: test_script: - ps: | cp build\Release\git2.dll . + $Env:LIBGIT2 = ($Env:APPVEYOR_BUILD_FOLDER + "\build\libgit2") &$env:PYTHON -m tox -e $env:TOXENV if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } # upload results to AppVeyor From 198ce2834a8ab5d54aaa029c23e2caeaafca146c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 13 Oct 2018 14:42:41 +0200 Subject: [PATCH 5/9] pass down libgit2 --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 90ae8c96c..e94e4c646 100644 --- a/tox.ini +++ b/tox.ini @@ -4,3 +4,4 @@ envlist = py27,py34,py35,py36,py37,pypy,pypy3 [testenv] deps = pytest commands = pytest {posargs} +passenv = LIBGIT2 From e47794c15db2c8ded9460b60e658dce3565ec97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 13 Oct 2018 14:48:52 +0200 Subject: [PATCH 6/9] publish junit tests --- appveyor.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 20af977c1..6b1701315 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -64,7 +64,7 @@ test_script: if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } # upload results to AppVeyor $wc = New-Object 'System.Net.WebClient' - $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\testresults.xml)) + $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path ".\junit-$env:TOXENV.xml")) artifacts: - path: dist\*.whl diff --git a/tox.ini b/tox.ini index e94e4c646..b832ae384 100644 --- a/tox.ini +++ b/tox.ini @@ -3,5 +3,5 @@ envlist = py27,py34,py35,py36,py37,pypy,pypy3 [testenv] deps = pytest -commands = pytest {posargs} +commands = pytest --junitxml=junit-{envname}.xml {posargs} passenv = LIBGIT2 From b273b2eefc8b9766be1841c34060d811dff49130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 13 Oct 2018 15:03:56 +0200 Subject: [PATCH 7/9] add python to the path while testing --- appveyor.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 6b1701315..5e2d26c7b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -59,8 +59,12 @@ build_script: test_script: - ps: | cp build\Release\git2.dll . - $Env:LIBGIT2 = ($Env:APPVEYOR_BUILD_FOLDER + "\build\libgit2") + + $env:LIBGIT2 = ($Env:APPVEYOR_BUILD_FOLDER + "\build\libgit2") + $env:PATH = $env:PATH + ";" + (split-path $env:PYTHON -parent) + &$env:PYTHON -m tox -e $env:TOXENV + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } # upload results to AppVeyor $wc = New-Object 'System.Net.WebClient' From f7c59892049646842a096b5771c0e249091dfad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 13 Oct 2018 15:18:53 +0200 Subject: [PATCH 8/9] specify base python --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index b832ae384..5e9381f40 100644 --- a/tox.ini +++ b/tox.ini @@ -5,3 +5,4 @@ envlist = py27,py34,py35,py36,py37,pypy,pypy3 deps = pytest commands = pytest --junitxml=junit-{envname}.xml {posargs} passenv = LIBGIT2 +basepython = {env:PYTHON:} From 3cb64a50fded9b93e0590bfbc8712d6bce89d365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 13 Oct 2018 15:25:48 +0200 Subject: [PATCH 9/9] remove unused commands --- appveyor.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5e2d26c7b..acfac306f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -58,14 +58,11 @@ build_script: test_script: - ps: | - cp build\Release\git2.dll . - $env:LIBGIT2 = ($Env:APPVEYOR_BUILD_FOLDER + "\build\libgit2") - $env:PATH = $env:PATH + ";" + (split-path $env:PYTHON -parent) - - &$env:PYTHON -m tox -e $env:TOXENV + &$env:PYTHON -m tox if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } + # upload results to AppVeyor $wc = New-Object 'System.Net.WebClient' $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path ".\junit-$env:TOXENV.xml"))