예제 #1
0
def test_calculate_experiences():
    commits = [
        repository.Commit(
            node="commit1",
            author="author1",
            desc="commit1",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file1.cpp", "apps/file1.jsm"],
            file_copies={},
            reviewers=("reviewer1", "reviewer2"),
        ),
        repository.Commit(
            node="commit2",
            author="author2",
            desc="commit2",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file1.cpp"],
            file_copies={},
            reviewers=("reviewer1",),
        ),
        repository.Commit(
            node="commit3",
            author="author1",
            desc="commit3",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file2.cpp", "apps/file1.jsm"],
            file_copies={},
            reviewers=("reviewer2",),
        ),
        repository.Commit(
            node="commit4",
            author="author2",
            desc="commit4",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2020, 1, 1),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file1.cpp", "apps/file2.jsm"],
            file_copies={},
            reviewers=("reviewer1", "reviewer2"),
        ),
        repository.Commit(
            node="commit5",
            author="author3",
            desc="commit5",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2020, 1, 2),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file1.cpp"],
            file_copies={"dom/file1.cpp": "dom/file1copied.cpp"},
            reviewers=("reviewer3",),
        ),
        repository.Commit(
            node="commit6",
            author="author3",
            desc="commit6",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2020, 1, 3),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file1.cpp", "dom/file1copied.cpp"],
            file_copies={},
            reviewers=("reviewer3",),
        ),
    ]

    repository.path_to_component = {
        "dom/file1.cpp": "Core::DOM",
        "dom/file1copied.cpp": "Core::DOM",
        "dom/file2.cpp": "Core::Layout",
        "apps/file1.jsm": "Firefox::Boh",
        "apps/file2.jsm": "Firefox::Boh",
    }

    repository.calculate_experiences(commits)

    assert repository.experiences_by_commit["total"]["author"]["commit1"] == 0
    assert repository.experiences_by_commit["total"]["author"]["commit2"] == 0
    assert repository.experiences_by_commit["total"]["author"]["commit3"] == 1
    assert repository.experiences_by_commit["total"]["author"]["commit4"] == 1
    assert repository.experiences_by_commit["total"]["author"]["commit5"] == 0
    assert repository.experiences_by_commit["total"]["author"]["commit6"] == 1

    assert repository.experiences_by_commit["90_days"]["author"]["commit1"] == 0
    assert repository.experiences_by_commit["90_days"]["author"]["commit2"] == 0
    assert repository.experiences_by_commit["90_days"]["author"]["commit3"] == 1
    assert repository.experiences_by_commit["90_days"]["author"]["commit4"] == 0
    assert repository.experiences_by_commit["90_days"]["author"]["commit5"] == 0
    assert repository.experiences_by_commit["90_days"]["author"]["commit6"] == 1

    assert repository.experiences_by_commit["total"]["reviewer"]["commit1"] == 0
    assert repository.experiences_by_commit["total"]["reviewer"]["commit2"] == 1
    assert repository.experiences_by_commit["total"]["reviewer"]["commit3"] == 1
    assert repository.experiences_by_commit["total"]["reviewer"]["commit4"] == 4
    assert repository.experiences_by_commit["total"]["reviewer"]["commit5"] == 0
    assert repository.experiences_by_commit["total"]["reviewer"]["commit6"] == 1

    assert repository.experiences_by_commit["90_days"]["reviewer"]["commit1"] == 0
    assert repository.experiences_by_commit["90_days"]["reviewer"]["commit2"] == 1
    assert repository.experiences_by_commit["90_days"]["reviewer"]["commit3"] == 1
    assert repository.experiences_by_commit["90_days"]["reviewer"]["commit4"] == 0
    assert repository.experiences_by_commit["90_days"]["reviewer"]["commit5"] == 0
    assert repository.experiences_by_commit["90_days"]["reviewer"]["commit6"] == 1

    assert repository.experiences_by_commit["total"]["file"]["commit1"] == 0
    assert repository.experiences_by_commit["total"]["file"]["commit2"] == 1
    assert repository.experiences_by_commit["total"]["file"]["commit3"] == 1
    assert repository.experiences_by_commit["total"]["file"]["commit4"] == 2
    assert repository.experiences_by_commit["total"]["file"]["commit5"] == 3
    assert repository.experiences_by_commit["total"]["file"]["commit6"] == 4

    assert repository.experiences_by_commit["90_days"]["file"]["commit1"] == 0
    assert repository.experiences_by_commit["90_days"]["file"]["commit2"] == 1
    assert repository.experiences_by_commit["90_days"]["file"]["commit3"] == 1
    assert repository.experiences_by_commit["90_days"]["file"]["commit4"] == 0
    assert repository.experiences_by_commit["90_days"]["file"]["commit5"] == 1
    assert repository.experiences_by_commit["90_days"]["file"]["commit6"] == 2

    assert repository.experiences_by_commit["total"]["directory"]["commit1"] == 0
    assert repository.experiences_by_commit["total"]["directory"]["commit2"] == 1
    assert repository.experiences_by_commit["total"]["directory"]["commit3"] == 2
    assert repository.experiences_by_commit["total"]["directory"]["commit4"] == 3
    assert repository.experiences_by_commit["total"]["directory"]["commit5"] == 4
    assert repository.experiences_by_commit["total"]["directory"]["commit6"] == 5

    assert repository.experiences_by_commit["90_days"]["directory"]["commit1"] == 0
    assert repository.experiences_by_commit["90_days"]["directory"]["commit2"] == 1
    assert repository.experiences_by_commit["90_days"]["directory"]["commit3"] == 2
    assert repository.experiences_by_commit["90_days"]["directory"]["commit4"] == 0
    assert repository.experiences_by_commit["90_days"]["directory"]["commit5"] == 1
    assert repository.experiences_by_commit["90_days"]["directory"]["commit6"] == 2

    assert repository.experiences_by_commit["total"]["component"]["commit1"] == 0
    assert repository.experiences_by_commit["total"]["component"]["commit2"] == 1
    assert repository.experiences_by_commit["total"]["component"]["commit3"] == 1
    assert repository.experiences_by_commit["total"]["component"]["commit4"] == 3
    assert repository.experiences_by_commit["total"]["component"]["commit5"] == 3
    assert repository.experiences_by_commit["total"]["component"]["commit6"] == 4

    assert repository.experiences_by_commit["90_days"]["component"]["commit1"] == 0
    assert repository.experiences_by_commit["90_days"]["component"]["commit2"] == 1
    assert repository.experiences_by_commit["90_days"]["component"]["commit3"] == 1
    assert repository.experiences_by_commit["90_days"]["component"]["commit4"] == 0
    assert repository.experiences_by_commit["90_days"]["component"]["commit5"] == 1
    assert repository.experiences_by_commit["90_days"]["component"]["commit6"] == 2
