-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
app.py
45 lines (37 loc) · 1.25 KB
/
app.py
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
import argparse
import os
import time
from core.engine import print_message, Colors
from core.jmx import parse_jmx
from core import config
def main():
"""
The main context of the application
"""
try:
parser = argparse.ArgumentParser(
description='Evaluate JMeter Test Plan'
)
required_named = parser.add_argument_group('mandatory arguments')
required_named.add_argument(
"-f",
"--file",
dest="jmxfile",
help="Add JMeter Test Plan file path"
)
args = parser.parse_args()
jmx = args.jmxfile
# Loads base configuration from config.yaml
config.load()
with open(jmx) as f:
parse_jmx(jmx)
except FileNotFoundError as e:
print_message(message_color=Colors.red, message=f"An error occured during JEval execution: "
f"{e.strerror} ({e.filename})")
if __name__ == "__main__":
start_time = time.time()
main()
# Print Execution Time
print("\033[93m \n\t Execution completed in %s seconds." % round(time.time() - start_time, 3))
# Print Log file location
print(f"\033[93m \t Log file is located in {os.curdir}/tmp.log")