예제 #1
0
    def test_regression_info(self) -> None:
        self.assertEqual(
            """\
----- Historic stats comparison result ------

    job: foo_job
    commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Commit graph (base is most recent master ancestor with at least one S3 report):

    : (master)
    |
    | * aaaaaaaaaa (HEAD)            total time     3.02s
    |/
    * bbbbbbbbbb (base)   1 report,  total time    41.00s
    * cccccccccc          1 report,  total time    43.00s
    |
    :

Removed  (across    1 suite)      1 test,  totaling -   1.00s
Modified (across    1 suite)      1 test,  totaling -  41.48s ±   2.12s
Added    (across    1 suite)      1 test,  totaling +   3.00s
""",
            print_test_stats.regression_info(
                head_sha=fakehash("a"),
                head_report=make_report_v1({
                    "Foo": [
                        makecase("test_foo", 0.02, skipped=True),
                        makecase("test_baz", 3),
                    ]
                }),
                base_reports={
                    fakehash("b"): [
                        make_report_v1({
                            "Foo": [
                                makecase("test_foo", 40),
                                makecase("test_bar", 1),
                            ],
                        }),
                    ],
                    fakehash("c"): [
                        make_report_v1({
                            "Foo": [
                                makecase("test_foo", 43),
                            ],
                        }),
                    ],
                },
                job_name="foo_job",
                on_master=False,
                ancestry_path=0,
                other_ancestors=0,
            ),
        )
예제 #2
0
    def test_regression_info_new_job(self) -> None:
        self.assertEqual(
            """\
----- Historic stats comparison result ------

    job: foo_job
    commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Commit graph (base is most recent master ancestor with at least one S3 report):

    : (master)
    |
    | * aaaaaaaaaa (HEAD)            total time     3.02s
    | |
    | : (3 commits)
    |/|
    | : (2 commits)
    |
    * bbbbbbbbbb          0 reports
    * cccccccccc          0 reports
    |
    :

Removed  (across    0 suites)     0 tests, totaling     0.00s
Modified (across    0 suites)     0 tests, totaling     0.00s
Added    (across    1 suite)      2 tests, totaling +   3.02s
""",
            print_test_stats.regression_info(
                head_sha=fakehash("a"),
                head_report=make_report_v1({
                    "Foo": [
                        makecase("test_foo", 0.02, skipped=True),
                        makecase("test_baz", 3),
                    ]
                }),
                base_reports={
                    fakehash("b"): [],
                    fakehash("c"): [],
                },
                job_name="foo_job",
                on_master=False,
                ancestry_path=3,
                other_ancestors=2,
            ),
        )