Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/scripts/test_model.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function ExportModel-Xnnpack {
[bool]$quantize
)

if $(quantize) {
if ($quantize) {
python -m examples.xnnpack.aot_compiler --model_name="${MODEL_NAME}" --delegate --quantize | Write-Host
$modelFile = "$($modelName)_xnnpack_q8.pte"
} else {
Expand Down
27 changes: 24 additions & 3 deletions .ci/scripts/unittest-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,31 @@ Set-PSDebug -Trace 1
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true

# Run pytest with coverage
# pytest -n auto --cov=./ --cov-report=xml
pytest -v --full-trace -c pytest-windows.ini
# Run pytest
pytest -v pytest-windows.ini
if ($LASTEXITCODE -ne 0) {
Write-Host "Pytest invocation was unsuccessful. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}

# Run native unit tests (via ctest)
New-Item -Path "test-build" -ItemType Directory
cd "test-build"

cmake .. --preset Windows -DCMAKE_BUILD_TESTS=ON
if ($LASTEXITCODE -ne 0) {
Write-Host "CMake configuration was unsuccessful. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}

cmake --build . -j8 --config Release
if ($LASTEXITCODE -ne 0) {
Write-Host "CMake build was unsuccessful. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}

ctest -j8
if ($LASTEXITCODE -ne 0) {
Write-Host "CTest run was unsuccessful. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}
4 changes: 2 additions & 2 deletions .github/workflows/_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
\$ErrorActionPreference = 'Stop'
\$PSNativeCommandUseErrorActionPreference = \$true

.ci/scripts/setup-windows.ps1
.ci/scripts/setup-windows.ps1

powershell .ci/scripts/unittest-windows.ps1 -editable "${{ inputs.editable }}"
.ci/scripts/unittest-windows.ps1 -editable "${{ inputs.editable }}"
}"
8 changes: 4 additions & 4 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -993,13 +993,13 @@ jobs:
timeout: 60
script: |
conda init powershell

powershell -Command "& {
Set-PSDebug -Trace 1
\$ErrorActionPreference = 'Stop'
\$PSNativeCommandUseErrorActionPreference = \$true

.ci/scripts/setup-windows.ps1
.ci/scripts/setup-windows.ps1

powershell .ci/scripts/test_model.ps1 -modelName ${{ matrix.model }} -backend ${{ matrix.backend }}
}"
.ci/scripts/test_model.ps1 -modelName ${{ matrix.model }} -backend ${{ matrix.backend }}
}"
Loading