From e282dc11613d11f871cf810a849d9cc37622336b Mon Sep 17 00:00:00 2001 From: Cameron Stark Date: Tue, 3 Mar 2020 12:12:16 -0700 Subject: [PATCH 1/4] try posix.yml template for bare linux and mac --- azure-pipelines.yml | 105 +++++--------------------------------------- ci/azure/posix.yml | 41 +++++++++++++++++ 2 files changed, 51 insertions(+), 95 deletions(-) create mode 100644 ci/azure/posix.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dd962d0585..4e89786dff 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,44 +6,11 @@ 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' +# Bare Mac and Linux use the same template +- template: ci/azure/posix.yml + parameters: + name: Test_bare_Linux + vmImage: ubuntu-16.04 - job: 'Test_conda_linux' @@ -60,8 +27,6 @@ jobs: coverage: true Python37: python.version: '37' - Python38: - python.version: '38' steps: - bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin" @@ -115,8 +80,6 @@ jobs: python.version: '36' Python37-windows: python.version: '37' - Python38-windows: - python.version: '38' steps: - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" @@ -142,59 +105,11 @@ jobs: testRunTitle: 'Windows $(python.version)' -- job: 'Test_bare_macOS_Mojave' - - 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 +# Bare Mac and Linux use the same template +- template: ci/azure/posix.yml + parameters: + name: Test_bare_macOS + vmImage: macOS-10.14 - job: 'Publish' diff --git a/ci/azure/posix.yml b/ci/azure/posix.yml new file mode 100644 index 0000000000..9b77bde9ac --- /dev/null +++ b/ci/azure/posix.yml @@ -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' From 625d91771f8322210782bcb1b4559ef54a84ba45 Mon Sep 17 00:00:00 2001 From: Cameron Stark Date: Tue, 3 Mar 2020 12:59:10 -0700 Subject: [PATCH 2/4] move conda tests to templates --- azure-pipelines.yml | 104 ++++--------------------------------- ci/azure/conda_linux.yml | 57 ++++++++++++++++++++ ci/azure/conda_windows.yml | 41 +++++++++++++++ 3 files changed, 109 insertions(+), 93 deletions(-) create mode 100644 ci/azure/conda_linux.yml create mode 100644 ci/azure/conda_windows.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4e89786dff..005f3fa3c6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,110 +6,28 @@ trigger: jobs: -# Bare Mac and Linux use the same template - template: ci/azure/posix.yml parameters: name: Test_bare_Linux vmImage: ubuntu-16.04 -- 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' - - 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) - - -- job: 'Test_conda_windows' - - pool: - vmImage: 'vs2017-win2016' +- template: ci/azure/posix.yml + parameters: + name: Test_bare_macOS + vmImage: macOS-10.14 - strategy: - matrix: - Python35-windows: - python.version: '35' - Python36-windows: - python.version: '36' - Python37-windows: - python.version: '37' - 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/conda_linux.yml + parameters: + name: Test_conda_linux + vmImage: ubuntu-16.04 -# Bare Mac and Linux use the same template -- template: ci/azure/posix.yml +- template: ci/azure/conda_windows.yml parameters: - name: Test_bare_macOS - vmImage: macOS-10.14 + name: Test_conda_windows + vmImage: vs2017-win2016 - job: 'Publish' diff --git a/ci/azure/conda_linux.yml b/ci/azure/conda_linux.yml new file mode 100644 index 0000000000..65a777cbe0 --- /dev/null +++ b/ci/azure/conda_linux.yml @@ -0,0 +1,57 @@ +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' + # - 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) diff --git a/ci/azure/conda_windows.yml b/ci/azure/conda_windows.yml new file mode 100644 index 0000000000..46edfe41e2 --- /dev/null +++ b/ci/azure/conda_windows.yml @@ -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)' From d593d161a747380bf809b8063c661ea10ec12eda Mon Sep 17 00:00:00 2001 From: Cameron Stark Date: Tue, 3 Mar 2020 13:29:03 -0700 Subject: [PATCH 3/4] add to what's new --- docs/sphinx/source/whatsnew/v0.7.2.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.7.2.rst b/docs/sphinx/source/whatsnew/v0.7.2.rst index 6d3162d643..a98400efad 100644 --- a/docs/sphinx/source/whatsnew/v0.7.2.rst +++ b/docs/sphinx/source/whatsnew/v0.7.2.rst @@ -58,6 +58,8 @@ Testing * Implement the `pytest.mark.flaky` decorator from `pytest-rurunfailures` ``_ 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 ~~~~~~~~~~~~~ From 2b7409caf0171d464b8aad6c3a8bf169771857ab Mon Sep 17 00:00:00 2001 From: Cameron Stark Date: Wed, 4 Mar 2020 13:28:43 -0700 Subject: [PATCH 4/4] remove commented flake check --- ci/azure/conda_linux.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ci/azure/conda_linux.yml b/ci/azure/conda_linux.yml index 65a777cbe0..836c6030e8 100644 --- a/ci/azure/conda_linux.yml +++ b/ci/azure/conda_linux.yml @@ -37,10 +37,6 @@ jobs: 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'