Skip to content

Commit

Permalink
Ensure tests get passed on Windows (#25145)
Browse files Browse the repository at this point in the history
Summary:
(1) check error codes after every test command
(2) add missing LibTorch tests mentioned in https://discuss.pytorch.org/t/pre-compiled-tests-failing/54166
Pull Request resolved: pytorch/pytorch#25145

Differential Revision: D17050539

Pulled By: ezyang

fbshipit-source-id: 8a01e5f3c97b181cf2cd7641a545551dcb3627b8
  • Loading branch information
peterjc123 authored and facebook-github-bot committed Aug 26, 2019
1 parent 30bc652 commit c24314b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .jenkins/pytorch/win-test-helpers/test_custom_script_ops.bat
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@ popd

:: Run tests Python-side and export a script module.
python test_custom_ops.py -v
python test_custom_classes.py -v
if ERRORLEVEL 1 exit /b 1

:: TODO: fix and re-enable this test
:: python test_custom_classes.py -v
:: if ERRORLEVEL 1 exit /b 1

python model.py --export-script-module="build/model.pt"
if ERRORLEVEL 1 exit /b 1

:: Run tests C++-side and load the exported script module.
cd build
set PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\bin\x64;%TMP_DIR_WIN%\build\torch\lib;%PATH%
test_custom_ops.exe model.pt
if ERRORLEVEL 1 exit /b 1
15 changes: 15 additions & 0 deletions .jenkins/pytorch/win-test-helpers/test_libtorch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,18 @@ set PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\bin\x64;%TMP_DIR_WIN%\bu
test_api.exe --gtest_filter="-IntegrationTest.MNIST*"

if errorlevel 1 exit /b 1

cd %TMP_DIR_WIN%\build\torch\test
for /r "." %%a in (*.exe) do (
echo Running "%%~fa"
if "%%~na" == "c10_Metaprogramming_test" (
echo Skipping "%%~fa" because it is broken
) else (
if "%%~na" == "module_test" (
echo Skipping "%%~fa" because it is broken
) else (
call "%%~fa"
if errorlevel 1 exit /b 1
)
)
)
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
cd test && python run_test.py --exclude nn --verbose && cd ..
if ERRORLEVEL 1 exit /b 1

0 comments on commit c24314b

Please sign in to comment.