Exemple #1
0
    def test_regression_info_new_job(self):
        self.assertEqual(
            '''\
----- Historic stats comparison result ------

    job: foo_job
    commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


+ class Foo:
+     # now    3.02s
+
+     def test_baz: ...
+         # now   3.000s
+
+     def test_foo: ...
+         # now   0.020s           (skipped)


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,
            )
        )
Exemple #2
0
    def test_regression_info(self):
        self.assertEqual(
            '''\
----- Historic stats comparison result ------

    job: foo_job
    commit: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


  class Foo:
      # was   42.50s ±   2.12s
      # now    3.02s

    - def test_bar: ...
    -     # was   1.000s

    ! def test_foo: ...
    !     # was  41.500s ±  2.121s
    !     # now   0.020s           (skipped)

    + def test_baz: ...
    +     # now   3.000s


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,
            )
        )