Commit be2d285d authored by Marius Wachtler's avatar Marius Wachtler

enable our paste integration test and add one for pylons and routes

parent b0253978
......@@ -75,7 +75,7 @@ before_script:
script:
- ccache -z
- ninja -j4 pyston check-deps && PYSTON_RUN_ARGS=G travis_wait 30 ctest --output-on-failure
- ninja -j4 pyston check-deps && PYSTON_RUN_ARGS=G travis_wait 45 ctest --output-on-failure
- ccache -s
- if [ -n "$(git status --porcelain --untracked=no)" ]; then echo "test suite left the source directory dirty"; git status; false; fi
......
# expected: fail
# The paste test suite uses pytest, so this test file incentally also tests pytest.
# Pytest relies quite heavily on a number of code introspection features, which
# we currently don't have. This includes:
# 1) The ast module
# 2) traceback.tb_frame, traceback.tb_next
import os, sys, subprocess
sys.path.append(os.path.dirname(__file__) + "/../lib")
......@@ -13,21 +6,38 @@ from test_helper import create_virtenv, run_test
ENV_NAME = "paste_test_env_" + os.path.basename(sys.executable)
PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python"))
PYTEST_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "py.test"))
PASTE_DIR = os.path.abspath(os.path.join(ENV_NAME, "paste"))
PASTE_TEST_DIR = os.path.abspath(os.path.join(PASTE_DIR, "tests"))
packages = ["pytest", "paste", "nose==1.3.7"]
packages = ["py==1.4.31", "pytest==2.8.7", "nose==1.3.7"]
create_virtenv(ENV_NAME, packages, force_create = True)
# Need the test files in the source
subprocess.check_call(["hg", "clone", "https://bitbucket.org/ianb/paste"], cwd=ENV_NAME)
url = "https://pypi.python.org/packages/source/P/Paste/Paste-1.7.5.tar.gz"
subprocess.check_call(["wget", url], cwd=ENV_NAME)
subprocess.check_call(["tar", "-zxf", "Paste-1.7.5.tar.gz"], cwd=ENV_NAME)
PASTE_DIR = os.path.abspath(os.path.join(ENV_NAME, "Paste-1.7.5"))
PASTE_TEST_DIR = os.path.abspath(os.path.join(PASTE_DIR, "tests"))
print ">> "
print ">> Setting up paste..."
print ">> "
subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PASTE_DIR)
print ">> "
print ">> Installing paste..."
print ">> "
subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PASTE_DIR)
print ">> "
print ">> Running paste tests..."
print ">> "
subprocess.check_call([PYTEST_EXE], cwd=PASTE_TEST_DIR)
# current cpython also does not pass all tests. (9 failed, 127 passed)
# the additional test we fail are because:
# - we have str.__iter__
# - no sys.settrace
# - no shiftjis encoding
# - slightly different error messages
expected = [{"failed" : 22, "passed" : 113}]
run_test([PYTEST_EXE], cwd=PASTE_TEST_DIR, expected=expected)
import os, sys, subprocess, shutil
sys.path.append(os.path.dirname(__file__) + "/../lib")
from test_helper import create_virtenv, run_test
ENV_NAME = "pylons_test_env_" + os.path.basename(sys.executable)
SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src"))
PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python"))
NOSE_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "nosetests"))
def install_and_test_pylons():
shutil.rmtree(SRC_DIR, ignore_errors=True)
os.makedirs(SRC_DIR)
url = "https://pypi.python.org/packages/source/P/Pylons/Pylons-0.9.6.2.tar.gz"
subprocess.check_call(["wget", url], cwd=SRC_DIR)
subprocess.check_call(["tar", "-zxf", "Pylons-0.9.6.2.tar.gz"], cwd=SRC_DIR)
PYLONS_DIR = os.path.abspath(os.path.join(SRC_DIR, "Pylons-0.9.6.2"))
subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PYLONS_DIR)
# most of the errors are because of our coerceUnicodeToStr which raises a TypeError instead of a UnicodeError
# but as we don't support the unicode string correctly every where I don't want to change this currently.
expected = [{ "ran": 50, "errors": 7}]
run_test([NOSE_EXE], cwd=PYLONS_DIR, expected=expected)
pkg = [ "Mako==1.0.3",
"decorator==4.0.9",
"simplejson==3.8.2",
"FormEncode==1.3.0",
"PasteScript==2.0.2",
"PasteDeploy==1.5.2",
"Paste==2.0.2",
"Beaker==1.8.0",
"WebHelpers==1.3",
"Routes==2.2",
"MarkupSafe==0.23",
"six==1.10.0",
"funcsigs==0.4",
"repoze.lru==0.6",
"nose==1.3.7"]
create_virtenv(ENV_NAME, pkg, force_create = True)
install_and_test_pylons()
import os, sys, subprocess, shutil
sys.path.append(os.path.dirname(__file__) + "/../lib")
from test_helper import create_virtenv, run_test
ENV_NAME = "routes_test_env_" + os.path.basename(sys.executable)
SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src"))
PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python"))
pkg = ["nose==1.3.7", "paste==2.0.2", "six==1.10.0"]
pkg += ["-e", "git+https://github.com/bbangert/routes.git@v1.7.3#egg=Routes"]
create_virtenv(ENV_NAME, pkg, force_create = True)
ROUTES_DIR = os.path.abspath(os.path.join(SRC_DIR, "routes"))
expected = [{ "ran" : 141 }]
run_test([PYTHON_EXE, "setup.py", "test"], cwd=ROUTES_DIR, expected=expected)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment