From fe4b33aae5ebf5f201b6841495876591279509f6 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Fri, 21 Sep 2018 13:27:00 +0200 Subject: [PATCH] Rework test_delivery_* scripts (#855) Verify python wheel packages are working --- .gitignore | 1 + tools/release/build_delivery_win.cmd | 184 ++++++++++++++++++++------- tools/release/test_delivery_mac.sh | 90 +++++++++---- tools/release/test_delivery_unix.sh | 90 +++++++++---- tools/release/test_delivery_win.cmd | 159 +++++++++++++++++++++++ 5 files changed, 427 insertions(+), 97 deletions(-) create mode 100755 tools/release/test_delivery_win.cmd diff --git a/.gitignore b/.gitignore index fb2a731005..1dd421a41a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ or-tools*.zip *.swp build.log +test.log bin/ ortools/gen/ objs/ diff --git a/tools/release/build_delivery_win.cmd b/tools/release/build_delivery_win.cmd index 0bd30b9210..a921b66431 100644 --- a/tools/release/build_delivery_win.cmd +++ b/tools/release/build_delivery_win.cmd @@ -26,36 +26,35 @@ REM .Net which.exe dotnet || exit 1 which.exe dotnet | tee.exe -a build.log -REM Build Third Party +REM ################### +REM ## THIRD PARTY ## +REM ################### make.exe clean_third_party || exit 1 make.exe third_party WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 echo make third_party: DONE | tee.exe -a build.log -REM Building OR-Tools +REM #################### +REM ## CC/JAVA/.Net ## +REM #################### make.exe clean || exit 1 make.exe cc WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 echo make cc: DONE | tee.exe -a build.log -make.exe test_cc WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -echo make test_cc: DONE | tee.exe -a build.log - -make.exe python WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -echo make python2.7: DONE | tee.exe -a build.log -make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -echo make test_python2.7: DONE | tee.exe -a build.log - -make.exe java WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -echo make java: DONE | tee.exe -a build.log -make.exe test_java WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -echo make test_java: DONE | tee.exe -a build.log - -make.exe dotnet WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -echo make dotnet: DONE | tee.exe -a build.log -make.exe test_dotnet WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -echo make test_dotnet: DONE | tee.exe -a build.log +REM make.exe test_cc WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 +REM echo make test_cc: DONE | tee.exe -a build.log make.exe fz WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 echo make fz: DONE | tee.exe -a build.log +make.exe java WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 +echo make java: DONE | tee.exe -a build.log +REM make.exe test_java WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 +REM echo make test_java: DONE | tee.exe -a build.log + +make.exe dotnet WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 +echo make dotnet: DONE | tee.exe -a build.log +REM make.exe test_dotnet WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 +REM echo make test_dotnet: DONE | tee.exe -a build.log + REM Create Archive rm.exe -rf temp *.zip || exit 1 make.exe archive WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 @@ -69,39 +68,130 @@ echo make test_fz_archive: DONE | tee.exe -a build.log make.exe python_examples_archive WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 echo make python_examples_archive: DONE | tee.exe -a build.log +REM ################## +REM ## PYTHON 2.7 ## +REM ################## +echo Cleaning Python... | tee.exe -a test.log +make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python27-64 +echo Cleaning Python...DONE | tee.exe -a test.log -REM Rebuilding for Python 2.7... -make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -make.exe python WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -echo make python2.7: DONE | tee.exe -a build.log -make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -echo make test_python2.7: DONE | tee.exe -a build.log +REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 +REM echo make python2.7: DONE | tee.exe -a build.log +REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 +REM echo make test_python2.7: DONE | tee.exe -a build.log +echo Rebuild Python2.7 pypi archive... | tee.exe -a test.log make.exe pypi_archive WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 -echo make pypi_archive2.7: DONE | tee.exe -a build.log +echo Rebuild Python2.7 pypi archive...DONE | tee.exe -a test.log -REM Rebuilding for Python 3.5... -make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python35-64 || exit 1 -make.exe python WINDOWS_PATH_TO_PYTHON=c:\python35-64 || exit 1 -echo make python3.5: DONE | tee.exe -a build.log -make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python35-64 || exit 1 -echo make test_python3.5: DONE | tee.exe -a build.log +echo Creating Python2.7 venv... | tee.exe -a test.log +set PATH=c:\python27-64;c:\python27-64\Scripts;%PATH% +python -m pip install virtualenv +set TEMP_DIR=temp-python27 +python -m virtualenv %TEMP_DIR%\venv +set PATH=%LOCAL_PATH% +echo Creating Python2.7 venv...DONE | tee.exe -a test.log + +echo Installing ortools Python2.7 venv... | tee.exe -a test.log +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO %TEMP_DIR%\venv\Scripts\python -m pip install %%i +echo Installing ortools Python2.7 venv...DONE | tee.exe -a test.log + +echo Testing ortools Python2.7... | tee.exe -a test.log +copy test.py.in %TEMP_DIR%\venv\test.py +%TEMP_DIR%\venv\Scripts\python %TEMP_DIR%\venv\test.py 2>&1 | tee.exe -a test.log +echo Testing ortools Python2.7...DONE | tee.exe -a test.log + +REM ################## +REM ## PYTHON 3.5 ## +REM ################## +echo Cleaning Python... | tee.exe -a test.log +make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python35-64 +echo Cleaning Python...DONE | tee.exe -a test.log + +REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python35-64 || exit 1 +REM echo make python3.5: DONE | tee.exe -a build.log +REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python35-64 || exit 1 +REM echo make test_python3.5: DONE | tee.exe -a build.log +echo Rebuild Python3.5 pypi archive... | tee.exe -a test.log make.exe pypi_archive WINDOWS_PATH_TO_PYTHON=c:\python35-64 || exit 1 -echo make pypi_archive3.5: DONE | tee.exe -a build.log +echo Rebuild Python3.5 pypi archive...DONE | tee.exe -a test.log -REM Rebuilding for Python 3.6... -make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1 -make.exe python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1 -echo make python3.6: DONE | tee.exe -a build.log -make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1 -echo make test_python3.6: DONE | tee.exe -a build.log +echo Creating Python3.5 venv... | tee.exe -a test.log +set PATH=c:\python35-64;c:\python35-64\Scripts;%PATH% +python -m pip install virtualenv +set TEMP_DIR=temp-python35 +python -m virtualenv %TEMP_DIR%\venv +set PATH=%LOCAL_PATH% +echo Creating Python3.5 venv...DONE | tee.exe -a test.log + +echo Installing ortools Python3.5 venv... | tee.exe -a test.log +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO %TEMP_DIR%\venv\Scripts\python -m pip install %%i +echo Installing ortools Python3.5 venv...DONE | tee.exe -a test.log + +echo Testing ortools Python3.5... | tee.exe -a test.log +copy test.py.in %TEMP_DIR%\venv\test.py +%TEMP_DIR%\venv\Scripts\python %TEMP_DIR%\venv\test.py 2>&1 | tee.exe -a test.log +echo Testing ortools Python3.5...DONE | tee.exe -a test.log + +REM ################## +REM ## PYTHON 3.6 ## +REM ################## +echo Cleaning Python... | tee.exe -a test.log +make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python36-64 +echo Cleaning Python...DONE | tee.exe -a test.log + +REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1 +REM echo make python3.6: DONE | tee.exe -a build.log +REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1 +REM echo make test_python3.6: DONE | tee.exe -a build.log +echo Rebuild Python3.6 pypi archive... | tee.exe -a test.log make.exe pypi_archive WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1 -echo make pypi_archive3.6: DONE | tee.exe -a build.log +echo Rebuild Python3.6 pypi archive...DONE | tee.exe -a test.log -REM Rebuilding for Python 3.7... -make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1 -make.exe python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1 -echo make python3.7: DONE | tee.exe -a build.log -make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1 -echo make test_python3.7: DONE | tee.exe -a build.log +echo Creating Python3.6 venv... | tee.exe -a test.log +set PATH=c:\python36-64;c:\python36-64\Scripts;%PATH% +python -m pip install virtualenv +set TEMP_DIR=temp-python36 +python -m virtualenv %TEMP_DIR%\venv +set PATH=%LOCAL_PATH% +echo Creating Python3.6 venv...DONE | tee.exe -a test.log + +echo Installing ortools Python3.6 venv... | tee.exe -a test.log +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO %TEMP_DIR%\venv\Scripts\python -m pip install %%i +echo Installing ortools Python3.6 venv...DONE | tee.exe -a test.log + +echo Testing ortools Python3.6... | tee.exe -a test.log +copy test.py.in %TEMP_DIR%\venv\test.py +%TEMP_DIR%\venv\Scripts\python %TEMP_DIR%\venv\test.py 2>&1 | tee.exe -a test.log +echo Testing ortools Python3.6...DONE | tee.exe -a test.log + +REM ################## +REM ## PYTHON 3.7 ## +REM ################## +echo Cleaning Python... | tee.exe -a test.log +make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python37-64 +echo Cleaning Python...DONE | tee.exe -a test.log + +REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1 +REM echo make python3.7: DONE | tee.exe -a build.log +REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1 +REM echo make test_python3.7: DONE | tee.exe -a build.log +echo Rebuild Python3.7 pypi archive... | tee.exe -a test.log make.exe pypi_archive WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1 -echo make pypi_archive3.7: DONE | tee.exe -a build.log +echo Rebuild Python3.7 pypi archive...DONE | tee.exe -a test.log + +echo Creating Python3.7 venv... | tee.exe -a test.log +set PATH=c:\python37-64;c:\python37-64\Scripts;%PATH% +python -m pip install virtualenv +set TEMP_DIR=temp-python37 +python -m virtualenv %TEMP_DIR%\venv +set PATH=%LOCAL_PATH% +echo Creating Python3.7 venv...DONE | tee.exe -a test.log + +echo Installing ortools Python3.7 venv... | tee.exe -a test.log +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO %TEMP_DIR%\venv\Scripts\python -m pip install %%i +echo Installing ortools Python3.7 venv...DONE | tee.exe -a test.log + +echo Testing ortools Python3.7... | tee.exe -a test.log +copy test.py.in %TEMP_DIR%\venv\test.py +%TEMP_DIR%\venv\Scripts\python %TEMP_DIR%\venv\test.py 2>&1 | tee.exe -a test.log +echo Testing ortools Python3.7...DONE | tee.exe -a test.log diff --git a/tools/release/test_delivery_mac.sh b/tools/release/test_delivery_mac.sh index 32e0773805..932dc6fb91 100755 --- a/tools/release/test_delivery_mac.sh +++ b/tools/release/test_delivery_mac.sh @@ -4,37 +4,77 @@ set -e # Check all prerequisite # cc -command -v cmake | xargs echo "cmake: " | tee build.log -command -v make | xargs echo "make: " | tee -a build.log -command -v swig | xargs echo "swig: " | tee -a build.log +command -v cmake | xargs echo "cmake: " | tee test.log +command -v make | xargs echo "make: " | tee -a test.log +command -v swig | xargs echo "swig: " | tee -a test.log # python -command -v python2.7 | xargs echo "python2.7: " | tee -a build.log -command -v python3.7 | xargs echo "python3.7: " | tee -a build.log +command -v python2.7 | xargs echo "python2.7: " | tee -a test.log +command -v python3.7 | xargs echo "python3.7: " | tee -a test.log -echo Creating Python 2.7 venv... -TEMP_DIR=temp_python2.7 +################## +## PYTHON 2.7 ## +################## +echo Cleaning Python... | tee -a test.log +make clean_python +echo Cleaning Python...DONE | tee -a test.log + +echo Rebuild Python2.7 pypi archive... | tee -a test.log +make pypi_archive UNIX_PYTHON_VER=2.7 +echo Rebuild Python2.7 pypi archive...DONE | tee -a test.log + +echo Creating Python2.7 venv... | tee -a test.log +TEMP_DIR=temp-python2.7 VENV_DIR=${TEMP_DIR}/venv python2.7 -m pip install --user virtualenv -python2.7 -m virtualenv -p python2.7 ${VENV_DIR} -# Bug: setup.py must be run in this directory ! -(cd ${TEMP_DIR}/ortools && ../venv/bin/python setup.py install) -cp test.py.in ${TEMP_DIR}/venv/test.py -echo Creating Python 2.7 venv...DONE +python2.7 -m virtualenv ${VENV_DIR} +echo Creating Python2.7 venv...DONE | tee -a test.log -echo Creating Python 3.7 venv... -TEMP_DIR=temp_python3.7 +echo Installing ortools Python2.7 venv... | tee -a test.log +${VENV_DIR}/bin/python -m pip install ${TEMP_DIR}/ortools/dist/*.whl +echo Installing ortools Python2.7 venv...DONE | tee -a test.log + +set +e +echo Testing ortools Python2.7... | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.linear_solver import pywraplp") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.constraint_solver import pywrapcp") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.sat import pywrapsat") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.graph import pywrapgraph") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.algorithms import pywrapknapsack_solver") 2>&1 | tee -a test.log +cp test.py.in ${VENV_DIR}/test.py +${VENV_DIR}/bin/python ${VENV_DIR}/test.py 2>&1 | tee -a test.log +echo Testing ortools Python2.7...DONE | tee -a test.log +set -e + +################## +## PYTHON 3.7 ## +################## +echo Cleaning Python... | tee -a test.log +make clean_python +echo Cleaning Python...DONE | tee -a test.log + +echo Rebuild Python3.7 pypi archive... | tee -a test.log +make pypi_archive UNIX_PYTHON_VER=3.7 +echo Rebuild Python3.7 pypi archive...DONE | tee -a test.log + +echo Creating Python3.7 venv... | tee -a test.log +TEMP_DIR=temp-python3.7 VENV_DIR=${TEMP_DIR}/venv python3.7 -m pip install --user virtualenv -python3.7 -m virtualenv -p python3.7 ${VENV_DIR} -# Bug: setup.py must be run in this directory ! -(cd ${TEMP_DIR}/ortools && ../venv/bin/python setup.py install) -cp test.py.in ${TEMP_DIR}/venv/test.py -echo Creating Python 3.7 venv...DONE +python3.7 -m virtualenv ${VENV_DIR} +echo Creating Python3.7 venv...DONE | tee -a test.log -# To be sure to have sandboxed library (i.e. @loader_path) -make clean_cc +echo Installing ortools Python3.7 venv... | tee -a test.log +${VENV_DIR}/bin/python -m pip install ${TEMP_DIR}/ortools/dist/*.whl +echo Installing ortools Python3.7 venv...DONE | tee -a test.log -echo Testing in virtualenv... -temp_python2.7/venv/bin/python temp_python2.7/venv/test.py -temp_python3.7/venv/bin/python temp_python3.7/venv/test.py -echo Testing in virtualenv...DONE +set +e +echo Testing ortools Python3.7... | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.linear_solver import pywraplp") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.constraint_solver import pywrapcp") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.sat import pywrapsat") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.graph import pywrapgraph") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.algorithms import pywrapknapsack_solver") 2>&1 | tee -a test.log +cp test.py.in ${VENV_DIR}/test.py +${VENV_DIR}/bin/python ${VENV_DIR}/test.py 2>&1 | tee -a test.log +echo Testing ortools Python3.7...DONE | tee -a test.log +set -e diff --git a/tools/release/test_delivery_unix.sh b/tools/release/test_delivery_unix.sh index 8802277475..9eae59b706 100755 --- a/tools/release/test_delivery_unix.sh +++ b/tools/release/test_delivery_unix.sh @@ -4,37 +4,77 @@ set -e # Check all prerequisite # cc -command -v cmake | xargs echo "cmake: " | tee build.log -command -v make | xargs echo "make: " | tee -a build.log -command -v swig | xargs echo "swig: " | tee -a build.log +command -v cmake | xargs echo "cmake: " | tee test.log +command -v make | xargs echo "make: " | tee -a test.log +command -v swig | xargs echo "swig: " | tee -a test.log # python -command -v python2 | xargs echo "python2: " | tee -a build.log -command -v python3 | xargs echo "python3: " | tee -a build.log +command -v python2 | xargs echo "python2: " | tee -a test.log +command -v python3 | xargs echo "python3: " | tee -a test.log -echo Creating Python 2 venv... -TEMP_DIR=temp_python2 +################## +## PYTHON 2.7 ## +################## +echo Cleaning Python... | tee -a test.log +make clean_python +echo Cleaning Python...DONE | tee -a test.log + +echo Rebuild Python2.7 pypi archive... | tee -a test.log +make pypi_archive UNIX_PYTHON_VER=2.7 +echo Rebuild Python2.7 pypi archive...DONE | tee -a test.log + +echo Creating Python2.7 venv... | tee -a test.log +TEMP_DIR=temp-python2.7 VENV_DIR=${TEMP_DIR}/venv python2 -m pip install --user virtualenv -python2 -m virtualenv -p python2 ${VENV_DIR} -# Bug: setup.py must be run in this directory ! -(cd ${TEMP_DIR}/ortools && ../venv/bin/python setup.py install) -cp test.py.in ${TEMP_DIR}/venv/test.py -echo Creating Python 2 venv...DONE +python2 -m virtualenv ${VENV_DIR} +echo Creating Python2.7 venv...DONE | tee -a test.log -echo Creating Python 3 venv... -TEMP_DIR=temp_python3 +echo Installing ortools Python2.7 venv... | tee -a test.log +${VENV_DIR}/bin/python -m pip install ${TEMP_DIR}/ortools/dist/*.whl +echo Installing ortools Python2.7 venv...DONE | tee -a test.log + +set +e +echo Testing ortools Python2.7... | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.linear_solver import pywraplp") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.constraint_solver import pywrapcp") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.sat import pywrapsat") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.graph import pywrapgraph") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.algorithms import pywrapknapsack_solver") 2>&1 | tee -a test.log +cp test.py.in ${VENV_DIR}/test.py +${VENV_DIR}/bin/python ${VENV_DIR}/test.py 2>&1 | tee -a test.log +echo Testing ortools Python2.7...DONE | tee -a test.log +set -e + +################## +## PYTHON 3.5 ## +################## +echo Cleaning Python... | tee -a test.log +make clean_python +echo Cleaning Python...DONE | tee -a test.log + +echo Rebuild Python3.5 pypi archive... | tee -a test.log +make pypi_archive UNIX_PYTHON_VER=3.5 +echo Rebuild Python3.5 pypi archive...DONE | tee -a test.log + +echo Creating Python3.5 venv... | tee -a test.log +TEMP_DIR=temp-python3.5 VENV_DIR=${TEMP_DIR}/venv python3 -m pip install --user virtualenv -python3 -m virtualenv -p python3 ${VENV_DIR} -# Bug: setup.py must be run in this directory ! -(cd ${TEMP_DIR}/ortools && ../venv/bin/python setup.py install) -cp test.py.in ${TEMP_DIR}/venv/test.py -echo Creating Python 3 venv...DONE +python3 -m virtualenv ${VENV_DIR} +echo Creating Python3.5 venv...DONE | tee -a test.log -# To be sure to have sandboxed library (i.e. @loader_path) -make clean_cc +echo Installing ortools Python3.5 venv... | tee -a test.log +${VENV_DIR}/bin/python -m pip install ${TEMP_DIR}/ortools/dist/*.whl +echo Installing ortools Python3.5 venv...DONE | tee -a test.log -echo Testing in virtualenv... -temp_python2/venv/bin/python temp_python2/venv/test.py -temp_python3/venv/bin/python temp_python3/venv/test.py -echo Testing in virtualenv...DONE +set +e +echo Testing ortools Python3.5... | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.linear_solver import pywraplp") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.constraint_solver import pywrapcp") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.sat import pywrapsat") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.graph import pywrapgraph") 2>&1 | tee -a test.log +(cd ${VENV_DIR}/bin && ./python -c "from ortools.algorithms import pywrapknapsack_solver") 2>&1 | tee -a test.log +cp test.py.in ${VENV_DIR}/test.py +${VENV_DIR}/bin/python ${VENV_DIR}/test.py 2>&1 | tee -a test.log +echo Testing ortools Python3.5...DONE | tee -a test.log +set -e diff --git a/tools/release/test_delivery_win.cmd b/tools/release/test_delivery_win.cmd new file mode 100755 index 0000000000..11f70e9942 --- /dev/null +++ b/tools/release/test_delivery_win.cmd @@ -0,0 +1,159 @@ +@echo off +REM /!\ THIS SCRIPT SUPPOSE A FIXED PATH FOR PYTHON /!\ +REM Each blocks could be triggered independently (i.e. commenting others) +REM run it as: cmd /c tools\release\test_delivery_win.cmd + +REM Check all prerequisite +REM C++ +set PATH=%PATH%;tools;tools\win +make.exe print-OR_TOOLS_VERSION | tee.exe test.log + +which.exe cmake || exit 1 +which.exe cmake | tee.exe -a test.log +REM Python +which.exe C:\python27-64\python.exe || exit 1 +echo C:\python27-64\python.exe: FOUND | tee.exe -a test.log +which.exe C:\python35-64\python.exe || exit 1 +echo C:\python35-64\python.exe: FOUND | tee.exe -a test.log +which.exe C:\python36-64\python.exe || exit 1 +echo C:\python36-64\python.exe: FOUND | tee.exe -a test.log +which.exe C:\python37-64\python.exe || exit 1 +echo C:\python37-64\python.exe: FOUND | tee.exe -a test.log + +set LOCAL_PATH=%PATH% + +REM ################## +REM ## PYTHON 2.7 ## +REM ################## +echo Cleaning Python... | tee.exe -a test.log +make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python27-64 +echo Cleaning Python...DONE | tee.exe -a test.log + +REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 +REM echo make python2.7: DONE | tee.exe -a build.log +REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 +REM echo make test_python2.7: DONE | tee.exe -a build.log +echo Rebuild Python2.7 pypi archive... | tee.exe -a test.log +make.exe pypi_archive WINDOWS_PATH_TO_PYTHON=c:\python27-64 || exit 1 +echo Rebuild Python2.7 pypi archive...DONE | tee.exe -a test.log + +echo Creating Python2.7 venv... | tee.exe -a test.log +set PATH=c:\python27-64;c:\python27-64\Scripts;%PATH% +python -m pip install virtualenv +set TEMP_DIR=temp-python27 +python -m virtualenv %TEMP_DIR%\venv +set PATH=%LOCAL_PATH% +echo Creating Python2.7 venv...DONE | tee.exe -a test.log + +echo Installing ortools Python2.7 venv... | tee.exe -a test.log +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO %TEMP_DIR%\venv\Scripts\python -m pip install %%i +echo Installing ortools Python2.7 venv...DONE | tee.exe -a test.log + +echo Testing ortools Python2.7... | tee.exe -a test.log +copy test.py.in %TEMP_DIR%\venv\test.py +%TEMP_DIR%\venv\Scripts\python %TEMP_DIR%\venv\test.py 2>&1 | tee.exe -a test.log +echo Testing ortools Python2.7...DONE | tee.exe -a test.log + +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO copy %%i . + +REM ################## +REM ## PYTHON 3.5 ## +REM ################## +echo Cleaning Python... | tee.exe -a test.log +make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python35-64 +echo Cleaning Python...DONE | tee.exe -a test.log + +REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python35-64 || exit 1 +REM echo make python3.5: DONE | tee.exe -a build.log +REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python35-64 || exit 1 +REM echo make test_python3.5: DONE | tee.exe -a build.log +echo Rebuild Python3.5 pypi archive... | tee.exe -a test.log +make.exe pypi_archive WINDOWS_PATH_TO_PYTHON=c:\python35-64 || exit 1 +echo Rebuild Python3.5 pypi archive...DONE | tee.exe -a test.log + +echo Creating Python3.5 venv... | tee.exe -a test.log +set PATH=c:\python35-64;c:\python35-64\Scripts;%PATH% +python -m pip install virtualenv +set TEMP_DIR=temp-python35 +python -m virtualenv %TEMP_DIR%\venv +set PATH=%LOCAL_PATH% +echo Creating Python3.5 venv...DONE | tee.exe -a test.log + +echo Installing ortools Python3.5 venv... | tee.exe -a test.log +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO %TEMP_DIR%\venv\Scripts\python -m pip install %%i +echo Installing ortools Python3.5 venv...DONE | tee.exe -a test.log + +echo Testing ortools Python3.5... | tee.exe -a test.log +copy test.py.in %TEMP_DIR%\venv\test.py +%TEMP_DIR%\venv\Scripts\python %TEMP_DIR%\venv\test.py 2>&1 | tee.exe -a test.log +echo Testing ortools Python3.5...DONE | tee.exe -a test.log + +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO copy %%i . + +REM ################## +REM ## PYTHON 3.6 ## +REM ################## +echo Cleaning Python... | tee.exe -a test.log +make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python36-64 +echo Cleaning Python...DONE | tee.exe -a test.log + +REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1 +REM echo make python3.6: DONE | tee.exe -a build.log +REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1 +REM echo make test_python3.6: DONE | tee.exe -a build.log +echo Rebuild Python3.6 pypi archive... | tee.exe -a test.log +make.exe pypi_archive WINDOWS_PATH_TO_PYTHON=c:\python36-64 || exit 1 +echo Rebuild Python3.6 pypi archive...DONE | tee.exe -a test.log + +echo Creating Python3.6 venv... | tee.exe -a test.log +set PATH=c:\python36-64;c:\python36-64\Scripts;%PATH% +python -m pip install virtualenv +set TEMP_DIR=temp-python36 +python -m virtualenv %TEMP_DIR%\venv +set PATH=%LOCAL_PATH% +echo Creating Python3.6 venv...DONE | tee.exe -a test.log + +echo Installing ortools Python3.6 venv... | tee.exe -a test.log +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO %TEMP_DIR%\venv\Scripts\python -m pip install %%i +echo Installing ortools Python3.6 venv...DONE | tee.exe -a test.log + +echo Testing ortools Python3.6... | tee.exe -a test.log +copy test.py.in %TEMP_DIR%\venv\test.py +%TEMP_DIR%\venv\Scripts\python %TEMP_DIR%\venv\test.py 2>&1 | tee.exe -a test.log +echo Testing ortools Python3.6...DONE | tee.exe -a test.log + +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO copy %%i . + +REM ################## +REM ## PYTHON 3.7 ## +REM ################## +echo Cleaning Python... | tee.exe -a test.log +make.exe clean_python WINDOWS_PATH_TO_PYTHON=c:\python37-64 +echo Cleaning Python...DONE | tee.exe -a test.log + +REM make.exe python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1 +REM echo make python3.7: DONE | tee.exe -a build.log +REM make.exe test_python WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1 +REM echo make test_python3.7: DONE | tee.exe -a build.log +echo Rebuild Python3.7 pypi archive... | tee.exe -a test.log +make.exe pypi_archive WINDOWS_PATH_TO_PYTHON=c:\python37-64 || exit 1 +echo Rebuild Python3.7 pypi archive...DONE | tee.exe -a test.log + +echo Creating Python3.7 venv... | tee.exe -a test.log +set PATH=c:\python37-64;c:\python37-64\Scripts;%PATH% +python -m pip install virtualenv +set TEMP_DIR=temp-python37 +python -m virtualenv %TEMP_DIR%\venv +set PATH=%LOCAL_PATH% +echo Creating Python3.7 venv...DONE | tee.exe -a test.log + +echo Installing ortools Python3.7 venv... | tee.exe -a test.log +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO %TEMP_DIR%\venv\Scripts\python -m pip install %%i +echo Installing ortools Python3.7 venv...DONE | tee.exe -a test.log + +echo Testing ortools Python3.7... | tee.exe -a test.log +copy test.py.in %TEMP_DIR%\venv\test.py +%TEMP_DIR%\venv\Scripts\python %TEMP_DIR%\venv\test.py 2>&1 | tee.exe -a test.log +echo Testing ortools Python3.7...DONE | tee.exe -a test.log + +FOR %%i IN (%TEMP_DIR%\ortools\dist\*.whl) DO copy %%i .