예제 #2
0
def test_calculate_experiences():
    repository.path_to_component = {
        "dom/file1.cpp": "Core::DOM",
        "dom/file1copied.cpp": "Core::DOM",
        "dom/file2.cpp": "Core::Layout",
        "apps/file1.jsm": "Firefox::Boh",
        "apps/file2.jsm": "Firefox::Boh",
    }

    commits = {
        "commit1":
        repository.Commit(
            node="commit1",
            author="author1",
            desc="commit1",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug_id=123,
            backedoutby="",
            author_email="*****@*****.**",
            reviewers=("reviewer1", "reviewer2"),
        ).set_files(["dom/file1.cpp", "apps/file1.jsm"], {}),
        "commitbackedout":
        repository.Commit(
            node="commitbackedout",
            author="author1",
            desc="commitbackedout",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug_id=123,
            backedoutby="commitbackout",
            author_email="*****@*****.**",
            reviewers=("reviewer1", "reviewer2"),
        ).set_files(["dom/file1.cpp", "apps/file1.jsm"], {}),
        "commit2":
        repository.Commit(
            node="commit2",
            author="author2",
            desc="commit2",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug_id=123,
            backedoutby="",
            author_email="*****@*****.**",
            reviewers=("reviewer1", ),
        ).set_files(["dom/file1.cpp"], {}),
        "commit2refactoring":
        repository.Commit(
            node="commit2refactoring",
            author="author2",
            desc="commit2refactoring",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug_id=123,
            backedoutby="",
            author_email="*****@*****.**",
            reviewers=("reviewer1", ),
            ignored=True,
        ).set_files(["dom/file1.cpp"], {}),
        "commit3":
        repository.Commit(
            node="commit3",
            author="author1",
            desc="commit3",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug_id=123,
            backedoutby="",
            author_email="*****@*****.**",
            reviewers=("reviewer2", ),
        ).set_files(["dom/file2.cpp", "apps/file1.jsm"], {}),
        "commit4":
        repository.Commit(
            node="commit4",
            author="author2",
            desc="commit4",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2020, 1, 1),
            bug_id=123,
            backedoutby="",
            author_email="*****@*****.**",
            reviewers=("reviewer1", "reviewer2"),
        ).set_files(["dom/file1.cpp", "apps/file2.jsm"], {}),
        "commit5":
        repository.Commit(
            node="commit5",
            author="author3",
            desc="commit5",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2020, 1, 2),
            bug_id=123,
            backedoutby="",
            author_email="*****@*****.**",
            reviewers=("reviewer3", ),
        ).set_files(["dom/file1.cpp"],
                    {"dom/file1.cpp": "dom/file1copied.cpp"}),
        "commit6":
        repository.Commit(
            node="commit6",
            author="author3",
            desc="commit6",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2020, 1, 3),
            bug_id=123,
            backedoutby="",
            author_email="*****@*****.**",
            reviewers=("reviewer3", ),
        ).set_files(["dom/file1.cpp", "dom/file1copied.cpp"], {}),
    }

    repository.calculate_experiences(commits.values(), datetime(2019, 1, 1))

    assert commits["commit1"].seniority_author == 0
    assert commits["commitbackedout"].seniority_author == 0
    assert commits["commit2"].seniority_author == 0
    assert commits["commit3"].seniority_author == 0
    assert commits["commit4"].seniority_author == 86400.0 * 365
    assert commits["commit5"].seniority_author == 0
    assert commits["commit6"].seniority_author == 86400.0

    assert commits["commit1"].touched_prev_total_author_sum == 0
    assert commits["commit2"].touched_prev_total_author_sum == 0
    assert commits["commit3"].touched_prev_total_author_sum == 1
    assert commits["commit4"].touched_prev_total_author_sum == 1
    assert commits["commit5"].touched_prev_total_author_sum == 0
    assert commits["commit6"].touched_prev_total_author_sum == 1

    assert commits["commit1"].touched_prev_90_days_author_sum == 0
    assert commits["commit2"].touched_prev_90_days_author_sum == 0
    assert commits["commit3"].touched_prev_90_days_author_sum == 1
    assert commits["commit4"].touched_prev_90_days_author_sum == 0
    assert commits["commit5"].touched_prev_90_days_author_sum == 0
    assert commits["commit6"].touched_prev_90_days_author_sum == 1

    assert commits["commit1"].touched_prev_total_reviewer_sum == 0
    assert commits["commit1"].touched_prev_total_reviewer_max == 0
    assert commits["commit1"].touched_prev_total_reviewer_min == 0
    assert commits["commit2"].touched_prev_total_reviewer_sum == 1
    assert commits["commit2"].touched_prev_total_reviewer_max == 1
    assert commits["commit2"].touched_prev_total_reviewer_min == 1
    assert commits["commit3"].touched_prev_total_reviewer_sum == 1
    assert commits["commit3"].touched_prev_total_reviewer_max == 1
    assert commits["commit3"].touched_prev_total_reviewer_min == 1
    assert commits["commit4"].touched_prev_total_reviewer_sum == 4
    assert commits["commit4"].touched_prev_total_reviewer_max == 2
    assert commits["commit4"].touched_prev_total_reviewer_min == 2
    assert commits["commit5"].touched_prev_total_reviewer_sum == 0
    assert commits["commit5"].touched_prev_total_reviewer_max == 0
    assert commits["commit5"].touched_prev_total_reviewer_min == 0
    assert commits["commit6"].touched_prev_total_reviewer_sum == 1
    assert commits["commit6"].touched_prev_total_reviewer_max == 1
    assert commits["commit6"].touched_prev_total_reviewer_min == 1

    assert commits["commit1"].touched_prev_90_days_reviewer_sum == 0
    assert commits["commit1"].touched_prev_90_days_reviewer_max == 0
    assert commits["commit1"].touched_prev_90_days_reviewer_min == 0
    assert commits["commit2"].touched_prev_90_days_reviewer_sum == 1
    assert commits["commit2"].touched_prev_90_days_reviewer_max == 1
    assert commits["commit2"].touched_prev_90_days_reviewer_min == 1
    assert commits["commit3"].touched_prev_90_days_reviewer_sum == 1
    assert commits["commit3"].touched_prev_90_days_reviewer_max == 1
    assert commits["commit3"].touched_prev_90_days_reviewer_min == 1
    assert commits["commit4"].touched_prev_90_days_reviewer_sum == 0
    assert commits["commit4"].touched_prev_90_days_reviewer_max == 0
    assert commits["commit4"].touched_prev_90_days_reviewer_min == 0
    assert commits["commit5"].touched_prev_90_days_reviewer_sum == 0
    assert commits["commit5"].touched_prev_90_days_reviewer_max == 0
    assert commits["commit5"].touched_prev_90_days_reviewer_min == 0
    assert commits["commit6"].touched_prev_90_days_reviewer_sum == 1
    assert commits["commit6"].touched_prev_90_days_reviewer_max == 1
    assert commits["commit6"].touched_prev_90_days_reviewer_min == 1

    assert commits["commit1"].touched_prev_total_file_sum == 0
    assert commits["commit1"].touched_prev_total_file_max == 0
    assert commits["commit1"].touched_prev_total_file_min == 0
    assert commits["commit2"].touched_prev_total_file_sum == 1
    assert commits["commit2"].touched_prev_total_file_max == 1
    assert commits["commit2"].touched_prev_total_file_min == 1
    assert commits["commit3"].touched_prev_total_file_sum == 1
    assert commits["commit3"].touched_prev_total_file_max == 1
    assert commits["commit3"].touched_prev_total_file_min == 0
    assert commits["commit4"].touched_prev_total_file_sum == 2
    assert commits["commit4"].touched_prev_total_file_max == 2
    assert commits["commit4"].touched_prev_total_file_min == 0
    assert commits["commit5"].touched_prev_total_file_sum == 3
    assert commits["commit5"].touched_prev_total_file_max == 3
    assert commits["commit5"].touched_prev_total_file_min == 3
    assert commits["commit6"].touched_prev_total_file_sum == 4
    assert commits["commit6"].touched_prev_total_file_max == 4
    assert commits["commit6"].touched_prev_total_file_min == 3

    assert commits["commit1"].touched_prev_90_days_file_sum == 0
    assert commits["commit1"].touched_prev_90_days_file_max == 0
    assert commits["commit1"].touched_prev_90_days_file_min == 0
    assert commits["commit2"].touched_prev_90_days_file_sum == 1
    assert commits["commit2"].touched_prev_90_days_file_max == 1
    assert commits["commit2"].touched_prev_90_days_file_min == 1
    assert commits["commit3"].touched_prev_90_days_file_sum == 1
    assert commits["commit3"].touched_prev_90_days_file_max == 1
    assert commits["commit3"].touched_prev_90_days_file_min == 0
    assert commits["commit4"].touched_prev_90_days_file_sum == 0
    assert commits["commit4"].touched_prev_90_days_file_max == 0
    assert commits["commit4"].touched_prev_90_days_file_min == 0
    assert commits["commit5"].touched_prev_90_days_file_sum == 1
    assert commits["commit5"].touched_prev_90_days_file_max == 1
    assert commits["commit5"].touched_prev_90_days_file_min == 1
    assert commits["commit6"].touched_prev_90_days_file_sum == 2
    assert commits["commit6"].touched_prev_90_days_file_max == 2
    assert commits["commit6"].touched_prev_90_days_file_min == 1

    assert commits["commit1"].touched_prev_total_directory_sum == 0
    assert commits["commit1"].touched_prev_total_directory_max == 0
    assert commits["commit1"].touched_prev_total_directory_min == 0
    assert commits["commit2"].touched_prev_total_directory_sum == 1
    assert commits["commit2"].touched_prev_total_directory_max == 1
    assert commits["commit2"].touched_prev_total_directory_min == 1
    assert commits["commit3"].touched_prev_total_directory_sum == 2
    assert commits["commit3"].touched_prev_total_directory_max == 2
    assert commits["commit3"].touched_prev_total_directory_min == 1
    assert commits["commit4"].touched_prev_total_directory_sum == 3
    assert commits["commit4"].touched_prev_total_directory_max == 3
    assert commits["commit4"].touched_prev_total_directory_min == 2
    assert commits["commit5"].touched_prev_total_directory_sum == 4
    assert commits["commit5"].touched_prev_total_directory_max == 4
    assert commits["commit5"].touched_prev_total_directory_min == 4
    assert commits["commit6"].touched_prev_total_directory_sum == 5
    assert commits["commit6"].touched_prev_total_directory_max == 5
    assert commits["commit6"].touched_prev_total_directory_min == 5

    assert commits["commit1"].touched_prev_90_days_directory_sum == 0
    assert commits["commit1"].touched_prev_90_days_directory_max == 0
    assert commits["commit1"].touched_prev_90_days_directory_min == 0
    assert commits["commit2"].touched_prev_90_days_directory_sum == 1
    assert commits["commit2"].touched_prev_90_days_directory_max == 1
    assert commits["commit2"].touched_prev_90_days_directory_min == 1
    assert commits["commit3"].touched_prev_90_days_directory_sum == 2
    assert commits["commit3"].touched_prev_90_days_directory_max == 2
    assert commits["commit3"].touched_prev_90_days_directory_min == 1
    assert commits["commit4"].touched_prev_90_days_directory_sum == 0
    assert commits["commit4"].touched_prev_90_days_directory_max == 0
    assert commits["commit4"].touched_prev_90_days_directory_min == 0
    assert commits["commit5"].touched_prev_90_days_directory_sum == 1
    assert commits["commit5"].touched_prev_90_days_directory_max == 1
    assert commits["commit5"].touched_prev_90_days_directory_min == 1
    assert commits["commit6"].touched_prev_90_days_directory_sum == 2
    assert commits["commit6"].touched_prev_90_days_directory_max == 2
    assert commits["commit6"].touched_prev_90_days_directory_min == 2

    assert commits["commit1"].touched_prev_total_component_sum == 0
    assert commits["commit1"].touched_prev_total_component_max == 0
    assert commits["commit1"].touched_prev_total_component_min == 0
    assert commits["commit2"].touched_prev_total_component_sum == 1
    assert commits["commit2"].touched_prev_total_component_max == 1
    assert commits["commit2"].touched_prev_total_component_min == 1
    assert commits["commit3"].touched_prev_total_component_sum == 1
    assert commits["commit3"].touched_prev_total_component_max == 1
    assert commits["commit3"].touched_prev_total_component_min == 0
    assert commits["commit4"].touched_prev_total_component_sum == 3
    assert commits["commit4"].touched_prev_total_component_max == 2
    assert commits["commit4"].touched_prev_total_component_min == 2
    assert commits["commit5"].touched_prev_total_component_sum == 3
    assert commits["commit5"].touched_prev_total_component_max == 3
    assert commits["commit5"].touched_prev_total_component_min == 3
    assert commits["commit6"].touched_prev_total_component_sum == 4
    assert commits["commit6"].touched_prev_total_component_max == 4
    assert commits["commit6"].touched_prev_total_component_min == 4

    assert commits["commit1"].touched_prev_90_days_component_sum == 0
    assert commits["commit1"].touched_prev_90_days_component_max == 0
    assert commits["commit1"].touched_prev_90_days_component_min == 0
    assert commits["commit2"].touched_prev_90_days_component_sum == 1
    assert commits["commit2"].touched_prev_90_days_component_max == 1
    assert commits["commit2"].touched_prev_90_days_component_min == 1
    assert commits["commit3"].touched_prev_90_days_component_sum == 1
    assert commits["commit3"].touched_prev_90_days_component_max == 1
    assert commits["commit3"].touched_prev_90_days_component_min == 0
    assert commits["commit4"].touched_prev_90_days_component_sum == 0
    assert commits["commit4"].touched_prev_90_days_component_max == 0
    assert commits["commit4"].touched_prev_90_days_component_min == 0
    assert commits["commit5"].touched_prev_90_days_component_sum == 1
    assert commits["commit5"].touched_prev_90_days_component_max == 1
    assert commits["commit5"].touched_prev_90_days_component_min == 1
    assert commits["commit6"].touched_prev_90_days_component_sum == 2
    assert commits["commit6"].touched_prev_90_days_component_max == 2
    assert commits["commit6"].touched_prev_90_days_component_min == 2
