Skip to content

Commit c89e8b3

Browse files
committed
Try to run fewer CI jobs, more efficiently
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 37bc3f2 commit c89e8b3

File tree

3 files changed

+119
-98
lines changed

3 files changed

+119
-98
lines changed

azure-pipelines.yml

Lines changed: 90 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,16 @@ jobs:
1717
image_name: ubuntu-20.04
1818
python_versions: ['3.8']
1919
test_suites:
20-
misc: |
21-
venv/bin/pytest -n 3 -vvs --test-suite=all \
22-
--ignore=tests/scancode \
23-
--ignore=tests/cluecode \
24-
--ignore=tests/licensedcode
25-
26-
scancode: |
20+
misc_and_scancode: |
2721
# cli tests are launched below on all OSes
28-
venv/bin/pytest -vvs --test-suite=all \
29-
--ignore=tests/scancode/test_cli.py \
30-
tests/scancode
31-
32-
cluecode: |
3322
venv/bin/pytest -n 3 -vvs --test-suite=all \
34-
tests/cluecode
23+
--ignore=tests/cluecode \
24+
--ignore=tests/licensedcode \
25+
--ignore=tests/scancode/test_cli.py
3526
36-
license_base: |
27+
cluecode_license_base: |
3728
venv/bin/pytest -n 3 -vvs --test-suite=all \
29+
tests/cluecode \
3830
--ignore=tests/licensedcode/test_zzzz_cache.py \
3931
--ignore=tests/licensedcode/test_detection_datadriven_external.py \
4032
--ignore=tests/licensedcode/test_detection_datadriven1.py \
@@ -43,20 +35,14 @@ jobs:
4335
--ignore=tests/licensedcode/test_detection_datadriven4.py \
4436
tests/licensedcode
4537
46-
license_datadriven1: |
47-
venv/bin/pytest -n 3 -vvs --test-suite=all \
48-
tests/licensedcode/test_detection_datadriven1.py
49-
50-
license_datadriven2: |
38+
license_datadriven1_2: |
5139
venv/bin/pytest -n 3 -vvs --test-suite=all \
40+
tests/licensedcode/test_detection_datadriven1.py \
5241
tests/licensedcode/test_detection_datadriven2.py
5342
54-
license_datadriven3: |
55-
venv/bin/pytest -n 3 -vvs --test-suite=all \
56-
tests/licensedcode/test_detection_datadriven3.py
57-
58-
license_datadriven4: |
43+
license_datadriven3_4: |
5944
venv/bin/pytest -n 3 -vvs --test-suite=all \
45+
tests/licensedcode/test_detection_datadriven3.py \
6046
tests/licensedcode/test_detection_datadriven4.py
6147
6248
license_datadriven_ext: |
@@ -112,9 +98,18 @@ jobs:
11298

11399
- template: etc/ci/azure-posix.yml
114100
parameters:
115-
job_name: macos1015_cpython
101+
job_name: macos1015_cpython_1
116102
image_name: macos-10.15
117-
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
103+
python_versions: ['3.6', '3.7', '3.8']
104+
python_architecture: x64
105+
test_suites:
106+
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
107+
108+
- template: etc/ci/azure-posix.yml
109+
parameters:
110+
job_name: macos1015_cpython_2
111+
image_name: macos-10.15
112+
python_versions: ['3.9', '3.10']
118113
python_architecture: x64
119114
test_suites:
120115
all: venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
@@ -130,18 +125,36 @@ jobs:
130125

131126
- template: etc/ci/azure-win.yml
132127
parameters:
133-
job_name: win2019_cpython
128+
job_name: win2019_cpython_1
134129
image_name: windows-2019
135-
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
130+
python_versions: ['3.6', '3.7', '3.8']
131+
python_architecture: x64
132+
test_suites:
133+
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
134+
135+
- template: etc/ci/azure-win.yml
136+
parameters:
137+
job_name: win2019_cpython_2
138+
image_name: windows-2019
139+
python_versions: ['3.9', '3.10']
136140
python_architecture: x64
137141
test_suites:
138142
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
139143

