Exemple #1
0
def test_teamsize_on_issues_display():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comm = parse_comments(issues)
    data = issues.merge(comm, how="outer")
    a = teamsize(data, "id", "author", "created_at")
    display(a, show_plots=False)
    assert True
Exemple #2
0
def test_activity_display_multiple_dfs():
    repo = parse_repositories(PATH_TO_RESOURCES + "repo")
    mail = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comm = parse_comments(issues)
    repo_a = activity(repo, "id", "author_name", "date")
    mail_a = activity(mail, "message_id", "sender_name", "date")
    issues_a = activity(issues.merge(comm, how="outer"), "id", "author", "created_at")
    display([repo_a, mail_a, issues_a], show_plots=False)
    assert True
Exemple #3
0
def test_teamsize_on_issues_with_commenters_cols():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    data = parse_comments(issues)
    a = teamsize(data, "id", "author", "created_at")
    assert a.dataframe.columns.tolist() == [
        "date",
        "entry_count",
        "author_count",
        "entry_count_lowess",
        "author_count_lowess",
    ]
Exemple #4
0
def test_display_multiple_types_with_multiple_dfs():
    data = parse_issues(PATH_TO_RESOURCES + "issues.json")
    a = centrality(data, "id", "author", "created_at", "discussion", name="mixih")
    b = centrality(
        parse_issues(PATH_TO_RESOURCES + "issues2.json"), "id", "author", "created_at", "discussion", name="asu"
    )
    path = PATH_TO_RESOURCES + "repo"
    if not os.listdir(path):
        raise Exception("Empty git submodule. Try: git submodule update --init")
    repo = parse_repositories(path)
    c = network(repo, "author_name", "files")
    mail = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    d = network(mail, "sender_name", "references", "message_id")
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    e = network(issues, "author", "discussion")
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comm = parse_comments(issues)
    data = issues.merge(comm, how="outer")
    f = teamsize(data, "id", "author", "created_at")
    g = teamsize(parse_issues(PATH_TO_RESOURCES + "issues2.json"), "id", "author", "created_at")
    display([a, b, c, d, e, f, g], show_plots=False)
    assert True
Exemple #5
0
def test_teamsize_on_issue_comments_row_count():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    data = parse_comments(issues)
    a = teamsize(data, "id", "author", "created_at")
    assert len(a.dataframe.index) == 71
Exemple #6
0
def test_teamsize_on_issues_with_commenters_and_reporters():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comments = parse_comments(issues)
    data = issues.merge(comments, how="outer")
    a = teamsize(data, "id", "author", "created_at")
    assert len(a.dataframe.index) == 79
Exemple #7
0
def test_teamsize_on_issues_with_commenters_vs_reporters():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comments = parse_comments(issues)
    comm = teamsize(comments, "id", "author", "created_at")
    rep = teamsize(issues, "id", "author", "created_at")
    assert not comm.dataframe.equals(rep.dataframe)
Exemple #8
0
from argparse import ArgumentParser
import comdaan as cd

if __name__ == "__main__":
    # Fetching arguments from command line
    arg_parser = ArgumentParser(description="A tool for visualizing, week by week, who contributes code")
    arg_parser.add_argument(
        "paths",
        metavar="path",
        nargs="+",
        help="Path of a git repository to process or of a directory containing git repositories",
    )
    arg_parser.add_argument("-f", "--start", help="Start date")
    arg_parser.add_argument("-u", "--end", help="End date")
    arg_parser.add_argument(
        "--palette", choices=["blue4", "magma256"], default="magma", help="Choose a palette (default is magma256)"
    )
    arg_parser.add_argument("-t", "--title", help="Title")
    arg_parser.add_argument("-o", "--output", help="Output file (default is 'result.html')")
    args = arg_parser.parse_args()

    start_date = args.start
    end_date = args.end
    output_filename = args.output or "result.html"

    issues = cd.parse_issues(args.paths, start_date, end_date)
    comments = cd.parse_comments(issues)
    data = issues.merge(comments, how="outer")
    a = cd.teamsize(data, "id", "author", "created_at")
    cd.display(a, palette=args.palette, output=output_filename)
Exemple #9
0
def test_activity_on_issues_with_commenters_cols():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    data = parse_comments(issues)
    a = activity(data, "id", "author", "created_at")
    assert a.dataframe.columns.tolist() == ["name", "date", "count", "week_name"]
Exemple #10
0
def test_activity_on_issues_all_actors_count():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comments = parse_comments(issues)
    data = issues.merge(comments, how="outer")
    a = activity(data, "id", "author", "created_at")
    assert len(a.authors) == 30
Exemple #11
0
def test_activity_on_issues_with_commenters_and_reporters():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comments = parse_comments(issues)
    data = issues.merge(comments, how="outer")
    a = activity(data, "id", "author", "created_at")
    assert len(a.dataframe.index) == 204  # 204 is the size of the corresponding dataframe.
Exemple #12
0
def test_activity_on_issues_commenters_count():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    data = parse_comments(issues)
    a = activity(data, "id", "author", "created_at")
    assert len(a.authors) == 27