Commit 982a0f59 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix and reenable the integration tests

- increase the time limit here
- Have the tester print out the stderr when a test fails with the wrong exit code;
  this might make things spammy but I hope that it will be more helpful.
- Base EXTMODULE_DIR_PYSTON off the executable, not the tester
- modifying os.environ has no effect, even when spawning subprocesses...
parent ba4b88b8
......@@ -202,6 +202,7 @@ add_test(NAME analysis_unittest COMMAND analysis_unittest)
add_test(NAME pyston_defaults COMMAND ${PYTHON_EXE} ${CMAKE_SOURCE_DIR}/tools/tester.py -R ./pyston -j${TEST_THREADS} -a=-S -k ${CMAKE_SOURCE_DIR}/test/tests)
# we pass -I to cpython tests and skip failing ones b/c they are slooow otherwise
add_test(NAME pyston_defaults_cpython_tests COMMAND ${PYTHON_EXE} ${CMAKE_SOURCE_DIR}/tools/tester.py -R ./pyston -j${TEST_THREADS} -a=-S -a=-I -k --exit-code-only --skip-failing ${CMAKE_SOURCE_DIR}/test/cpython)
add_test(NAME pyston_defaults_integration_tests COMMAND ${PYTHON_EXE} ${CMAKE_SOURCE_DIR}/tools/tester.py -R ./pyston -j${TEST_THREADS} -a=-S -k --exit-code-only --skip-failing -t60 ${CMAKE_SOURCE_DIR}/test/integration)
add_test(NAME pyston_max_compilation_tier COMMAND ${PYTHON_EXE} ${CMAKE_SOURCE_DIR}/tools/tester.py -R ./pyston -j${TEST_THREADS} -a=-O -a=-S -k ${CMAKE_SOURCE_DIR}/test/tests)
add_test(NAME pyston_experimental_pypa_parser COMMAND ${PYTHON_EXE} ${CMAKE_SOURCE_DIR}/tools/tester.py -a=-x -R ./pyston -j${TEST_THREADS} -a=-n -a=-S -k ${CMAKE_SOURCE_DIR}/test/tests)
......
......@@ -9,7 +9,7 @@ import sys
import time
import urllib2
EXTRA_PATH = os.path.dirname(__file__) + "/django"
EXTRA_PATH = os.path.dirname(os.path.abspath(__file__)) + "/django"
sys.path.insert(0, EXTRA_PATH)
from django.core.management import execute_from_command_line
......@@ -37,11 +37,12 @@ try:
# but I guess the "startproject testsite" command changed enough global state that
# it won't work. So create a new subprocess to run it instead.
print "Running testsite/manage.py migrate"
os.environ["PYTHONPATH"] = os.environ.get("PYTHONPATH", "") + ":" + EXTRA_PATH
subprocess.check_call([sys.executable, ARGS, "testsite/manage.py", "migrate"])
env = dict(os.environ)
env["PYTHONPATH"] = env.get("PYTHONPATH", "") + ":" + EXTRA_PATH
subprocess.check_call([sys.executable, ARGS, "testsite/manage.py", "migrate"], env=env)
print "Running runserver localhost:8000"
p = subprocess.Popen([sys.executable, ARGS, "testsite/manage.py", "runserver", "--noreload", "localhost:8000"], stdout=subprocess.PIPE)
p = subprocess.Popen([sys.executable, ARGS, "testsite/manage.py", "runserver", "--noreload", "localhost:8000"], stdout=subprocess.PIPE, env=env)
try:
print "Waiting for server to start up"
......
......@@ -40,6 +40,7 @@ TIME_LIMIT = 25
TESTS_TO_SKIP = []
EXIT_CODE_ONLY = False
SKIP_FAILING_TESTS = False
VERBOSE = 1
# For fun, can test pypy.
# Tough because the tester will check to see if the error messages are exactly the
......@@ -57,7 +58,7 @@ def set_ulimits():
resource.setrlimit(resource.RLIMIT_RSS, (MAX_MEM_MB * 1024 * 1024, MAX_MEM_MB * 1024 * 1024))
EXTMODULE_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + "/../test/test_extension/build/lib.linux-x86_64-2.7/")
EXTMODULE_DIR_PYSTON = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + "/../test/test_extension/")
EXTMODULE_DIR_PYSTON = None
THIS_FILE = os.path.abspath(__file__)
_global_mtime = None
......@@ -263,7 +264,10 @@ def determine_test_result(fn, opts, code, out, stderr, elapsed):
return "Expected failure (got code %d, should be %d)" % (code, expected_code)
elif KEEP_GOING:
failed.append(fn)
return "\033[%dmFAILED\033[0m (%s)" % (color, msg)
if VERBOSE >= 1:
return "\033[%dmFAILED\033[0m (%s)\n%s" % (color, msg, stderr)
else:
return "\033[%dmFAILED\033[0m (%s)" % (color, msg)
else:
raise Exception("%s\n%s\n%s" % (msg, err, stderr))
......@@ -433,9 +437,10 @@ def main(orig_dir):
global TESTS_TO_SKIP
global EXIT_CODE_ONLY
global SKIP_FAILING_TESTS
global VERBOSE
global EXTMODULE_DIR_PYSTON
run_memcheck = False
start = 1
opts = parser.parse_args()
run_memcheck = opts.run_memcheck
......@@ -450,6 +455,7 @@ def main(orig_dir):
SKIP_FAILING_TESTS = opts.skip_failing
TEST_DIR = os.path.join(orig_dir, opts.test_dir)
EXTMODULE_DIR_PYSTON = os.path.abspath(os.path.dirname(os.path.realpath(IMAGE)) + "/test/test_extension/")
patterns = opts.pattern
if not patterns and not TESTS_TO_SKIP:
......
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