Skip to content

Commit 037881b

Browse files
committed
unit test run multiple opsets in single job
1 parent 2b3c23d commit 037881b

File tree

7 files changed

+65
-44
lines changed

7 files changed

+65
-44
lines changed

ci_build/azure_pipelines/pretrained_model_test-matrix.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ jobs:
66
platforms: ['linux', 'windows', 'mac']
77
tf_versions: ['1.12', '1.11', '1.10', '1.9', '1.8', '1.7', '1.6', '1.5']
88
onnx_opsets: ['9', '8', '7']
9-
onnx_backends:
10-
onnxruntime: ['0.3.0']
119
job:
1210
steps:
1311
- template: 'pretrained_model_test.yml'

ci_build/azure_pipelines/pretrained_model_test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ jobs:
55
parameters:
66
tf_versions: ['1.12']
77
onnx_opsets: ['9', '8', '7']
8-
onnx_backends:
9-
onnxruntime: ['0.3.0']
108
job:
119
steps:
1210
- template: 'pretrained_model_test.yml'

ci_build/azure_pipelines/templates/job_generator.yml

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ parameters:
66
tf_versions: ['']
77
onnx_versions: ['']
88
onnx_opsets: ['']
9-
onnx_backends: {onnxruntime: ['']}
9+
onnx_backends: {onnxruntime: ['0.3.0']}
1010
job: {}
1111
run_setup: 'True'
1212

@@ -27,31 +27,55 @@ jobs:
2727
${{ each python_version in parameters.python_versions }}:
2828
${{ each tf_version in parameters.tf_versions }}:
2929
${{ each onnx_version in parameters.onnx_versions }}:
30-
${{ each onnx_opset in parameters.onnx_opsets }}:
31-
${{ each onnx_backend in parameters.onnx_backends }}:
32-
${{ each onnx_backend_version in onnx_backend.value }}:
33-
${{ format('{0} python{1} tf{2} onnx{3} opset{4} {5}{6}', platform, python_version, tf_version, onnx_version, onnx_opset, onnx_backend.key, onnx_backend_version) }}:
34-
CI_PYTHON_VERSION: '${{ python_version }}'
35-
CI_TF_VERSION: '${{ tf_version }}'
36-
CI_ONNX_VERSION: '${{ onnx_version }}'
37-
CI_ONNX_OPSET: '${{ onnx_opset }}'
38-
CI_ONNX_BACKEND: '${{ onnx_backend.key }}'
39-
CI_ONNX_BACKEND_VERSION: '${{ onnx_backend_version }}'
40-
41-
${{ if eq(tf_version, '') }}:
42-
CI_PIP_TF_NAME: 'tensorflow'
43-
${{ if ne(tf_version, '') }}:
44-
CI_PIP_TF_NAME: ${{ format('tensorflow=={0}', tf_version) }}
45-
46-
${{ if eq(onnx_version, '') }}:
47-
CI_PIP_ONNX_NAME: 'onnx'
48-
${{ if ne(onnx_version, '') }}:
49-
CI_PIP_ONNX_NAME: ${{ format('onnx=={0}', onnx_version) }}
50-
51-
${{ if eq(onnx_backend_version, '') }}:
52-
CI_PIP_ONNX_BACKEND_NAME: '${{ onnx_backend.key }}'
53-
${{ if ne(onnx_backend_version, '') }}:
54-
CI_PIP_ONNX_BACKEND_NAME: ${{ format('{0}=={1}', onnx_backend.key, onnx_backend_version) }}
30+
${{ each onnx_backend in parameters.onnx_backends }}:
31+
${{ each onnx_backend_version in onnx_backend.value }}:
32+
${{ each onnx_opset in parameters.onnx_opsets }}:
33+
${{ if ne(onnx_opset, '') }}:
34+
${{ format('{0} python{1} tf{2} onnx{3} opset{4} {5}{6}', platform, python_version, tf_version, onnx_version, onnx_opset, onnx_backend.key, onnx_backend_version) }}:
35+
CI_PYTHON_VERSION: '${{ python_version }}'
36+
CI_TF_VERSION: '${{ tf_version }}'
37+
CI_ONNX_VERSION: '${{ onnx_version }}'
38+
CI_ONNX_OPSET: '${{ onnx_opset }}'
39+
CI_ONNX_BACKEND: '${{ onnx_backend.key }}'
40+
CI_ONNX_BACKEND_VERSION: '${{ onnx_backend_version }}'
41+
42+
${{ if eq(tf_version, '') }}:
43+
CI_PIP_TF_NAME: 'tensorflow'
44+
${{ if ne(tf_version, '') }}:
45+
CI_PIP_TF_NAME: ${{ format('tensorflow=={0}', tf_version) }}
46+
47+
${{ if eq(onnx_version, '') }}:
48+
CI_PIP_ONNX_NAME: 'onnx'
49+
${{ if ne(onnx_version, '') }}:
50+
CI_PIP_ONNX_NAME: ${{ format('onnx=={0}', onnx_version) }}
51+
52+
${{ if eq(onnx_backend_version, '') }}:
53+
CI_PIP_ONNX_BACKEND_NAME: '${{ onnx_backend.key }}'
54+
${{ if ne(onnx_backend_version, '') }}:
55+
CI_PIP_ONNX_BACKEND_NAME: ${{ format('{0}=={1}', onnx_backend.key, onnx_backend_version) }}
56+
57+
${{ if eq(onnx_opset, '') }}:
58+
${{ format('{0} python{1} tf{2} onnx{3} {4}{5}', platform, python_version, tf_version, onnx_version, onnx_backend.key, onnx_backend_version) }}:
59+
CI_PYTHON_VERSION: '${{ python_version }}'
60+
CI_TF_VERSION: '${{ tf_version }}'
61+
CI_ONNX_VERSION: '${{ onnx_version }}'
62+
CI_ONNX_BACKEND: '${{ onnx_backend.key }}'
63+
CI_ONNX_BACKEND_VERSION: '${{ onnx_backend_version }}'
64+
65+
${{ if eq(tf_version, '') }}:
66+
CI_PIP_TF_NAME: 'tensorflow'
67+
${{ if ne(tf_version, '') }}:
68+
CI_PIP_TF_NAME: ${{ format('tensorflow=={0}', tf_version) }}
69+
70+
${{ if eq(onnx_version, '') }}:
71+
CI_PIP_ONNX_NAME: 'onnx'
72+
${{ if ne(onnx_version, '') }}:
73+
CI_PIP_ONNX_NAME: ${{ format('onnx=={0}', onnx_version) }}
74+
75+
${{ if eq(onnx_backend_version, '') }}:
76+
CI_PIP_ONNX_BACKEND_NAME: '${{ onnx_backend.key }}'
77+
${{ if ne(onnx_backend_version, '') }}:
78+
CI_PIP_ONNX_BACKEND_NAME: ${{ format('{0}=={1}', onnx_backend.key, onnx_backend_version) }}
5579

