def test_get_build_urls_to_compare_finds_last_reviewed_if_selected(): args = cache_test_args_factory() browser = browser_factory(args) current, reviewed = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls, against_reviewed="0311") assert "=0311" in current assert "=0307" in reviewed # If '--against-reviewed' is 'last', search for the latest finished current, reviewed = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls, against_reviewed="last") assert "=0313" in current assert "=0307" in reviewed # Also accept still running if threshold is increased current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed="last", running_threshold=45 ) assert "=0318" in current assert "=0307" in reviewed # Not accepted if slightly below threshold current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed="last", running_threshold=36 ) assert "=0313" in current assert "=0307" in reviewed
def test_non_number_build_nr_also_finds_valid_review_build_urls(): args = cache_test_args_factory() args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'live') args.job_group_urls = args.host + '/group_overview/27' browser = browser_factory(args) current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='last') assert '=0104%400351' in current # i.e. escaped '0104@0351' assert '=0097%400305' in reviewed # if no review comments are found we revert to the last two finished args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'live_no_review') browser = browser_factory(args) current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='last') assert '=0104%400351' in current # i.e. escaped '0104@0351' assert '=0104%400350' in reviewed # no review comments found, reverting to last two finished # builds with no finished results are catched args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'only_old_invalid_builds') args.job_group_urls = args.host + '/group_overview/28' browser = browser_factory(args) with pytest.raises(openqa_review.NotEnoughBuildsError): current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='last')
def test_get_build_urls_to_compare_finds_last_reviewed_if_selected(): args = cache_test_args_factory() browser = browser_factory(args) current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='0311') assert '=0311' in current assert '=0307' in reviewed # If '--against-reviewed' is 'last', search for the latest finished current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='last') assert '=0313' in current assert '=0307' in reviewed # Also accept still running if threshold is increased current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='last', running_threshold=45) assert '=0318' in current assert '=0307' in reviewed # Not accepted if slightly below threshold current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='last', running_threshold=36) assert '=0313' in current assert '=0307' in reviewed
def test_get_build_urls_to_compare_finds_last_reviewed_if_selected(): args = cache_test_args_factory() browser = openqa_review.Browser(args, urljoin(args.host, args.base_url)) current, reviewed = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls, against_reviewed='0311') assert '=0311' in current assert '=0307' in reviewed # If '--against-reviewed' is 'last', search for the latest finished current, reviewed = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls, against_reviewed='last') assert '=0313' in current assert '=0307' in reviewed
def test_get_build_urls_to_compare_finds_last_reviewed_if_selected(): args = cache_test_args_factory() browser = openqa_review.Browser(args, urljoin(args.host, args.base_url)) current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='0311') assert '=0311' in current assert '=0307' in reviewed # If '--against-reviewed' is 'last', search for the latest finished current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='last') assert '=0313' in current assert '=0307' in reviewed
def test_non_number_build_nr_also_finds_valid_review_build_urls(): args = cache_test_args_factory() args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "live") args.job_group_urls = args.host + "/group_overview/27" browser = browser_factory(args) current, reviewed = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls, against_reviewed="last") assert "=0104%400351" in current # i.e. escaped '0104@0351' assert "=0097%400305" in reviewed # if no review comments are found we revert to the last two finished args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "live_no_review") browser = browser_factory(args) current, reviewed = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls, against_reviewed="last") assert "=0104%400351" in current # i.e. escaped '0104@0351' assert "=0104%400350" in reviewed # no review comments found, reverting to last two finished
def test_also_dotted_builds_can_be_specified_and_appear_in_report(): args = cache_test_args_factory() args.job_group_urls = args.host + '/group_overview/26' browser = browser_factory(args) current, reviewed = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls, against_reviewed='last') assert '=170.1' in current assert '=162.2' in reviewed
def test_builds_with_lower_number_but_more_recent_version_get_compared_correctly(): args = cache_test_args_factory() args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'multi_version') args.job_group_urls = 'http://openqa.suse.de/group_overview/139' browser = browser_factory(args) current, reviewed = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls) assert '=0109' in current assert '=0456' in reviewed
def test_get_build_urls_on_openqa_dashboard_after_61b4db60(): args = cache_test_args_factory() args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "openqa_dashboard_after_61b4db60") args.job_group_urls = args.host + "/group_overview/1" browser = browser_factory(args) current, last = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls) assert "=20160927" in current assert "=20160926" in last
def test_non_number_build_nr_also_finds_valid_review_build_urls(): args = cache_test_args_factory() args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'live') args.job_group_urls = args.host + '/group_overview/27' browser = openqa_review.Browser(args, urljoin(args.host, args.base_url)) current, reviewed = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls, against_reviewed='last') assert '=0104%400351' in current # i.e. escaped '0104@0351' assert '=0104%400350' in reviewed # not available anymore, reverting to last two finished
def test_get_build_urls_on_openqa_dashboard_after_61b4db60(): args = cache_test_args_factory() args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'openqa_dashboard_after_61b4db60') args.job_group_urls = args.host + '/group_overview/1' browser = browser_factory(args) current, last = openqa_review.get_build_urls_to_compare(browser, args.job_group_urls) assert '=20160927' in current assert '=20160926' in last
def test_non_number_build_nr_also_finds_valid_review_build_urls(): args = cache_test_args_factory() args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'live') args.job_group_urls = args.host + '/group_overview/27' browser = openqa_review.Browser(args, urljoin(args.host, args.base_url)) current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='last') assert '=0104%400351' in current # i.e. escaped '0104@0351' assert '=0104%400350' in reviewed # not available anymore, reverting to last two finished