예제 #3
0
def test_calculate_experiences():
    commits = [
        repository.Commit(
            node="commit1",
            author="author1",
            desc="commit1",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file1.cpp", "apps/file1.jsm"],
            file_copies={},
            reviewers=("reviewer1", "reviewer2"),
        ),
        repository.Commit(
            node="commit2",
            author="author2",
            desc="commit2",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file1.cpp"],
            file_copies={},
            reviewers=("reviewer1", ),
        ),
        repository.Commit(
            node="commit3",
            author="author1",
            desc="commit3",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2019, 1, 1),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file2.cpp", "apps/file1.jsm"],
            file_copies={},
            reviewers=("reviewer2", ),
        ),
        repository.Commit(
            node="commit4",
            author="author2",
            desc="commit4",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2020, 1, 1),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file1.cpp", "apps/file2.jsm"],
            file_copies={},
            reviewers=("reviewer1", "reviewer2"),
        ),
        repository.Commit(
            node="commit5",
            author="author3",
            desc="commit5",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2020, 1, 2),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file1.cpp"],
            file_copies={"dom/file1.cpp": "dom/file1copied.cpp"},
            reviewers=("reviewer3", ),
        ),
        repository.Commit(
            node="commit6",
            author="author3",
            desc="commit6",
            date=datetime(2019, 1, 1),
            pushdate=datetime(2020, 1, 3),
            bug="123",
            backedoutby="",
            author_email="*****@*****.**",
            files=["dom/file1.cpp", "dom/file1copied.cpp"],
            file_copies={},
            reviewers=("reviewer3", ),
        ),
    ]

    repository.path_to_component = {
        "dom/file1.cpp": "Core::DOM",
        "dom/file1copied.cpp": "Core::DOM",
        "dom/file2.cpp": "Core::Layout",
        "apps/file1.jsm": "Firefox::Boh",
        "apps/file2.jsm": "Firefox::Boh",
    }

    repository.calculate_experiences(commits)

    assert repository.experiences_by_commit["total"]["author"]["commit1"] == 0
    assert repository.experiences_by_commit["total"]["author"]["commit2"] == 0
    assert repository.experiences_by_commit["total"]["author"]["commit3"] == 1
    assert repository.experiences_by_commit["total"]["author"]["commit4"] == 1
    assert repository.experiences_by_commit["total"]["author"]["commit5"] == 0
    assert repository.experiences_by_commit["total"]["author"]["commit6"] == 1

    assert repository.experiences_by_commit["90_days"]["author"][
        "commit1"] == 0
    assert repository.experiences_by_commit["90_days"]["author"][
        "commit2"] == 0
    assert repository.experiences_by_commit["90_days"]["author"][
        "commit3"] == 1
    assert repository.experiences_by_commit["90_days"]["author"][
        "commit4"] == 0
    assert repository.experiences_by_commit["90_days"]["author"][
        "commit5"] == 0
    assert repository.experiences_by_commit["90_days"]["author"][
        "commit6"] == 1

    assert repository.experiences_by_commit["total"]["reviewer"][
        "commit1"] == 0
    assert repository.experiences_by_commit["total"]["reviewer"][
        "commit2"] == 1
    assert repository.experiences_by_commit["total"]["reviewer"][
        "commit3"] == 1
    assert repository.experiences_by_commit["total"]["reviewer"][
        "commit4"] == 4
    assert repository.experiences_by_commit["total"]["reviewer"][
        "commit5"] == 0
    assert repository.experiences_by_commit["total"]["reviewer"][
        "commit6"] == 1

    assert repository.experiences_by_commit["90_days"]["reviewer"][
        "commit1"] == 0
    assert repository.experiences_by_commit["90_days"]["reviewer"][
        "commit2"] == 1
    assert repository.experiences_by_commit["90_days"]["reviewer"][
        "commit3"] == 1
    assert repository.experiences_by_commit["90_days"]["reviewer"][
        "commit4"] == 0
    assert repository.experiences_by_commit["90_days"]["reviewer"][
        "commit5"] == 0
    assert repository.experiences_by_commit["90_days"]["reviewer"][
        "commit6"] == 1

    assert repository.experiences_by_commit["total"]["file"]["commit1"] == 0
    assert repository.experiences_by_commit["total"]["file"]["commit2"] == 1
    assert repository.experiences_by_commit["total"]["file"]["commit3"] == 1
    assert repository.experiences_by_commit["total"]["file"]["commit4"] == 2
    assert repository.experiences_by_commit["total"]["file"]["commit5"] == 3
    assert repository.experiences_by_commit["total"]["file"]["commit6"] == 4

    assert repository.experiences_by_commit["90_days"]["file"]["commit1"] == 0
    assert repository.experiences_by_commit["90_days"]["file"]["commit2"] == 1
    assert repository.experiences_by_commit["90_days"]["file"]["commit3"] == 1
    assert repository.experiences_by_commit["90_days"]["file"]["commit4"] == 0
    assert repository.experiences_by_commit["90_days"]["file"]["commit5"] == 1
    assert repository.experiences_by_commit["90_days"]["file"]["commit6"] == 2

    assert repository.experiences_by_commit["total"]["directory"][
        "commit1"] == 0
    assert repository.experiences_by_commit["total"]["directory"][
        "commit2"] == 1
    assert repository.experiences_by_commit["total"]["directory"][
        "commit3"] == 2
    assert repository.experiences_by_commit["total"]["directory"][
        "commit4"] == 3
    assert repository.experiences_by_commit["total"]["directory"][
        "commit5"] == 4
    assert repository.experiences_by_commit["total"]["directory"][
        "commit6"] == 5

    assert repository.experiences_by_commit["90_days"]["directory"][
        "commit1"] == 0
    assert repository.experiences_by_commit["90_days"]["directory"][
        "commit2"] == 1
    assert repository.experiences_by_commit["90_days"]["directory"][
        "commit3"] == 2
    assert repository.experiences_by_commit["90_days"]["directory"][
        "commit4"] == 0
    assert repository.experiences_by_commit["90_days"]["directory"][
        "commit5"] == 1
    assert repository.experiences_by_commit["90_days"]["directory"][
        "commit6"] == 2

    assert repository.experiences_by_commit["total"]["component"][
        "commit1"] == 0
    assert repository.experiences_by_commit["total"]["component"][
        "commit2"] == 1
    assert repository.experiences_by_commit["total"]["component"][
        "commit3"] == 1
    assert repository.experiences_by_commit["total"]["component"][
        "commit4"] == 3
    assert repository.experiences_by_commit["total"]["component"][
        "commit5"] == 3
    assert repository.experiences_by_commit["total"]["component"][
        "commit6"] == 4

    assert repository.experiences_by_commit["90_days"]["component"][
        "commit1"] == 0
    assert repository.experiences_by_commit["90_days"]["component"][
        "commit2"] == 1
    assert repository.experiences_by_commit["90_days"]["component"][
        "commit3"] == 1
    assert repository.experiences_by_commit["90_days"]["component"][
        "commit4"] == 0
    assert repository.experiences_by_commit["90_days"]["component"][
        "commit5"] == 1
    assert repository.experiences_by_commit["90_days"]["component"][
        "commit6"] == 2