def test_compare_old_better_against_new_good_yields_regression(args): args.check_against_build = '0052' args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'tumblesle/0052_0056_regression') args.run_once = True tr = tumblesle_release.TumblesleRelease(args) tr.run() assert tr.release_build is None
def test_select_different_build_checks_specified(args): args.check_build = '0051' args.check_against_build = '0047' args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'tumblesle/0047_0051_explicit_no_release') tr = tumblesle_release.TumblesleRelease(args) tr.check_last_builds() assert tr.release_build is None
def test_compare_old_released_with_release_info_against_new_good_yields_release(args): args.check_against_build = 'release_info' with TumblesleDirectory(args): with open(os.path.join(args.dest, '.release_info'), 'w') as release_info: yaml.dump({args.product: {'build': '0046'}}, release_info) tr = tumblesle_release.TumblesleRelease(args) tr.one_run() assert tr.release_build == '0056'
def test_old_better_against_new_good_plus_whitelist_yields_forced_release(args): args.check_against_build = '0052' args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'tumblesle/0052_0056_regression') args.whitelist = 'lxde@Laptop_64, DVD-x86_64-gnome@64bit, opensuse-42.2-NET-x86_64-gnome@64bit, \ cryptlvm-image@uefi, gnome@Laptop_64, \ sysauth_gnome@64bit, opensuse-42.2-NET-x86_64-RAID1@64bit' tr = tumblesle_release.TumblesleRelease(args) tr.check_last_builds() assert tr.release_build == '0056'
def test_softfailed_state_is_regarded_as_passed_with_newer_openqa(args): args.load_dir = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'tumblesle/0213_0215_new_openqa_with_softfailed') args.check_build = '0215' args.check_against_build = '0213' tr = tumblesle_release.TumblesleRelease(args) tr.check_last_builds() assert tr.release_build == '0215'
def test_compare_old_released_with_release_info_against_new_good_yields_release( args): args.check_against_build = "release_info" with TumblesleDirectory(args): with open(os.path.join(args.dest, ".release_info"), "w") as release_info: yaml.dump({args.product: {"build": "0046"}}, release_info) tr = tumblesle_release.TumblesleRelease(args) tr.one_run() assert tr.release_build == "0056"
def test_compare_old_bad_against_new_good_yields_release(args): args.match_hdds = None with TumblesleDirectory(args): tr = tumblesle_release.TumblesleRelease(args) tr.one_run() assert tr.release_build == '0056' # same again, this time with rsync dry-run args.dry_run_rsync = True tr = tumblesle_release.TumblesleRelease(args) tr.one_run() assert tr.release_build == '0056' # same again, this times 'hot' args.dry_run = False args.dry_run_rsync = False tr = tumblesle_release.TumblesleRelease(args) tr.one_run() assert tr.release_build == '0056' args.post_release_hook = '/bin/true' # subsequent call with same build has same effect tr = tumblesle_release.TumblesleRelease(args) tr.one_run() assert tr.release_build == '0056'
def test_notifications_are_sent(args, mocker): with TumblesleDirectory(args) as tmp_dir: config_path = os.path.join(tmp_dir, 'config_file') with open(config_path, 'a') as config: config.write(""" [notification] host = localhost """) mocker.patch('pika.BlockingConnection') tr = tumblesle_release.TumblesleRelease(args) tr.one_run() assert '{"build": "0056"}' in tr.notify_seen # this will yield the same message and is therefore not sent out again tr.one_run() assert '{"build": "0056"}' in tr.notify_seen
def test_unsafe_rsync_args_are_catched(args): args.src = '/tmp/foo' with pytest.raises(UnsupportedRsyncArgsError): tumblesle_release.TumblesleRelease(args).run()
def test_tagged_not_yet_implemented(args): args.run_once = False args.check_against_build = 'tagged' with pytest.raises(NotImplementedError): tumblesle_release.TumblesleRelease(args).run()
def test_specifying_more_recent_check_build_does_not_yield_release(args): args.check_against_build = '0056' tr = tumblesle_release.TumblesleRelease(args) tr.one_run() assert tr.release_build is None