From d9033003d64bb8aa9eb73373bc133fa0070876dc Mon Sep 17 00:00:00 2001 From: Gregory James Comer Date: Tue, 16 Sep 2025 13:19:46 -0700 Subject: [PATCH 1/2] Update [ghstack-poisoned] --- .github/workflows/trunk.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 975a8ebbb30..629c84847f6 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -1016,8 +1016,8 @@ jobs: strategy: fail-fast: false matrix: - model: [linear, add, add_mul, ic3, ic4, mv2, mv3, resnet18, resnet50, vit, w2l, mobilebert, emformer_join, emformer_transcribe] - backend: [portable, xnnpack-f32, xnnpack-q8] + model: [mv3, resnet50, vit, mobilebert, emformer_transcribe] + backend: [portable, xnnpack-q8] with: submodules: 'recursive' ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} From d039beeca0b206bea20eb954f1e300be0c8e96db Mon Sep 17 00:00:00 2001 From: Gregory James Comer Date: Tue, 16 Sep 2025 13:32:15 -0700 Subject: [PATCH 2/2] Update [ghstack-poisoned] --- .ci/scripts/unittest-windows.ps1 | 54 ++++++++++++++++++-------------- .github/workflows/_unittest.yml | 7 ++++- 2 files changed, 36 insertions(+), 25 deletions(-) diff --git a/.ci/scripts/unittest-windows.ps1 b/.ci/scripts/unittest-windows.ps1 index 6f1365bc3fc..a734d2a48f8 100644 --- a/.ci/scripts/unittest-windows.ps1 +++ b/.ci/scripts/unittest-windows.ps1 @@ -1,38 +1,44 @@ param ( - [string]$buildMode = "Release" + [string]$buildMode = "Release", + [bool]$runPythonTests = $true, + [bool]$runNativeTests = $true ) Set-PSDebug -Trace 1 $ErrorActionPreference = 'Stop' $PSNativeCommandUseErrorActionPreference = $true +if ($runNativeTests) { # Run native unit tests (via ctest) -New-Item -Path "test-build" -ItemType Directory -cd "test-build" + New-Item -Path "test-build" -ItemType Directory + cd "test-build" -cmake .. --preset windows -B . -DEXECUTORCH_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=$buildMode -if ($LASTEXITCODE -ne 0) { - Write-Host "CMake configuration was unsuccessful. Exit code: $LASTEXITCODE." - exit $LASTEXITCODE -} + cmake .. --preset windows -B . -DEXECUTORCH_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=$buildMode + if ($LASTEXITCODE -ne 0) { + Write-Host "CMake configuration was unsuccessful. Exit code: $LASTEXITCODE." + exit $LASTEXITCODE + } -cmake --build . -j8 --config $buildMode --verbose -if ($LASTEXITCODE -ne 0) { - Write-Host "CMake build was unsuccessful. Exit code: $LASTEXITCODE." - exit $LASTEXITCODE -} + cmake --build . -j8 --config $buildMode --verbose + if ($LASTEXITCODE -ne 0) { + Write-Host "CMake build was unsuccessful. Exit code: $LASTEXITCODE." + exit $LASTEXITCODE + } -ctest -j8 . --build-config $buildMode --output-on-failure -E "method_test|tensor_parser_test" -if ($LASTEXITCODE -ne 0) { - Write-Host "CTest run was unsuccessful. Exit code: $LASTEXITCODE." - exit $LASTEXITCODE -} + ctest -j8 . --build-config $buildMode --output-on-failure -E "method_test|tensor_parser_test" + if ($LASTEXITCODE -ne 0) { + Write-Host "CTest run was unsuccessful. Exit code: $LASTEXITCODE." + exit $LASTEXITCODE + } -cd .. + cd .. +} +if ($runPythonTests) { # Run pytest -pytest -v -c pytest-windows.ini -if ($LASTEXITCODE -ne 0) { - Write-Host "Pytest invocation was unsuccessful. Exit code: $LASTEXITCODE." - exit $LASTEXITCODE -} \ No newline at end of file + pytest -v -c pytest-windows.ini + if ($LASTEXITCODE -ne 0) { + Write-Host "Pytest invocation was unsuccessful. Exit code: $LASTEXITCODE." + exit $LASTEXITCODE + } +} diff --git a/.github/workflows/_unittest.yml b/.github/workflows/_unittest.yml index 587f2cf5e5a..e60056d0064 100644 --- a/.github/workflows/_unittest.yml +++ b/.github/workflows/_unittest.yml @@ -75,7 +75,12 @@ jobs: exit \$LASTEXITCODE } - .ci/scripts/unittest-windows.ps1 -buildMode "${{ inputs.build-mode }}" + # Skip python tests on unittest-release job, which tests the native tests in release mode. + \$runPythonTests = ("${{ inputs.build-mode }}" -eq "Debug") + # Skip native tests in the editable job, as the native tests are unaffected by editable mode. + \$runNativeTests = ("${{ inputs.editable }}" -eq "false") + + .ci/scripts/unittest-windows.ps1 -buildMode "${{ inputs.build-mode }}" -runPythonTests \$runPythonTests -runNativeTests \$runNativeTests if (\$LASTEXITCODE -ne 0) { Write-Host "Unit tests failed. Exit code: \$LASTEXITCODE." exit \$LASTEXITCODE