Пример #1
0
 def __init__(self):
     self.parse_args()
     initialize_logger(LOG_FILENAME, self.args.level)
     self.module_dir = get_module_dir()
     self.platform = get_platform()
     self.os = get_os()
     self.main()
     test_runner.run(self)
Пример #2
0
 def __init__(self):
     self.args = parse_args()
     initialize_logger(LOG_FILENAME, self.args.level)
     self.init_tesseract_path()
     self.module_dir = get_module_dir()
     self.platform = get_platform()
     self.os = Settings.getOS()
     self.main()
     test_runner.run(self)
Пример #3
0
 def __init__(self):
     global logger
     self.parse_args()
     logger = initialize_logger(self)
     self.module_dir = get_module_dir()
     self.platform = get_platform()
     self.os = get_os()
     self.main()
     test_runner.run(self)
Пример #4
0
 def __init__(self):
     cleanup.init()
     Iris.fix_terminal_encoding()
     self.initialize_platform()
     self.verify_config()
     if self.control_center():
         self.initialize_run()
         run(self)
     else:
         self.delete_run_directory()
         self.finish(0)
Пример #5
0
    def __init__(self):
        print "app.py: This is our main app"
        """
        Things to do here:
            * argument parsing
            * download and install Firefox
            * set up logging
        """
        self.platform = os.environ["PLATFORM_NAME"]
        self.os = os.environ["OS_NAME"]

        test_runner.run(self)
Пример #6
0
 def __init__(self):
     self.args = parse_args()
     initialize_logger(LOG_FILENAME, self.args.level)
     self.process_list = []
     self.check_keyboard_state()
     self.init_tesseract_path()
     self.check_7zip()
     self.module_dir = get_module_dir()
     self.platform = get_platform()
     self.os = Settings.getOS()
     self.local_web_root = os.path.join(self.module_dir, 'iris', 'local_web')
     self.base_local_web_url = 'http://127.0.0.1:%s' % self.args.port
     self.start_local_web_server(self.local_web_root, self.args.port)
     self.main()
     self.create_run_directory()
     run(self)
Пример #7
0
	def run_hook(_config, parsed, updated_branch):
		notify_data = {"msg": "running hook",
			"branch": updated_branch}
		for attr in ['pusher', 'latest_hash']:
			notify_data[attr] = parsed.get(attr)
		notify(notify_data)
		discord_notify(_config, "{pusher} {msg} {name} on {branch}".format(**dict(notify_data, name=name)))
		worked, output = run(_exec, _dir, env={'branch': updated_branch}, logger=logger)

		msg = "CI job {} {} on branch({})".format(name, "succeeded" if worked else "FAILED", updated_branch)
		notify_data['msg'] = msg
		if not worked:
			notify_data['output'] = output.split('\n')
		notify(notify_data)

		logger.info(msg)
		if output:
			logger.info(output)
		if not worked:
			logger.info("[no output]")

		discord_msg = msg
		if not worked:
			discord_msg += "\n```{}```".format(output[:1800]) if output else "`[no output]`"
		discord_notify(_config, discord_msg)
Пример #8
0
def run_iris():
    """Runs Iris."""
    use_control_center, tests_list = control_center()
    if use_control_center:
        start_local_web_server(parse_args().port)
        if tests_list is not None and len(tests_list) > 0:
            tests = tests_list
        else:
            tests, packages = load_tests(master_test_list)
            if len(tests) == 0:
                logger.error('Specified tests not found, aborting run.')
                finish(1)
        try:
            browser = FirefoxApp()
            run(master_test_list, tests, browser)
        except (ValueError, KeyboardInterrupt):
            finish(1)
    else:
        IrisCore.delete_run_directory()
        finish(0)
Пример #9
0
    def run_hook(_config, parsed, updated_branch):

        github_status(parsed, 'pending', _config.get('github_status_token'))

        notify_data = {"msg": "running hook", "branch": updated_branch}
        for attr in ['pusher', 'latest_hash']:
            notify_data[attr] = parsed.get(attr)
        notify(notify_data)
        discord_notify(
            _config, "{pusher} {msg} {name} on {branch}({latest_hash})".format(
                **dict(notify_data, name=name)))
        worked, output = run(_exec,
                             _dir,
                             env={'branch': updated_branch},
                             logger=logger)

        msg = u"CI job {} {} on {}({})".format(
            name, "succeeded" if worked else "FAILED", updated_branch,
            parsed.get('latest_hash'))
        notify_data['msg'] = msg
        discord_msg = msg
        logger.info(msg)

        _status = 'success'

        if not worked:
            notify_data['output'] = output.split('\n')
            discord_msg += u"\n```{}```".format(
                output[-1800:]) if output else "`[no output]`"
            _status = 'failure'

        github_status(parsed, _status, _config.get('github_status_token'))
        notify(notify_data)
        discord_notify(_config, discord_msg)

        if output:
            logger.info(output)
        else:
            logger.info("[no output]")
Пример #10
0
def test_Q024_SwapNodesInPairs():
    s = Solution()
    run(s, 'Q024')
