-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathperf-script-static
More file actions
executable file
·73 lines (51 loc) · 1.87 KB
/
Copy pathperf-script-static
File metadata and controls
executable file
·73 lines (51 loc) · 1.87 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
70
71
72
#!/usr/bin/env python
"""
Copy of `perf-script-ng`, 13017d, which calls KiwiTCMS.version()
API and doesn't create any objects in the DB. This script together
with `perf-script-orm` will help us get an idea how much time execution
spends inside the web stack compared to read/write from DB.
NOTE: The KiwiTCMS.version() API returns a static string!
Sample size: R
Number of API requests: 10 + 3R + 2R^2
"""
import ssl
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
# Legacy Python that doesn't verify HTTPS certificates by default
pass
else:
# Handle target environment that doesn't support HTTPS verification
ssl._create_default_https_context = _create_unverified_https_context
import tcms_api
from datetime import datetime
RANGE_SIZE = 30
rpc_client = tcms_api.TCMS().exec
user = rpc_client.KiwiTCMS.version()
classification = rpc_client.KiwiTCMS.version()
# create a separate Product, Version & TestCase
product = rpc_client.KiwiTCMS.version()
version = rpc_client.KiwiTCMS.version()
# create TestPlan
test_plan = rpc_client.KiwiTCMS.version()
test_cases = []
priority = rpc_client.KiwiTCMS.version()
category = rpc_client.KiwiTCMS.version()
confirmed_status = rpc_client.KiwiTCMS.version()
for j in range(RANGE_SIZE):
test_case = rpc_client.KiwiTCMS.version()
test_cases.append(test_case)
# simulates TestPlan.add_case()
rpc_client.KiwiTCMS.version()
# create build, test run & test executions
pass_status = rpc_client.KiwiTCMS.version()
build = rpc_client.KiwiTCMS.version()
# create a separate TestPlan
for i in range(RANGE_SIZE):
test_run = rpc_client.KiwiTCMS.version()
print("TR-%d created" % i)
# add cases to TR
for case in test_cases:
execution = rpc_client.KiwiTCMS.version()
# record the results
rpc_client.KiwiTCMS.version()