-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_runner.py
More file actions
69 lines (61 loc) · 1.89 KB
/
Copy pathtest_runner.py
File metadata and controls
69 lines (61 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
__author__ = 'Jakub Danek'
"""
Test control module.
"""
from data.classes import *
import data.generator as gen
import oracle as oc
import mongo as m
import sys
import tests
"""
Run all test cases. Number of inrementation steps depends on the steps parameter.
Steps parameter represents maximum number of parallel processes (1 - 2^steps).
"""
def incremental_test(steps=1):
scenario_title_incremental_test(steps)
group_owner_name_incremental_test(steps)
subject_age_incremental_test(steps)
"""
Search by subject age.
"""
def subject_age_incremental_test(steps=1):
proc = 1
print "### STARTING TEST RUN: SUBJECT AGE###"
for i in range(0, steps):
tests.search_experiments_by_subject_age(60,proc)
proc = proc * 2
print "ITERATION: " + str(i) + " PASSED"
print "### TEST RUN - SUBJECT AGE - FINISHED ###"
"""
Search by scenario title
"""
def scenario_title_incremental_test(steps=1):
proc = 1
print "### STARTING TEST RUN: SCENARIO TITLE###"
for i in range(0, steps):
tests.search_experiments_by_scenario_name("scenario1", proc)
proc = proc * 2
print "ITERATION: " + str(i) + " PASSED"
print "### TEST RUN - SCENARIO TITLE - FINISHED ###"
"""
Search by research group owner.
"""
def group_owner_name_incremental_test(steps=1):
proc = 1
print "### STARTING TEST RUN: GROUP OWNER NAME###"
for i in range(0, steps):
tests.search_experiments_by_research_group_owner_name("firstname9", "lastname2", proc)
proc = proc * 2
print "ITERATION: " + str(i) + " PASSED"
print "### TEST RUN - GROUP OWNER NAME - FINISHED ###"
"""
Initializes both the databases.
"""
def init_dbs():
gen.init_oracle(100, 100, 100, 10, 100, 100, 200, 100, 100)
gen.generate_experiments()
exps = oc.query_experiments_full(oc.experiment_select_full_all)
m.init_mongo(exps)
if __name__ == "__main__":
incremental_test(1)