-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
19 lines (15 loc) · 796 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from src.setup.configLoader import ConfigLoader
from src.setup.runCommand import runCommand
from src.testRunner import TestRunner
from src.setup.argsSetup import setupArgs
# Add Args
args = setupArgs()
jobs = ConfigLoader(args.config).loadConfig(args.baseDirectory)
# Run the jobs
testRunner = TestRunner(args.showErrors, args.timeout, args.noColour, True if args.showErrors else args.requireSuccess)
allJobsSuccessful = testRunner.startTest(jobs)
# Run commands on failure or success as defined in the arguments
if (allJobsSuccessful and not args.onSuccess is None):
runCommand(args.onSuccess, args.baseDirectory, args.showErrors, args.timeout)
elif (not allJobsSuccessful and not args.onFailure is None):
runCommand(args.onFailure, args.baseDirectory, args.showErrors, args.timeout)