def test_ignore_older_revision_build(self): with temp_dir() as root: path_1234 = make_candidate_dir(root, '1234-artifacts', 'mybranch', '1234') make_candidate_dir(root, '1233', 'mybranch', '1233') self.assertEqual(find_latest_branch_candidates(root), [(path_1234, 1234)])
def test_ignore_older_revision_build(self): with temp_dir() as root: path_1234 = make_candidate_dir( root, '1234-artifacts', 'mybranch', '1234') make_candidate_dir(root, '1233', 'mybranch', '1233') self.assertEqual(find_latest_branch_candidates(root), [ (path_1234, 1234)])
def test_include_older_revision_build_different_branch(self): with temp_dir() as root: path_1234 = make_candidate_dir(root, '1234-artifacts', 'branch_foo', '1234') path_1233 = make_candidate_dir(root, '1233-artifacts', 'branch_bar', '1233') self.assertItemsEqual(find_latest_branch_candidates(root), [(path_1233, 1233), (path_1234, 1234)])
def test_include_older_revision_build_different_branch(self): with temp_dir() as root: path_1234 = make_candidate_dir( root, '1234-artifacts', 'branch_foo', '1234') path_1233 = make_candidate_dir( root, '1233-artifacts', 'branch_bar', '1233') self.assertItemsEqual( find_latest_branch_candidates(root), [ (path_1233, 1233), (path_1234, 1234)])
def main(argv=None): args, credentials = parse_args(argv) suite = args.suite if suite == []: suite = [FULL] candidates = find_latest_branch_candidates(args.root_dir)[:3] jobs = args.jobs if jobs is None: jobs = ['industrial-test', 'industrial-test-aws', 'industrial-test-joyent'] for job in jobs: build_job(credentials, args.root_dir, job, candidates, suite)
def test_find_latest_branch_candidates_old_buildvars(self): with temp_dir() as root: a_week_ago = time() - timedelta(days=7, seconds=1).total_seconds() make_candidate_dir(root, 'master-artifacts', modified=a_week_ago) self.assertEqual(find_latest_branch_candidates(root), [])
def test_find_latest_branch_candidates(self): with temp_dir() as root: master_path = make_candidate_dir(root, 'master-artifacts') self.assertEqual(find_latest_branch_candidates(root), [(master_path, 1234)])