summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorankitjavalkar2016-09-12 16:22:55 +0530
committerankitjavalkar2016-09-21 17:51:23 +0530
commit953f856edc18ed22c72c56b58171e2ce5bc450e5 (patch)
tree07c235e66cfa3f335093f3ad4e7a35228abd95d8
parent722e82275c28418dc7535ca7393b81eecadbeba9 (diff)
downloadonline_test-953f856edc18ed22c72c56b58171e2ce5bc450e5.tar.gz
online_test-953f856edc18ed22c72c56b58171e2ce5bc450e5.tar.bz2
online_test-953f856edc18ed22c72c56b58171e2ce5bc450e5.zip
Run the selenium and unit tests separately
-rw-r--r--.travis.yml1
-rw-r--r--yaksh/tests/load_test.py (renamed from yaksh/tests/test_load.py)21
-rw-r--r--yaksh/tests/selenium_test.py1
3 files changed, 13 insertions, 10 deletions
diff --git a/.travis.yml b/.travis.yml
index c70a17a..b44d4e2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,3 +26,4 @@ before_install:
# command to run tests
script:
- python manage.py test -v 2 yaksh
+ - python manage.py test -v 2 yaksh.tests.load_test \ No newline at end of file
diff --git a/yaksh/tests/test_load.py b/yaksh/tests/load_test.py
index 27ae750..fd90b11 100644
--- a/yaksh/tests/test_load.py
+++ b/yaksh/tests/load_test.py
@@ -11,10 +11,10 @@ from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from yaksh.models import User, Profile, Question, Quiz, Course, QuestionPaper, TestCase
from selenium_test import SeleniumTest
-from yaksh.code_server import ServerPool, SERVER_POOL_PORT, SERVER_PORTS
+from yaksh.code_server import ServerPool #SERVER_POOL_PORT, SERVER_PORTS
from yaksh import settings
-from yaksh.xmlrpc_clients import CodeServerProxy
-from django.core.management import call_command
+# from django.core.management import call_command
+from yaksh.management.commands.create_demo_course import create_demo_course
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -31,19 +31,22 @@ class MySeleniumTests(StaticLiveServerTestCase):
"yaksh.cpp_code_evaluator.CppCodeEvaluator"
settings.code_evaluators['bash']['standardtestcase'] = \
"yaksh.bash_code_evaluator.BashCodeEvaluator"
- code_server_pool = ServerPool(ports=SERVER_PORTS, pool_port=SERVER_POOL_PORT)
+ settings.SERVER_POOL_PORT = 53578
+ code_server_pool = ServerPool(ports=settings.SERVER_PORTS, pool_port=settings.SERVER_POOL_PORT)
cls.code_server_pool = code_server_pool
cls.code_server_thread = t = Thread(target=code_server_pool.run)
t.start()
- call_command('create_demo_course')
+ demo_course_setup = create_demo_course()
@classmethod
def tearDownClass(cls):
- User.objects.all().delete()
- Question.objects.all().delete()
- Quiz.objects.all().delete()
- Course.objects.all().delete()
+ # User.objects.all().delete()
+ # Question.objects.all().delete()
+ # Quiz.objects.all().delete()
+ # Course.objects.all().delete()
+
+ settings.SERVER_POOL_PORT = 53579
cls.code_server_pool.stop()
cls.code_server_thread.join()
diff --git a/yaksh/tests/selenium_test.py b/yaksh/tests/selenium_test.py
index 15d730e..01ccc96 100644
--- a/yaksh/tests/selenium_test.py
+++ b/yaksh/tests/selenium_test.py
@@ -126,7 +126,6 @@ def user_gen(url, ids):
def wrap_run_load_test(args):
url = "http://yaksh.fossee.aero.iitb.ac.in/exam/"
- quiz_name = "yaksh_demo_quiz"
selenium_test = SeleniumTest(url=url, quiz_name=quiz_name)
return selenium_test.run_load_test(*args)