Search in sources :

Example 1 with GitScm

use of org.jenkinsci.test.acceptance.plugins.git.GitScm in project acceptance-test-harness by jenkinsci.

the class MultipleScmsPluginTest method checkout_several_scms.

@Test
public void checkout_several_scms() {
    FreeStyleJob job = jenkins.jobs.create();
    job.configure();
    MultipleScms scms = job.useScm(MultipleScms.class);
    GitScm git = scms.addScm(GitScm.class);
    git.url("git://github.com/jenkinsci/acceptance-test-harness.git");
    git.localDir("git-project");
    SubversionScm svn = scms.addScm(SubversionScm.class);
    svn.url.set("http://svn.apache.org/repos/asf/subversion/trunk/build/");
    svn.local.set("svn-project");
    job.addShellStep("test -d svn-project/.svn && test -f git-project/pom.xml");
    job.save();
    job.startBuild().shouldSucceed();
}
Also used : SubversionScm(org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) GitScm(org.jenkinsci.test.acceptance.plugins.git.GitScm) MultipleScms(org.jenkinsci.test.acceptance.plugins.multiple_scms.MultipleScms) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 2 with GitScm

use of org.jenkinsci.test.acceptance.plugins.git.GitScm in project acceptance-test-harness by jenkinsci.

the class GitPluginNoDockerTest method generateJobWithBranch.

private Job generateJobWithBranch(GIT_IMPL type) {
    Job job = generateJob(type);
    GitScm scm = generateSCM(job).branch("recovery");
    useJGitIfNeccesary(type, scm);
    return job;
}
Also used : Job(org.jenkinsci.test.acceptance.po.Job) GitScm(org.jenkinsci.test.acceptance.plugins.git.GitScm)

Example 3 with GitScm

use of org.jenkinsci.test.acceptance.plugins.git.GitScm in project acceptance-test-harness by jenkinsci.

the class GitPluginNoDockerTest method generateSimpleJob.

private Job generateSimpleJob(GIT_IMPL type) {
    Job job = generateJob(type);
    GitScm scm = generateSCM(job);
    useJGitIfNeccesary(type, scm);
    return job;
}
Also used : Job(org.jenkinsci.test.acceptance.po.Job) GitScm(org.jenkinsci.test.acceptance.plugins.git.GitScm)

Example 4 with GitScm

use of org.jenkinsci.test.acceptance.plugins.git.GitScm in project acceptance-test-harness by jenkinsci.

the class GitPluginNoDockerTest method generateJobWithLocalDir.

private Job generateJobWithLocalDir(GIT_IMPL type) {
    Job job = generateJob(type);
    GitScm scm = generateSCM(job).localDir("local_dir");
    useJGitIfNeccesary(type, scm);
    return job;
}
Also used : Job(org.jenkinsci.test.acceptance.po.Job) GitScm(org.jenkinsci.test.acceptance.plugins.git.GitScm)

Example 5 with GitScm

use of org.jenkinsci.test.acceptance.plugins.git.GitScm in project acceptance-test-harness by jenkinsci.

the class GitPluginTest method test_clean_while_checkout.

/**
 * Invoked by {@link #clean_after_checkout()} and {@link #clean_before_checkout()}
 *
 * @param before Select "clean before" or "clean after"
 */
private void test_clean_while_checkout(boolean before) {
    GitRepo repo = buildGitRepo();
    repo.transferToDockerContainer(host, port);
    // configure and build to create untrackedFile.txt
    GitScm git = job.useScm(GitScm.class).url(repoUrl).credentials(USERNAME);
    if (before) {
        git.cleanBeforeCheckout();
    } else {
        git.cleanAfterCheckout();
    }
    job.addShellStep("touch untrackedFile.txt");
    job.save();
    job.startBuild().shouldSucceed();
    // configure and build to test if file has been removed
    job.configure();
    job.removeFirstBuildStep();
    job.addShellStep("ls && test ! -f untrackedFile.txt");
    job.save();
    job.startBuild().shouldSucceed();
}
Also used : GitRepo(org.jenkinsci.test.acceptance.plugins.git.GitRepo) GitScm(org.jenkinsci.test.acceptance.plugins.git.GitScm)

Aggregations

GitScm (org.jenkinsci.test.acceptance.plugins.git.GitScm)10 Job (org.jenkinsci.test.acceptance.po.Job)5 Test (org.junit.Test)4 GitRepo (org.jenkinsci.test.acceptance.plugins.git.GitRepo)3 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)2 MultipleScms (org.jenkinsci.test.acceptance.plugins.multiple_scms.MultipleScms)2 Build (org.jenkinsci.test.acceptance.po.Build)2 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)2 SubversionScm (org.jenkinsci.test.acceptance.plugins.subversion.SubversionScm)1