Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
scheduler = BackgroundScheduler()

def run_tests_job():
config = run_tests(["--use-config"])
config = run_tests()
global return_val
return_val["CourseGrab"]= config.get("CourseGrab")
return_val["Eatery"]= config.get("Eatery")
Expand Down
43 changes: 22 additions & 21 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,29 @@ def run_tests(args=sys.argv[1:]):
elif args[0] == "--local-only":
test_config = default_config
local_only = True
elif args[0] == "--use-config":
with open(path.join(environ['BASE_DIR'], 'config/test_config.txt'), 'r') as file:
j = file.read()
if not j:
test_config = default_config
else:
try:
test_config = Config(j)
except Exception as e:
print(j)
print(e)
# elif args[0] == "--use-config":
# with open(path.join(environ['BASE_DIR'], 'config/test_config.txt'), 'r') as file:
# j = file.read()
# if not j:
# test_config = default_config
# else:
# try:
# test_config = Config(j)
# except Exception as e:
# print(j)
# print(e)

if len(test_config) != len(test_groups):
test_config = default_config
# test_config is a json of app names mapped to of "OFF", "ON", or "FAILED"
# "OFF" represents a disabled test_group
# "ON" represents an enabled test_group
# "FAILED" represents a test_group that has failed previously and is will have its output suppressed to prevent spam
# Config values of "ON" and "FAILED" will be tested
if "--local-only" in args[1:]:
local_only = True
# if len(test_config) != len(test_groups):
# test_config = default_config
# # test_config is a json of app names mapped to of "OFF", "ON", or "FAILED"
# # "OFF" represents a disabled test_group
# # "ON" represents an enabled test_group
# # "FAILED" represents a test_group that has failed previously and is will have its output suppressed to prevent spam
# # Config values of "ON" and "FAILED" will be tested
# if "--local-only" in args[1:]:
# local_only = True
else:
print(args)
raise Exception("Invalid args, can use the following: [--use-config] [--local-only]")
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ APPLICATION CODE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
original_config = copy.deepcopy(test_config)
Expand Down Expand Up @@ -128,4 +129,4 @@ def run_tests(args=sys.argv[1:]):
return test_config

if __name__ == '__main__':
run_tests(["--use-config"])
run_tests()