Skip to content

Commit 0d615ec

Browse files
authored
Add CI tests for azdev commands (setup, style, test, linter) (#110)
* Initial work * Bump version.
1 parent bd9076a commit 0d615ec

File tree

6 files changed

+124
-6
lines changed

6 files changed

+124
-6
lines changed

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Release History
44
===============
55

6+
0.1.3
7+
++++++
8+
* `azdev linter`: Fix issue where certain installations would fail on `ci_exclusions.yml` not found.
9+
10+
611
0.1.2
712
++++++
813
* `azdev setup`: Fix regression where azure.cli could not be run after installation.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ include HISTORY.rst
33
include README.md
44
recursive-include azdev/config *
55
recursive-include azdev/mod_templates *
6+
recursive-include azdev/operations/linter/rules *

azdev/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# -----------------------------------------------------------------------------
66

7-
__VERSION__ = '0.1.2'
7+
__VERSION__ = '0.1.3'

azure-pipelines.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,107 @@ jobs:
120120
inputs:
121121
TargetPath: $(Build.ArtifactStagingDirectory)
122122
ArtifactName: pypi
123+
124+
- job: TestAzdevSetup
125+
displayName: 'Test azdev setup'
126+
dependsOn: BuildPythonWheel
127+
condition: succeeded()
128+
pool:
129+
vmImage: 'ubuntu-16.04'
130+
steps:
131+
- task: DownloadPipelineArtifact@1
132+
displayName: 'Download Build'
133+
inputs:
134+
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
135+
artifactName: pypi
136+
137+
- task: UsePythonVersion@0
138+
displayName: 'Use Python 3.7'
139+
inputs:
140+
versionSpec: 3.7
141+
142+
- bash: |
143+
#!/usr/bin/env bash
144+
set -ev
145+
. scripts/ci/install.sh
146+
# verify azdev setup worked
147+
az -h
148+
displayName: 'Test azdev setup'
149+
150+
- job: TestAzdevTest
151+
displayName: 'Test azdev test'
152+
dependsOn: BuildPythonWheel
153+
condition: succeeded()
154+
pool:
155+
vmImage: 'ubuntu-16.04'
156+
steps:
157+
- task: DownloadPipelineArtifact@1
158+
displayName: 'Download Build'
159+
inputs:
160+
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
161+
artifactName: pypi
162+
163+
- task: UsePythonVersion@0
164+
displayName: 'Use Python 3.7'
165+
inputs:
166+
versionSpec: 3.7
167+
168+
- bash: |
169+
#!/usr/bin/env bash
170+
set -ev
171+
. scripts/ci/install.sh
172+
# verify azdev test works
173+
azdev test redis
174+
displayName: 'Test azdev test'
175+
176+
- job: TestAzdevLinter
177+
displayName: 'Test azdev linter'
178+
dependsOn: BuildPythonWheel
179+
condition: succeeded()
180+
pool:
181+
vmImage: 'ubuntu-16.04'
182+
steps:
183+
- task: DownloadPipelineArtifact@1
184+
displayName: 'Download Build'
185+
inputs:
186+
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
187+
artifactName: pypi
188+
189+
- task: UsePythonVersion@0
190+
displayName: 'Use Python 3.7'
191+
inputs:
192+
versionSpec: 3.7
193+
194+
- bash: |
195+
#!/usr/bin/env bash
196+
set -ev
197+
. scripts/ci/install.sh
198+
# verify azdev linter works
199+
azdev linter redis
200+
displayName: 'Test azdev linter'
201+
202+
- job: TestAzdevStyle
203+
displayName: 'Test azdev style'
204+
dependsOn: BuildPythonWheel
205+
condition: succeeded()
206+
pool:
207+
vmImage: 'ubuntu-16.04'
208+
steps:
209+
- task: DownloadPipelineArtifact@1
210+
displayName: 'Download Build'
211+
inputs:
212+
TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
213+
artifactName: pypi
214+
215+
- task: UsePythonVersion@0
216+
displayName: 'Use Python 3.7'
217+
inputs:
218+
versionSpec: 3.7
219+
220+
- bash: |
221+
#!/usr/bin/env bash
222+
set -ev
223+
. scripts/ci/install.sh
224+
# verify azdev style works
225+
azdev style redis
226+
displayName: 'Test azdev style'

scripts/ci/build.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ set -ev
77

88
cd $BUILD_SOURCESDIRECTORY
99

10-
echo "Build `azdev`"
11-
python --version
12-
10+
echo "Build azdev"
1311
pip install -U pip setuptools wheel
14-
pip list
15-
1612
python setup.py bdist_wheel sdist -d $BUILD_STAGINGDIRECTORY

scripts/ci/install.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -ev
4+
5+
echo "Install azdev into virtual environment"
6+
python -m venv env
7+
. env/bin/activate
8+
pip install -U pip setuptools wheel
9+
pip install $(find ${BUILD_ARTIFACTSTAGINGDIRECTORY}/pypi -name *.tar.gz)
10+
git clone https://github.com/Azure/azure-cli.git
11+
git clone https://github.com/Azure/azure-cli-extensions.git
12+
azdev setup -c -r azure-cli-extensions

0 commit comments

Comments
 (0)