Skip to content

Commit

Permalink
Add CI tests for azdev commands (setup, style, test, linter) (#110)
Browse files Browse the repository at this point in the history
* Initial work

* Bump version.
  • Loading branch information
tjprescott authored Jul 3, 2019
1 parent bd9076a commit 0d615ec
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 6 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

0.1.3
++++++
* `azdev linter`: Fix issue where certain installations would fail on `ci_exclusions.yml` not found.


0.1.2
++++++
* `azdev setup`: Fix regression where azure.cli could not be run after installation.
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ include HISTORY.rst
include README.md
recursive-include azdev/config *
recursive-include azdev/mod_templates *
recursive-include azdev/operations/linter/rules *
2 changes: 1 addition & 1 deletion azdev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# license information.
# -----------------------------------------------------------------------------

__VERSION__ = '0.1.2'
__VERSION__ = '0.1.3'
104 changes: 104 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,107 @@ jobs:
inputs:
TargetPath: $(Build.ArtifactStagingDirectory)
ArtifactName: pypi

- job: TestAzdevSetup
displayName: 'Test azdev setup'
dependsOn: BuildPythonWheel
condition: succeeded()
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
artifactName: pypi

- task: UsePythonVersion@0
displayName: 'Use Python 3.7'
inputs:
versionSpec: 3.7

- bash: |
#!/usr/bin/env bash
set -ev
. scripts/ci/install.sh
# verify azdev setup worked
az -h
displayName: 'Test azdev setup'
- job: TestAzdevTest
displayName: 'Test azdev test'
dependsOn: BuildPythonWheel
condition: succeeded()
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
artifactName: pypi

- task: UsePythonVersion@0
displayName: 'Use Python 3.7'
inputs:
versionSpec: 3.7

- bash: |
#!/usr/bin/env bash
set -ev
. scripts/ci/install.sh
# verify azdev test works
azdev test redis
displayName: 'Test azdev test'
- job: TestAzdevLinter
displayName: 'Test azdev linter'
dependsOn: BuildPythonWheel
condition: succeeded()
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
artifactName: pypi

- task: UsePythonVersion@0
displayName: 'Use Python 3.7'
inputs:
versionSpec: 3.7

- bash: |
#!/usr/bin/env bash
set -ev
. scripts/ci/install.sh
# verify azdev linter works
azdev linter redis
displayName: 'Test azdev linter'
- job: TestAzdevStyle
displayName: 'Test azdev style'
dependsOn: BuildPythonWheel
condition: succeeded()
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
artifactName: pypi

- task: UsePythonVersion@0
displayName: 'Use Python 3.7'
inputs:
versionSpec: 3.7

- bash: |
#!/usr/bin/env bash
set -ev
. scripts/ci/install.sh
# verify azdev style works
azdev style redis
displayName: 'Test azdev style'
6 changes: 1 addition & 5 deletions scripts/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ set -ev

cd $BUILD_SOURCESDIRECTORY

echo "Build `azdev`"
python --version

echo "Build azdev"
pip install -U pip setuptools wheel
pip list

python setup.py bdist_wheel sdist -d $BUILD_STAGINGDIRECTORY
12 changes: 12 additions & 0 deletions scripts/ci/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -ev

echo "Install azdev into virtual environment"
python -m venv env
. env/bin/activate
pip install -U pip setuptools wheel
pip install $(find ${BUILD_ARTIFACTSTAGINGDIRECTORY}/pypi -name *.tar.gz)
git clone https://github.com/Azure/azure-cli.git
git clone https://github.com/Azure/azure-cli-extensions.git
azdev setup -c -r azure-cli-extensions

0 comments on commit 0d615ec

Please sign in to comment.