Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kip-hart committed Oct 20, 2019
2 parents ee8891a + 7d3c97f commit e035a6c
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 6 deletions.
50 changes: 50 additions & 0 deletions .azure-pipelines.yml
@@ -0,0 +1,50 @@
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

variables:
MPLBACKEND: Agg

pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python27:
python.version: '2.7'
Python34:
python.version: '3.4'
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'

- script: |
python -m pip install --upgrade pip
pip install -e .
displayName: 'Install package'

- script: |
pip install pytest pytest-azurepipelines pytest-cov
pytest --junitxml=junit/test-results.xml --cov=src/microstructpy --cov-report=xml --cov-report=html --cov-branch
displayName: 'pytest'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '$(System.DefaultWorkingDirectory)/**/junit/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
50 changes: 50 additions & 0 deletions junit/test-results.xml
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite errors="0" failures="0" hostname="ae-csml-206042l" name="pytest" skipped="0" tests="13" time="1.821" timestamp="2019-10-20T17:27:51.986460"><testcase classname="tests.test_misc" file="tests/test_misc.py" line="5" name="test_from_str_int" time="0.003"></testcase><testcase classname="tests.test_misc" file="tests/test_misc.py" line="18" name="test_from_str_float" time="0.002"></testcase><testcase classname="tests.test_misc" file="tests/test_misc.py" line="30" name="test_from_str_bool" time="0.002"></testcase><testcase classname="tests.test_misc" file="tests/test_misc.py" line="43" name="test_from_str_list" time="0.002"></testcase><testcase classname="tests.test_misc" file="tests/test_misc.py" line="55" name="test_from_str_list_of_lists" time="0.002"></testcase><testcase classname="tests.test_misc" file="tests/test_misc.py" line="68" name="test_tangent_sphere_2D" time="0.003"></testcase><testcase classname="tests.test_misc" file="tests/test_misc.py" line="82" name="test_tangent_sphere_ND" time="0.002"></testcase><testcase classname="tests.geometry.test_n_sphere" file="tests/geometry/test_n_sphere.py" line="7" name="test_eq" time="0.002"></testcase><testcase classname="tests.meshing.test_polymesh" file="tests/meshing/test_polymesh.py" line="67" name="test_eq" time="0.015"><system-out>transform
[0 1 2 3 4]
checking seed numbers True
checking phase numbers True
transform
[0 1 2 3 4]
checking seed numbers True
checking phase numbers True
transform
[0 1 2 3 4]
checking seed numbers True
checking phase numbers True
not same type
not same length
transform
[0 1 2 3 4]
not same regions
not same verts
transform
[0 1 2 3 4]
not same facets
transform
[0 1 2 3 4]
checking seed numbers True
checking phase numbers True
transform
[0 1 2 3 4]
checking seed numbers False
checking phase numbers False
</system-out></testcase><testcase classname="tests.meshing.test_polymesh" file="tests/meshing/test_polymesh.py" line="92" name="test_read_write" time="0.006"><system-out>transform
[0 1 2 3 4]
checking seed numbers True
checking phase numbers True
transform
[0 1 2 3 4]
checking seed numbers True
checking phase numbers True
</system-out></testcase><testcase classname="tests.meshing.test_polymesh" file="tests/meshing/test_polymesh.py" line="113" name="test_repr" time="0.007"><system-out>transform
[0 1 2 3 4]
checking seed numbers True
checking phase numbers True
transform
[0 1 2 3 4]
checking seed numbers True
checking phase numbers True
</system-out></testcase><testcase classname="tests.meshing.test_polymesh" file="tests/meshing/test_polymesh.py" line="120" name="test_from_seeds" time="0.159"><system-out>transform
[2 0 4 5 1 3]
checking seed numbers True
checking phase numbers True
</system-out></testcase><testcase classname="tests.meshing.test_polymesh" file="tests/meshing/test_polymesh.py" line="167" name="test_kp_loop" time="0.002"></testcase></testsuite></testsuites>
3 changes: 0 additions & 3 deletions setup.cfg
Expand Up @@ -15,9 +15,6 @@ addopts =
--doctest-modules
--doctest-glob=\*.rst
--tb=short
--cov=src/microstructpy/ tests
--cov-config=.coveragerc
--cov-branch

[isort]
force_single_line = True
Expand Down
19 changes: 16 additions & 3 deletions tox.ini
Expand Up @@ -4,7 +4,8 @@
# and then run "tox" from this directory.

[tox]
envlist = check,
envlist = clean,
check,
py27,
py35
py36,
Expand All @@ -14,11 +15,18 @@ envlist = check,

[testenv]
deps = pytest
pytest-html
setenv = MPLBACKEND = agg
commands =
pytest

[testenv:cov]
deps = pytest
pytest-cov
basepython = python3.6
usedevelop = True
setenv = MPLBACKEND = agg
commands =
pytest --html=test_reports/results/{envname}.html --cov-report=html:test_reports/coverage/{envname}
pytest --cov src/microstructpy --cov-report=html --cov-branch

[testenv:check]
deps = docutils
Expand Down Expand Up @@ -48,3 +56,8 @@ basepython = python3.6
commands = sphinx-build -Wn docs/source/ docs/build/
sphinx-build -b latex docs/source/ docs/build-pdf/
sphinx-build -b epub docs/source/ docs/build-epub/

[testenv:clean]
deps = coverage
skip_install = true
commands = coverage erase

0 comments on commit e035a6c

Please sign in to comment.