Пример #11
0
def test_Q070_ClimbingStairs():
    s = Solution()
    run(s, 'Q070')
Пример #12
0
def test_Q134_GasStation():
    s = Solution()
    run(s, 'Q134')
Пример #13
0
def test_Q069_Sqrtx():
    s = Solution()
    run(s, 'Q069')
Пример #14
0
def test_Q119_PascalsTriangleII():
    s = Solution()
    run(s, 'Q119')
def test_Q160_IntersectionOfTwoLinkedLists():
    s = Solution()
    run(s, 'Q160')
Пример #16
0
def test_Q216_CombinationSumIII():
    s = Solution()
    run(s, 'Q216')
def test_Q300_LongestIncreasingSubsequence():
    s = Solution()
    run(s, 'Q300')
def test_Q094_BinaryTreeInorderTraversal():
    s = Solution()
    run(s, 'Q094')
Пример #19
0
def test_Q204_CountPrimes():
    s = Solution()
    run(s, 'Q204')
Пример #20
0
def test_Q038_CountAndSay():
    s = Solution()
    run(s, 'Q038')
Пример #21
0
def test_Q055_JumpGame():
    s = Solution()
    run(s, 'Q055')
Пример #22
0
def test_Q134_GasStation():
    s = Solution()
    run(s, "Q134")
def test_Q152_MaximumProductSubarray():
    s = Solution()
    run(s, 'Q152')
Пример #24
0
def test_Q020_ValidParentheses():
    s = Solution()
    run(s, 'Q020')
def test_Q109_ConvertSortedListToBinarySearchTree():
    s = Solution()
    run(s, 'Q109')
def test_Q131_PalindromePartitioning():
    s = Solution()
    run(s, 'Q131')
Пример #27
0
def test_Q239_SlidingWindowMaximum():
    s = Solution()
    run(s, 'Q239')
Пример #28
0
def test_Q140_WordBreakII():
    s = Solution()
    run(s, 'Q140')
Пример #29
0
def test_Q057_InsertInterval():
    s = Solution()
    run(s, "Q057")
Пример #30
0
def test_Q135_Candy():
    s = Solution()
    run(s, 'Q135')
Пример #31
0
def test_Q086_PartitionList():
    s = Solution()
    run(s, 'Q086')
Пример #32
0
def test_Q206_ReverseLinkedList():
    s = Solution()
    run(s, 'Q206')
Пример #33
0
def test_Q164_MaximumGap():
    s = Solution()
    run(s, 'Q164')
Пример #34
0
def test_Q022_GenerateParentheses():
    s = Solution()
    run(s, 'Q022')
Пример #35
0
def test_Q029_DivideTwoIntegers():
    s = Solution()
    run(s, 'Q029')
Пример #36
0
def test_Q283_MoveZeroes():
    s = Solution()
    run(s, 'Q283')
Пример #37
0
def test_Q061_RotateList():
    s = Solution()
    run(s, 'Q061')
def test_Q103_BinaryTreeZigzagLevelOrderTraversal():
    s = Solution()
    run(s, 'Q103')
Пример #39
0
def test_Q080_RemoveDuplicatesFromSortedArrayII():
    s = Solution()
    run(s, 'Q080')
Пример #40
0
def test_Q049_Anagrams():
    s = Solution()
    run(s, 'Q049')
Пример #41
0
def test_Q013_RomanToInteger():
    s = Solution()
    run(s, "Q013")
Пример #42
0
def test_Q268_MissingNumber():
    s = Solution()
    run(s, "Q268")
Пример #43
0
            test_curve_fit(data[:, (0, 1)],
                           fitted_curve,
                           max_mean_err=nominal_vel * 0.3,
                           inlier_range=nominal_vel * 0.5,
                           max_outliers=len(data[:, 0]) * 0.1)

            # axis1: encoder.vel_estimate
            slope, offset, fitted_curve = fit_line(data[:, (0, 2)])
            test_assert_eq(slope, 0.0, range=nominal_vel * 0.02)
            test_assert_eq(offset, -nominal_vel, accuracy=0.05)
            test_curve_fit(data[:, (0, 2)],
                           fitted_curve,
                           max_mean_err=nominal_vel * 0.3,
                           inlier_range=nominal_vel * 0.5,
                           max_outliers=len(data[:, 0]) * 0.1)

            # axis0: encoder.pos_estimate
            slope, offset, fitted_curve = fit_line(data[:, (0, 3)])
            test_assert_eq(slope, nominal_vel, accuracy=0.01)
            test_curve_fit(data[:, (0, 3)],
                           fitted_curve,
                           max_mean_err=nominal_vel * 0.01,
                           inlier_range=nominal_vel * 0.1,
                           max_outliers=len(data[:, 0]) * 0.01)


tests = [FightingTest()]

if __name__ == '__main__':
    test_runner.run(tests)
Пример #44
0
def test_Q047_PermutationsII():
    s = Solution()
    run(s, 'Q047')
def test_Q083_RemoveDuplicatesFromSortedList():
    s = Solution()
    run(s, 'Q083')