140144
- template: etc/ci/azure-win.yml
141145
parameters:
142-
job_name: win2022_cpython
146+
job_name: win2022_cpython_1
143147
image_name: windows-2022
144-
python_versions: ['3.7', '3.8', '3.9', '3.10']
148+
python_versions: ['3.7', '3.8']
149+
python_architecture: x64
150+
test_suites:
151+
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
152+
153+
- template: etc/ci/azure-win.yml
154+
parameters:
155+
job_name: win2022_cpython_2
156+
image_name: windows-2022
157+
python_versions: ['3.9', '3.10']
145158
python_architecture: x64
146159
test_suites:
147160
all: venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
@@ -290,28 +303,6 @@ jobs:
290303
# test_suite: venv/bin/pytest -n 2 -vvs
291304

292305

293-
########################################################################
294-
# RELEASE on 3.6. Also check that we can pip install
295-
########################################################################
296-
#
297-
# - job: Build_release_archive_py3
298-
# pool:
299-
# vmImage: ubuntu-18.04
300-
# steps:
301-
# - checkout: self
302-
# fetchDepth: 10
303-
#
304-
# - task: UsePythonVersion@0
305-
# inputs:
306-
# versionSpec: '3.6'
307-
# displayName: 'Install Python 3.6'
308-
#
309-
# - script: ./etc/release/scancode-test-pip-install.sh
310-
# displayName: 'Test pip wheel installation'
311-
#
312-
# - script: ./etc/release/scancode-test-pip-install-editable.sh
313-
# displayName: 'Test pip editable installation'
314-
315306
################################################################################
316307
# Tests using a plain pip install to get the latest of all wheels
317308
################################################################################
@@ -323,44 +314,77 @@ jobs:
323314
image_name: ubuntu-18.04
324315
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
325316
test_suites:
326-
all: venv/bin/pip install --force-reinstall --upgrade -e .[dev] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
317+
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[dev] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
327318

328319
- template: etc/ci/azure-posix.yml
329320
parameters:
330321
job_name: ubuntu20_cpython_latest_from_pip
331322
image_name: ubuntu-20.04
332323
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
333324
test_suites:
334-
all: venv/bin/pip install --force-reinstall --upgrade -e .[dev] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
325+
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[dev] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
335326

336327
- template: etc/ci/azure-posix.yml
337328
parameters:
338-
job_name: macos1015_cpython_latest_from_pip
329+
job_name: macos1015_cpython_latest_from_pip1
339330
image_name: macos-10.15
340-
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
331+
python_versions: ['3.6', '3.7']
332+
test_suites:
333+
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[dev] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
334+
335+
- template: etc/ci/azure-posix.yml
336+
parameters:
337+
job_name: macos1015_cpython_latest_from_pip2
338+
image_name: macos-10.15
339+
python_versions: ['3.8', '3.9', '3.10']
341340
test_suites:
342-
all: venv/bin/pip install --force-reinstall --upgrade -e .[dev] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
341+
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[dev] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
343342

344343
- template: etc/ci/azure-posix.yml
345344
parameters:
346-
job_name: macos11_cpython_latest_from_pip
345+
job_name: macos11_cpython_latest_from_pip1
347346
image_name: macos-11
348-
python_versions: ['3.7', '3.8', '3.9', '3.10']
347+
python_versions: ['3.7', '3.8', ]
349348
test_suites:
350-
all: venv/bin/pip install --force-reinstall --upgrade -e .[dev] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
349+
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[dev] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
350+
351+
- template: etc/ci/azure-posix.yml
352+
parameters:
353+
job_name: macos11_cpython_latest_from_pip2
354+
image_name: macos-11
355+
python_versions: ['3.9', '3.10']
356+
test_suites:
357+
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[dev] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
351358

352359
- template: etc/ci/azure-win.yml
353360
parameters:
354-
job_name: win2019_cpython_latest_from_pip
361+
job_name: win2019_cpython_latest_from_pip1
355362
image_name: windows-2019
356-
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
363+
python_versions: ['3.6', '3.7']
364+
test_suites:
365+
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[dev] && venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
366+
367+
- template: etc/ci/azure-win.yml
368+
parameters:
369+
job_name: win2019_cpython_latest_from_pip2
370+
image_name: windows-2019
371+
python_versions: ['3.8', '3.9', '3.10']
357372
test_suites:
358-
all: venv\Scripts\pip install --force-reinstall --upgrade -e .[dev] && venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
373+
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[dev] && venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
359374

