Skip to content

Commit f36a3fb

Browse files
authored
Adjust CI tests coverage in different pipelines. (#2281)
* Adjust CI tests coverage in different pipelines. * Correct the way of installing tensorflow-text. * Ignore a test in windows because of tensorflow-text issue. Signed-off-by: Jay Zhang <[email protected]> --------- Signed-off-by: Jay Zhang <[email protected]>
1 parent e177a26 commit f36a3fb

File tree

6 files changed

+33
-41
lines changed

6 files changed

+33
-41
lines changed

ci_build/azure_pipelines/pretrained_model_test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
platforms: ['linux', 'windows']
4242
python_versions: ['3.8']
4343
tf_versions: ['2.8.0', '2.13.0']
44-
onnx_opsets: ['14']
44+
onnx_opsets: ['17', '16', '14']
4545
job:
4646
steps:
4747
- template: 'pretrained_model_test.yml'

ci_build/azure_pipelines/pretrained_model_test.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ jobs:
1818
platforms: ['linux']
1919
python_versions: ['3.8']
2020
tf_versions: ['2.8.0', '2.13.0']
21-
onnx_opsets: ['18', '17', '16', '15']
21+
onnx_opsets: ['18', '15']
2222
job:
2323
steps:
2424
- template: 'pretrained_model_test.yml'
25+
26+
- template: 'templates/job_generator.yml'
27+
parameters:
28+
platforms: ['linux']
29+
python_versions: ['3.10']
30+
tf_versions: ['2.13.0']
31+
onnx_opsets: ['18', '15']
32+
job:
33+
steps:
34+
- template: 'pretrained_model_test.yml'

ci_build/azure_pipelines/templates/setup.yml

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ steps:
44
- bash: |
55
set -ex
66
pip install pytest pytest-cov pytest-runner coverage graphviz requests pyyaml pillow pandas parameterized sympy coloredlogs flatbuffers timeout-decorator
7-
pip install $(CI_PIP_TF_NAME)
87
pip install $(CI_PIP_ONNX_NAME)
98
109
# TF < 2.7 reuires numpy <= 1.19, but onnxruntime >= 1.11 requires numpy >= 1.21
@@ -24,41 +23,7 @@ steps:
2423
if [[ $CI_TF_VERSION == 2.* ]] ;
2524
then
2625
pip install onnxruntime-extensions
27-
28-
if [[ $CI_TF_VERSION == 2.3* ]] ;
29-
then
30-
pip install tensorflow-text==${CI_TF_VERSION}
31-
fi
32-
if [[ $CI_TF_VERSION == 2.4* ]] ;
33-
then
34-
pip install tensorflow-text==${CI_TF_VERSION}
35-
fi
36-
if [[ $CI_TF_VERSION == 2.5* ]] ;
37-
then
38-
pip install "tensorflow-text>=2.5,<2.6"
39-
fi
40-
if [[ $CI_TF_VERSION == 2.6* ]] ;
41-
then
42-
pip install "tensorflow-text>=2.6,<2.7"
43-
fi
44-
if [[ $CI_TF_VERSION == 2.7* ]] ;
45-
then
46-
pip install "tensorflow-text>=2.7,<2.8"
47-
fi
48-
if [[ $CI_TF_VERSION == 2.8* ]] ;
49-
then
50-
pip install "tensorflow-text>=2.8,<2.9"
51-
fi
52-
if [[ $CI_TF_VERSION == 2.9* ]] ;
53-
then
54-
pip install "tensorflow-text>=2.9,<2.10"
55-
fi
56-
if [[ $CI_TF_VERSION == 2.10* ]] || [[ $CI_TF_VERSION == 2.11* ]] ;
57-
then
58-
pip install "tensorflow-text>=2.10,<2.14"
59-
else
60-
pip install tensorflow-text
61-
fi
26+
pip install "tensorflow-text<=$(CI_TF_VERSION)"
6227
6328
if [[ $CI_TF_VERSION < 2.8 ]] ;
6429
then
@@ -74,6 +39,8 @@ steps:
7439
pip install -i https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/ ort-nightly
7540
fi
7641
42+
pip uninstall -y tensorflow
43+
pip install $(CI_PIP_TF_NAME)
7744
pip uninstall -y protobuf
7845
pip install "protobuf~=3.20"
7946

ci_build/azure_pipelines/unit_test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ stages:
88
python_versions: ['3.8']
99
platforms: ['linux', 'windows']
1010
tf_versions: ['2.8.0', '2.13.0']
11-
onnx_opsets: ['14']
11+
onnx_opsets: ['17', '16', '14']
1212
skip_tflite_tests: 'False'
1313
skip_tf_tests: 'False'
1414
skip_tfjs_tests: 'True'

ci_build/azure_pipelines/unit_test.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,21 @@ stages:
88
python_versions: ['3.8']
99
platforms: ['linux', 'windows']
1010
tf_versions: ['2.8.0', '2.13.0']
11-
onnx_opsets: ['18', '17', '16', '15']
11+
onnx_opsets: ['18', '15']
12+
skip_tflite_tests: 'False'
13+
skip_tf_tests: 'False'
14+
skip_tfjs_tests: 'True'
15+
job:
16+
steps:
17+
- template: 'unit_test.yml'
18+
report_coverage: 'True'
19+
20+
- template: 'templates/job_generator.yml'
21+
parameters:
22+
python_versions: ['3.10']
23+
platforms: ['linux']
24+
tf_versions: ['2.13.0']
25+
onnx_opsets: ['18', '15']
1226
skip_tflite_tests: 'False'
1327
skip_tf_tests: 'False'
1428
skip_tfjs_tests: 'True'

tests/test_string_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import tensorflow as tf
99

1010
from backend_test_base import Tf2OnnxBackendTestBase
11-
from common import requires_custom_ops, check_tf_min_version, check_opset_min_version
11+
from common import requires_custom_ops, check_tf_min_version, check_opset_min_version, get_test_config
1212
from tf2onnx import utils
1313
from tf2onnx import constants
1414

@@ -118,6 +118,7 @@ def func(x1, x2):
118118
return tf.identity(mi, name=_TFOUTPUT)
119119
self._run_test_case(func, [_OUTPUT], {_INPUT: x_val1, _INPUT1: x_val2})
120120

121+
@unittest.skipIf(get_test_config().is_windows, "tensorflow-text lacks versions in windows.")
121122
@requires_custom_ops("RegexSplitWithOffsets")
122123
@check_tf_min_version("2.3", "tensorflow_text")
123124
def test_regex_split_with_offsets(self):

0 commit comments

Comments
 (0)