Skip to content

Commit be835ef

Browse files
authored
Fix python test issues for the 1.23.0 release (microsoft#26118)
### Description 1. Fixes Python Wheel Installation Path: In the Linux smoking test (py-package-smoking-test-linux.yml), the pip install command was corrected to use --find-links . to locate the wheel in the correct directory. This resolves an issue where the installation script was looking in the wrong location. 2. Expands python package test pipeline's macOS Test Matrix: A new parameterized template (py-package-smoking-test-macos.yml) is introduced to test macOS wheels. The main pipeline (py-package-test-pipeline.yml) now uses this template to create a comprehensive test matrix, covering Python versions 3.10, 3.11, 3.12, and 3.13 across macOS versions 13, 14, and 15. 3. Enable more tests in Nuget Test Pipeline. The pipeline is for testing packaged ONNX Runtime nuget packages. In the Windows NuGet test template (test_win.yml), a step has been added to download and place the custom_op_library.dll in the appropriate test directory. This ensures the custom op tests can find their required dependencies. The SKIPNONPACKAGETESTS flag has been removed to ensure all such tests are run. ### Motivation and Context Improve packaging tests.
1 parent 2a034d5 commit be835ef

File tree

4 files changed

+100
-11
lines changed

4 files changed

+100
-11
lines changed

tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ stages:
2727
variables:
2828
- name: OnnxRuntimeBuildDirectory
2929
value: '$(Build.BinariesDirectory)'
30-
- name: SKIPNONPACKAGETESTS
31-
value: 'ON'
3230
- name: runCodesignValidationInjection
3331
value: false
3432
- name: CUDA_MODULE_LOADINGL
@@ -69,14 +67,22 @@ stages:
6967
- download: build
7068
displayName: 'Download Nuget'
7169
artifact: 'drop-signed-nuget-${{ parameters.ArtifactSuffix }}'
70+
71+
- download: build
72+
displayName: 'Download CustomOp DLL'
73+
artifact: 'onnxruntime-win-x64'
74+
patterns: "testdata/custom_op_library.dll"
7275

7376

7477
- template: get-nuget-package-version-as-variable.yml
7578
parameters:
7679
packageFolder: '$(Pipeline.Workspace)/build/drop-signed-nuget-${{ parameters.ArtifactSuffix }}'
7780

7881
- script: |
79-
mklink /D /J models C:\local\models
82+
mklink /D /J models C:\local\models
83+
mkdir $(Build.BinariesDirectory)\Debug\Debug
84+
dir $(Pipeline.Workspace)\build\onnxruntime-win-x64
85+
copy $(Pipeline.Workspace)\build\onnxruntime-win-x64\testdata\custom_op_library.dll $(Build.BinariesDirectory)\Debug\Debug
8086
workingDirectory: '$(Build.BinariesDirectory)'
8187
displayName: 'Create models link'
8288

tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,56 @@ stages:
2525
- stage: Packages_Somking_Test
2626
dependsOn: []
2727
jobs:
28-
- template: templates/py-package-smoking-test.yml
28+
- template: templates/py-package-smoking-test-macos.yml
2929
parameters:
30-
job_name: Test_MAC_Wheels
31-
machine_pool:
32-
vmImage: 'macOS-14'
33-
itemPattern: '*/*mac*x86_64.whl'
34-
arch: 'x86_64'
35-
- template: templates/py-package-smoking-test.yml
30+
python_version: 3.10
31+
os_version: 14
32+
- template: templates/py-package-smoking-test-macos.yml
33+
parameters:
34+
python_version: 3.11
35+
os_version: 14
36+
- template: templates/py-package-smoking-test-macos.yml
37+
parameters:
38+
python_version: 3.12
39+
os_version: 14
40+
- template: templates/py-package-smoking-test-macos.yml
41+
parameters:
42+
python_version: 3.13
43+
os_version: 14
44+
- template: templates/py-package-smoking-test-macos.yml
45+
parameters:
46+
python_version: 3.10
47+
os_version: 13
48+
- template: templates/py-package-smoking-test-macos.yml
49+
parameters:
50+
python_version: 3.11
51+
os_version: 13
52+
- template: templates/py-package-smoking-test-macos.yml
53+
parameters:
54+
python_version: 3.12
55+
os_version: 13
56+
- template: templates/py-package-smoking-test-macos.yml
57+
parameters:
58+
python_version: 3.13
59+
os_version: 13
60+
- template: templates/py-package-smoking-test-macos.yml
61+
parameters:
62+
python_version: 3.10
63+
os_version: 15
64+
- template: templates/py-package-smoking-test-macos.yml
65+
parameters:
66+
python_version: 3.11
67+
os_version: 15
68+
- template: templates/py-package-smoking-test-macos.yml
69+
parameters:
70+
python_version: 3.12
71+
os_version: 15
72+
- template: templates/py-package-smoking-test-macos.yml
73+
parameters:
74+
python_version: 3.13
75+
os_version: 15
76+
77+
- template: templates/py-package-smoking-test-linux.yml
3678
parameters:
3779
job_name: Test_LINUX_x86_64_Wheels
3880
itemPattern: '*/*manylinux*x86_64.whl'

tools/ci_build/github/azure-pipelines/templates/py-package-smoking-test.yml renamed to tools/ci_build/github/azure-pipelines/templates/py-package-smoking-test-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
FILE_NAME=$(basename $FILE_NAME)
5656
PYTHON_PACKAGE_NAME=$(echo "$FILE_NAME" | cut -f 1 -d '-')
5757
python3 -m pip install coloredlogs flatbuffers numpy packaging protobuf sympy
58-
python3 -m pip install --no-index --find-links "$(Pipeline.Workspace)/build $PYTHON_PACKAGE_NAME
58+
python3 -m pip install --no-index --find-links . $PYTHON_PACKAGE_NAME
5959
python3 -m pip show $PYTHON_PACKAGE_NAME
6060
python3 -c "import onnxruntime as ort; print(ort.__version__)"
6161
workingDirectory: $(Pipeline.Workspace)/build/onnxruntime-${{ parameters.arch }}-${{ parameters.ep }}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
parameters:
2+
- name: python_version
3+
type: string
4+
5+
- name: os_version
6+
type: string
7+
8+
jobs:
9+
- job: Test_MAC_Wheels_${{ parameters.os_version }}_${{ replace(parameters.python_version,'.','_') }}
10+
timeoutInMinutes: 30
11+
workspace:
12+
clean: all
13+
pool:
14+
vmImage: 'macOS-${{ parameters.os_version }}'
15+
steps:
16+
- checkout: none
17+
18+
- task: UsePythonVersion@0
19+
displayName: 'Use Python'
20+
inputs:
21+
versionSpec: ${{ parameters.python_version }}
22+
23+
- download: build # pipeline resource identifier.
24+
artifact: onnxruntime-macos-x86_64_${{ replace(parameters.python_version,'.','_') }}
25+
26+
- task: Bash@3
27+
inputs:
28+
targetType: 'inline'
29+
script: |
30+
set -ex
31+
files=(*.whl)
32+
FILE_NAME="${files[0]}"
33+
FILE_NAME=$(basename $FILE_NAME)
34+
PYTHON_PACKAGE_NAME=$(echo "$FILE_NAME" | cut -f 1 -d '-')
35+
python3 -m pip install coloredlogs flatbuffers numpy packaging protobuf sympy
36+
python3 -m pip install --no-index --find-links . $PYTHON_PACKAGE_NAME
37+
python3 -m pip show $PYTHON_PACKAGE_NAME
38+
python3 -c "import onnxruntime as ort; print(ort.__version__)"
39+
workingDirectory: $(Pipeline.Workspace)/build/onnxruntime-macos-x86_64_${{ replace(parameters.python_version,'.','_') }}
40+
displayName: Test Package Installation
41+

0 commit comments

Comments
 (0)