360375
- template: etc/ci/azure-win.yml
361376
parameters:
362-
job_name: win2022_cpython_latest_from_pip
377+
job_name: win2022_cpython_latest_from_pip1
363378
image_name: windows-2022
364-
python_versions: ['3.7', '3.8', '3.9', '3.10']
379+
python_versions: ['3.7', '3.8']
365380
test_suites:
366-
all: venv\Scripts\pip install --force-reinstall --upgrade -e .[dev] && venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
381+
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[dev] && venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
382+
383+
- template: etc/ci/azure-win.yml
384+
parameters:
385+
job_name: win2022_cpython_latest_from_pip2
386+
image_name: windows-2022
387+
python_versions: ['3.9', '3.10']
388+
test_suites:
389+
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[dev] && venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
390+

etc/ci/azure-posix.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,27 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
${{ each pyver in parameters.python_versions }}:
1716
${{ each tsuite in parameters.test_suites }}:
18-
${{ format('py{0} {1}', pyver, tsuite.key) }}:
19-
python_version: ${{ pyver }}
17+
${{ tsuite.key }}:
2018
test_suite_label: ${{ tsuite.key }}
2119
test_suite: ${{ tsuite.value }}
2220

2321
steps:
2422
- checkout: self
2523
fetchDepth: 10
2624

27-
- task: UsePythonVersion@0
28-
inputs:
29-
versionSpec: '$(python_version)'
30-
architecture: '${{ parameters.python_architecture }}'
31-
displayName: 'Install Python $(python_version)'
25+
- ${{ each pyver in parameters.python_versions }}:
26+
- task: UsePythonVersion@0
27+
inputs:
28+
versionSpec: '${{ pyver }}'
29+
architecture: '${{ parameters.python_architecture }}'
30+
displayName: '${{ pyver }} - Install Python'
3231

33-
- script: |
34-
python --version
35-
python3 --version
36-
python$(python_version) --version
37-
echo "python$(python_version)" > PYTHON_EXECUTABLE
38-
./configure --dev
39-
displayName: 'Run Configure'
32+
- script: |
33+
python${{ pyver }} --version
34+
echo "python${{ pyver }}" > PYTHON_EXECUTABLE
35+
./configure --clean && ./configure --dev
36+
displayName: '${{ pyver }} - Configure'
4037
41-
- script: $(test_suite)
42-
displayName: 'Run $(test_suite_label) tests with py$(python_version) on ${{ parameters.job_name }}'
38+
- script: $(test_suite)
39+
displayName: '${{ pyver }} - $(test_suite_label) on ${{ parameters.job_name }}'

etc/ci/azure-win.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
${{ each pyver in parameters.python_versions }}:
1716
${{ each tsuite in parameters.test_suites }}:
18-
${{ format('py{0} {1}', pyver, tsuite.key) }}:
19-
python_version: ${{ pyver }}
17+
${{ tsuite.key }}:
2018
test_suite_label: ${{ tsuite.key }}
2119
test_suite: ${{ tsuite.value }}
20+
2221
steps:
2322
- checkout: self
2423
fetchDepth: 10
2524

26-
- task: UsePythonVersion@0
27-
inputs:
28-
versionSpec: '$(python_version)'
29-
architecture: '${{ parameters.python_architecture }}'
30-
displayName: 'Install Python $(python_version)'
25+
- ${{ each pyver in parameters.python_versions }}:
26+
- task: UsePythonVersion@0
27+
inputs:
28+
versionSpec: '${{ pyver }}'
29+
architecture: '${{ parameters.python_architecture }}'
30+
displayName: '${{ pyver }} - Install Python'
3131

32-
- script: |
33-
python --version
34-
echo | set /p=python> PYTHON_EXECUTABLE
35-
configure --dev
36-
displayName: 'Run Configure'
32+
- script: |
33+
python --version
34+
echo | set /p=python> PYTHON_EXECUTABLE
35+
configure --clean && configure --dev
36+
displayName: '${{ pyver }} - Configure'
3737
38-
- script: $(test_suite)
39-
displayName: 'Run $(test_suite_label) tests with py$(python_version) on ${{ parameters.job_name }}'
38+
- script: $(test_suite)
39+
displayName: '${{ pyver }} - $(test_suite_label) on ${{ parameters.job_name }}'

0 commit comments

Comments
 (0)