From 56dbdaa77258358ac4790dcbc169c019ae77b20f Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Thu, 23 Apr 2020 00:11:52 +0200 Subject: [PATCH] Add a basic integration test to make sure everything runs without exceptions Fixes #17 --- tests/test_integration.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index 9f84a07..b84213c 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -7,7 +7,7 @@ from adr.configuration import Configuration from adr.query import run_query from mozci import task -from mozci.push import Push +from mozci.push import Push, make_push_objects pytestmark = pytest.mark.skipif( os.environ.get("TRAVIS_EVENT_TYPE") != "cron", reason="Not run by a cron task" @@ -36,6 +36,28 @@ file = { driver = "file", path = "%s" } return Configuration(path=config_file) +def test_create_pushes_and_get_regressions(): + """ + An integration test mimicking the mozci usage done by bugbug. + """ + pushes = make_push_objects( + from_date="today-7day", to_date="today-6day", branch="autoland", + ) + + assert len(pushes) > 0 + + push = pushes[round(len(pushes) / 2)] + + assert len(push.task_labels) > 0 + assert len(push.group_summaries) > 0 + + push.get_possible_regressions("label") + push.get_possible_regressions("group") + + push.get_likely_regressions("label") + push.get_likely_regressions("group") + + def test_missing_manifests(): """ Ensure all suites (except a blacklist) are generating manifest information.