|
| 1 | + |
| 2 | +echo "Setting up a testing env in $env:USERPROFILE\testenv" |
| 3 | + |
| 4 | +python -m venv --clear $env:USERPROFILE\testenv |
| 5 | + |
| 6 | +& $env:USERPROFILE\testenv\Scripts\Activate.ps1 |
| 7 | + |
| 8 | +$version = python setup.py --version |
| 9 | + |
| 10 | +python -c 'import sys; print(\"sys.prefix:\", sys.prefix); print(sys.version)' |
| 11 | +python -m pip install pip==8.1.* wheel==0.29.* |
| 12 | + |
| 13 | +# run install and test from a empty dir to avoid imports from current dir |
| 14 | + |
| 15 | +mkdir -force build/testdir | out-null |
| 16 | +pushd |
| 17 | + |
| 18 | +try { |
| 19 | + cd build/testdir |
| 20 | + |
| 21 | + # Install numpy/scipy from staging index (contains numpy and scipy |
| 22 | + # extracted form the legacy superpack installers (sse2 builds)) |
| 23 | + |
| 24 | + python -m pip install ` |
| 25 | + --index-url "$env:STAGING_INDEX" ` |
| 26 | + --only-binary "numpy,scipy" numpy scipy |
| 27 | + |
| 28 | + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } |
| 29 | + |
| 30 | + |
| 31 | + # Install specific Orange3 version |
| 32 | + python -m pip install --no-deps --no-index ` |
| 33 | + --find-links ../../dist ` |
| 34 | + Orange3==$version |
| 35 | + |
| 36 | + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } |
| 37 | + |
| 38 | + # Instal other remaining dependencies |
| 39 | + python -m pip install ` |
| 40 | + --extra-index-url "$env:STAGING_INDEX" ` |
| 41 | + --only-binary "numpy,scipy" ` |
| 42 | + Orange3==$version |
| 43 | + |
| 44 | + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } |
| 45 | + |
| 46 | + echo "Test environment:" |
| 47 | + echo "-----------------" |
| 48 | + python -m pip freeze |
| 49 | + echo "-----------------" |
| 50 | + |
| 51 | + # Run core tests |
| 52 | + echo "Running tests" |
| 53 | + echo "-------------" |
| 54 | + python -m unittest -v Orange.tests |
| 55 | + |
| 56 | + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } |
| 57 | + |
| 58 | + # Widget tests |
| 59 | + python -m pip install ` |
| 60 | + --extra-index-url "$Env:STAGING_INDEX" ` |
| 61 | + PyQt5 |
| 62 | + |
| 63 | + echo "Running widget tests with PyQt5" |
| 64 | + echo "-------------------------------" |
| 65 | + try { |
| 66 | + $Env:ANYQT_HOOK_BACKPORT = "pyqt4" |
| 67 | + python -m unittest -v Orange.widgets.tests |
| 68 | + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } |
| 69 | + } finally { |
| 70 | + $Env:ANYQT_HOOK_BACKPORT = "" |
| 71 | + } |
| 72 | + |
| 73 | + python -m pip uninstall --yes PyQt5 |
| 74 | + python -m pip install ` |
| 75 | + --extra-index-url "$Env:STAGING_INDEX" ` |
| 76 | + PyQt4 |
| 77 | + |
| 78 | + echo "Running widget tests with PyQt4" |
| 79 | + echo "-------------------------------" |
| 80 | + |
| 81 | + python -m unittest -v Orange.widgets.tests |
| 82 | + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } |
| 83 | + |
| 84 | +} finally { |
| 85 | + popd |
| 86 | +} |
0 commit comments