Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 16 additions & 183 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,195 +6,28 @@ trigger:

jobs:

- job: 'Test_bare_linux'

pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'


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

- script: |
pip install pytest pytest-cov pytest-mock pytest-timeout pytest-azurepipelines pytest-rerunfailures pytest-remotedata
pip install -e .
pytest pvlib --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
displayName: 'Test with pytest'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/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'


- job: 'Test_conda_linux'

pool:
vmImage: 'ubuntu-16.04'

strategy:
matrix:
Python35:
python.version: '35'
Python36:
python.version: '36'
coverage: true
Python37:
python.version: '37'
Python38:
python.version: '38'

steps:
- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
displayName: Add conda to PATH
- script: conda env create --quiet --file ci/requirements-py$(python.version).yml
displayName: Create Anaconda environment
- script: |
source activate test_env
pip install pytest-azurepipelines
pip install -e .
displayName: 'pip dependencies'
- script: |
source activate test_env
conda list
displayName: 'List installed dependencies'
- script: |
source activate test_env
export NREL_API_KEY=$(nrelApiKey)
pytest pvlib --remote-data --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html
displayName: 'pytest'
# - script: |
# source activate test_env
# flake8 pvlib
# displayName: 'flake8'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Linux $(python.version)'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
condition: eq(variables['coverage'], true)
- script: |
bash <(curl https://codecov.io/bash) -t bbc2bdbe-5e67-4fef-9cb7-f52fe0b703a8 -f coverage.xml -F adder -F subtractor -F conda
displayName: 'codecov'
condition: eq(variables['coverage'], true)
- template: ci/azure/posix.yml
parameters:
name: Test_bare_Linux
vmImage: ubuntu-16.04


- job: 'Test_conda_windows'

pool:
vmImage: 'vs2017-win2016'

strategy:
matrix:
Python35-windows:
python.version: '35'
Python36-windows:
python.version: '36'
Python37-windows:
python.version: '37'
Python38-windows:
python.version: '38'

steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
- script: conda env create --quiet --file ci/requirements-py$(python.version).yml
displayName: Create Anaconda environment
- script: |
call activate test_env
pip install pytest-azurepipelines
pip install -e .
displayName: 'pip dependencies'
- script: |
call activate test_env
conda list
displayName: 'List installed dependencies'
- script: |
call activate test_env
pytest pvlib --junitxml=junit/test-results.xml
displayName: 'pytest'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Windows $(python.version)'
- template: ci/azure/posix.yml
parameters:
name: Test_bare_macOS
vmImage: macOS-10.14


- job: 'Test_bare_macOS_Mojave'
- template: ci/azure/conda_linux.yml
parameters:
name: Test_conda_linux
vmImage: ubuntu-16.04

pool:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'

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

- script: |
pip install pytest pytest-cov pytest-mock pytest-timeout pytest-azurepipelines pytest-rerunfailures pytest-remotedata
pip install -e .
pytest pvlib --junitxml=junit/test-results.xml --cov=pvlib --cov-report=xml --cov-report=html
displayName: 'Test with pytest'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/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'


- job: DocTest
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
- script: |
pip install -e .[all]
displayName: Install pvlib[all] for doc build
- script: |
cd docs/sphinx/
sphinx-build -j auto -b html -d _build/doctrees source build
displayName: Build HTML docs
- template: ci/azure/conda_windows.yml
parameters:
name: Test_conda_windows
vmImage: vs2017-win2016


- job: 'Publish'
Expand Down
53 changes: 53 additions & 0 deletions ci/azure/conda_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
parameters:
name: ''
vmImage: ''

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
Python35:
python.version: '35'
Python36:
python.version: '36'
coverage: true
Python37:
python.version: '37'
Python38:
python.version: '38'

steps:
- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
displayName: Add conda to PATH
- script: conda env create --quiet --file ci/requirements-py$(python.version).yml
displayName: Create Anaconda environment
- script: |
source activate test_env
pip install pytest-azurepipelines
pip install -e .
displayName: 'pip dependencies'
- script: |
source activate test_env
conda list
displayName: 'List installed dependencies'
- script: |
source activate test_env
export NREL_API_KEY=$(nrelApiKey)
pytest pvlib --remote-data --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html
displayName: 'pytest'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Linux $(python.version)'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
condition: eq(variables['coverage'], true)
- script: |
bash <(curl https://codecov.io/bash) -t bbc2bdbe-5e67-4fef-9cb7-f52fe0b703a8 -f coverage.xml -F adder -F subtractor -F conda
displayName: 'codecov'
condition: eq(variables['coverage'], true)
41 changes: 41 additions & 0 deletions ci/azure/conda_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
parameters:
name: ''
vmImage: ''

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
Python35-windows:
python.version: '35'
Python36-windows:
python.version: '36'
Python37-windows:
python.version: '37'
Python38-windows:
python.version: '38'

steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
- script: conda env create --quiet --file ci/requirements-py$(python.version).yml
displayName: Create Anaconda environment
- script: |
call activate test_env
pip install pytest-azurepipelines
pip install -e .
displayName: 'pip dependencies'
- script: |
call activate test_env
conda list
displayName: 'List installed dependencies'
- script: |
call activate test_env
pytest pvlib --junitxml=junit/test-results.xml
displayName: 'pytest'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Windows $(python.version)'
41 changes: 41 additions & 0 deletions ci/azure/posix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
parameters:
name: ''
vmImage: ''

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'

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

- script: |
pip install pytest pytest-cov pytest-mock pytest-timeout pytest-azurepipelines pytest-rerunfailures pytest-remotedata
pip install -e .
pytest pvlib --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
displayName: 'Test with pytest'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/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'
2 changes: 2 additions & 0 deletions docs/sphinx/source/whatsnew/v0.7.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Testing
* Implement the `pytest.mark.flaky` decorator from `pytest-rurunfailures`
`<https://github.com/pytest-dev/pytest-rerunfailures>`_ on all network
dependent iotools tests to repeat them on failure. (:pull:`919`)
* Separate azure-pipelines.yml platform-specific tests to their own templates
located in ``./ci/azure/``. (:pull:`926`)

Documentation
~~~~~~~~~~~~~
Expand Down