Exemplo n.º 1
0
    def test_opens_issue_if_update_rejected(self, tmpdir, with_student_repos):
        master_repo = assignment_names[0]
        conflict_repo = plug.generate_repo_name(STUDENT_TEAMS[0], master_repo)
        filename = "superfile.super"
        text = "some epic content\nfor this file!"
        # update the master repo
        update_repo(master_repo, filename, text)
        # conflicting update in the student repo
        update_repo(conflict_repo, "somefile.txt", "some other content")

        issue = plug.Issue(title="Oops, push was rejected!", body="")
        issue_file = pathlib.Path(str(tmpdir)) / "issue.md"
        issue_file.write_text(issue.title)

        command = " ".join([
            *repobee_plug.cli.CoreCommand.repos.update.as_name_tuple(),
            *TEMPLATE_ORG_ARG,
            *BASE_ARGS,
            "-a",
            master_repo,
            *STUDENTS_ARG,
            "--issue",
            issue_file.name,
        ])

        run_repobee(command, workdir=tmpdir, plugins=[_repobee.ext.gitlab])

        assert_repos_contain(STUDENT_TEAMS[1:], [master_repo], filename, text)
        assert_issues_exist(STUDENT_TEAMS[0:1], [master_repo], issue)
Exemplo n.º 2
0
    def test_happy_path(self, with_student_repos, tmpdir):
        master_repo = assignment_names[0]
        filename = "superfile.super"
        text = "some epic content\nfor this file!"
        update_repo(master_repo, filename, text)

        command = " ".join([
            *repobee_plug.cli.CoreCommand.repos.update.as_name_tuple(),
            *TEMPLATE_ORG_ARG,
            *BASE_ARGS,
            "-a",
            master_repo,
            *STUDENTS_ARG,
        ])

        run_repobee(command, workdir=tmpdir, plugins=[_repobee.ext.gitlab])
        assert_repos_contain(STUDENT_TEAMS, [master_repo], filename, text)
Exemplo n.º 3
0
    def test_happy_path(self, with_student_repos, extra_args):
        master_repo = assignment_names[0]
        filename = "superfile.super"
        text = "some epic content\nfor this file!"
        update_repo(master_repo, filename, text)

        command = " ".join([
            REPOBEE_GITLAB,
            *repobee_plug.cli.CoreCommand.repos.update.as_name_tuple(),
            *TEMPLATE_ORG_ARG,
            *BASE_ARGS,
            "-a",
            master_repo,
            *STUDENTS_ARG,
        ])

        result = run_in_docker_with_coverage(command, extra_args=extra_args)
        assert result.returncode == 0
        assert_repos_contain(STUDENT_TEAMS, [master_repo], filename, text)