5680
# Insert all properties other than pool/steps/strategy
5781
${{ each pair in parameters.job }}:

ci_build/azure_pipelines/templates/pretrained_model_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ steps:
55
set -x
66
status=0
77
# TODO: fix unity model path
8-
# python tests/run_pretrained_models.py --backend $(CI_ONNX_BACKEND) --opset $(CI_ONNX_OPSET) --config tests/unity.yaml || status=$?
9-
python tests/run_pretrained_models.py --backend $(CI_ONNX_BACKEND) --opset $(CI_ONNX_OPSET) --config tests/run_pretrained_models.yaml || status=$?
8+
# python tests/run_pretrained_models.py --backend $CI_ONNX_BACKEND --opset $CI_ONNX_OPSET --config tests/unity.yaml || status=$?
9+
python tests/run_pretrained_models.py --backend $CI_ONNX_BACKEND --opset $CI_ONNX_OPSET --config tests/run_pretrained_models.yaml || status=$?
1010
exit $status
1111
displayName: 'Test Pre-trained Model'
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# Run unit test
22

3+
parameters:
4+
onnx_opsets: ['9', '8', '7']
5+
36
steps:
4-
- bash: |
5-
export TF2ONNX_TEST_BACKEND=$(CI_ONNX_BACKEND)
6-
export TF2ONNX_TEST_OPSET=$(CI_ONNX_OPSET)
7-
python -m pytest --cov=tf2onnx --cov-report=term --disable-pytest-warnings -r s tests
8-
timeoutInMinutes: 5
9-
displayName: 'Run UnitTest'
7+
- ${{ each onnx_opset in parameters.onnx_opsets }}:
8+
- bash: |
9+
export TF2ONNX_TEST_BACKEND=$CI_ONNX_BACKEND
10+
export TF2ONNX_TEST_OPSET=$CI_ONNX_OPSET
11+
python -m pytest --cov=tf2onnx --cov-report=term --disable-pytest-warnings -r s tests
12+
timeoutInMinutes: 5
13+
displayName: ${{ format('Run UnitTest - Opset{0}', onnx_opset) }}
14+
condition: succeededOrFailed()
15+
env:
16+
CI_ONNX_OPSET: '${{ onnx_opset }}'

ci_build/azure_pipelines/unit_test-matrix.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ jobs:
55
parameters:
66
platforms: ['linux', 'windows', 'mac']
77
tf_versions: ['1.12', '1.11', '1.10', '1.9', '1.8', '1.7', '1.6', '1.5']
8-
onnx_opsets: ['9', '8', '7']
9-
onnx_backends:
10-
onnxruntime: ['0.3.0']
118
job:
129
steps:
1310
- template: 'unit_test.yml'

ci_build/azure_pipelines/unit_test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ jobs:
44
- template: 'templates/job_generator.yml'
55
parameters:
66
tf_versions: ['1.12']
7-
onnx_opsets: ['9', '8', '7']
8-
onnx_backends:
9-
onnxruntime: ['0.3.0']
107
job:
118
steps:
129
- template: 'unit_test.yml'

0 commit comments

Comments
 (0)