Skip to content

Commit

Permalink
[ci/test-reports] publish to agent working dir
Browse files Browse the repository at this point in the history
  • Loading branch information
marscher committed Oct 15, 2019
1 parent 1a4327c commit e86eb17
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
1 change: 1 addition & 0 deletions devtools/azure-pipelines-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:

- script: sudo chmod -R 777 /usr/local/miniconda
displayName: Fix Conda permissions
- script: env

- template: conda-setup+build.yml
- template: test-results.yml
5 changes: 1 addition & 4 deletions devtools/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ source:

build:
script_env:
- CIRCLE_TEST_REPORTS
- OMP_NUM_THREADS
- AGENT_BUILDDIRECTORY
script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv"

requirements:
Expand All @@ -22,14 +22,11 @@ requirements:
host:
- cython
- intel-openmp # [osx]
- mdtraj
- numpy
- python
- scipy
- setuptools
- pip
# we ship this in the repo
# - pybind11

run:
#- bhmm >=0.6.3,<0.7
Expand Down
15 changes: 7 additions & 8 deletions devtools/conda-recipe/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
import sys

import pytest
import tempfile

cover_pkg = 'sktime'

xml_results_dest = os.getenv('SYSTEM_DEFAULTWORKINGDIRECTORY', tempfile.gettempdir())
assert os.path.isdir(xml_results_dest), 'no dest dir available'
# where to write junit xml
junit_xml = os.path.join(os.getenv('CIRCLE_TEST_REPORTS', os.path.expanduser('~')),
'reports', 'junit.xml')
target_dir = os.path.dirname(junit_xml)
if not os.path.exists(target_dir):
os.makedirs(target_dir)
junit_xml = os.path.join(xml_results_dest, 'junit.xml')
cov_xml = os.path.join(xml_results_dest, 'coverage.xml')
print('junit destination:', junit_xml)

print('coverage dest:', cov_xml)
pytest_args = ("-vv "
"--cov={cover_pkg} "
"--cov-report=xml:{dest_report} "
Expand All @@ -22,7 +21,7 @@
"tests/ "
.format(cover_pkg=cover_pkg,
junit_xml=junit_xml,
dest_report=os.path.join(os.path.expanduser('~/'), 'coverage.xml'),
dest_report=cov_xml,
)
.split(' '))

Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-setup+build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ steps:
conda config --add channels conda-forge
conda config --set always_yes true
conda config --set quiet true
conda install conda-build
conda install conda-build conda-verify
displayName: 'Install dependencies'
continueOnError: false
- bash: |
Expand Down
14 changes: 12 additions & 2 deletions devtools/test-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ steps:
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit' # Options: JUnit, NUnit, VSTest, xUnit, cTest
testResultsFiles: '**/junit.xml'
searchFolder: '$(HOME)' # Optional
testResultsFiles: '**/*junit.xml'
failTaskOnFailedTests: true # Optional
publishRunAttachments: true # Optional

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'cobertura' # Options: cobertura, jaCoCo
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
pathToSources: '$(Build.SourcesDirectory)/sktime' # Optional
#reportDirectory: # Optional
#additionalCodeCoverageFiles: # Optional
#failIfCoverageEmpty: false # Optional

- bash: curl -s https://codecov.io/bash | bash

0 comments on commit e86eb17

Please sign in to comment.