Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using tox & pytest in appveyor #826

Merged
merged 9 commits into from
Oct 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 16 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
- cmd: '%PYTHON% -m pip install -U wheel tox'

build_script:
- cmd: |
Expand All @@ -48,12 +58,14 @@ build_script:

test_script:
- ps: |
cp build\Release\git2.dll .
&$env:PYTHON setup.py nosetests --with-xunit
$env:LIBGIT2 = ($Env:APPVEYOR_BUILD_FOLDER + "\build\libgit2")
&$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 .\nosetests.xml))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path ".\junit-$env:TOXENV.xml"))

artifacts:
- path: dist\*.whl
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ envlist = py27,py34,py35,py36,py37,pypy,pypy3

[testenv]
deps = pytest
commands = pytest {posargs}
commands = pytest --junitxml=junit-{envname}.xml {posargs}
passenv = LIBGIT2
basepython = {env:PYTHON:}