use of jetbrains.buildServer.vcs.CheckoutRules in project teamcity-git by JetBrains.
the class DiffWithUpperLimitRevisionTest method no_error_when_revisions_are_the_same.
public void no_error_when_revisions_are_the_same() throws Exception {
String version = "ad4528ed5c84092fdbe9e0502163cf8d6e6141e7";
AgentRunningBuild build = createBuild(version, version);
myVcsSupport.updateSources(myRoot, new CheckoutRules("+:.=>dir"), version, myCheckoutDir, build, false);
then(myBuildLogger.getErrors()).isEmpty();
}
use of jetbrains.buildServer.vcs.CheckoutRules in project teamcity-git by JetBrains.
the class DiffWithUpperLimitRevisionTest method error_if_diff_found.
public void error_if_diff_found() throws Exception {
String version = "ad4528ed5c84092fdbe9e0502163cf8d6e6141e7";
AgentRunningBuild build = createBuild(version, "465ad9f630e451b9f2b782ffb09804c6a98c4bb9");
myVcsSupport.updateSources(myRoot, new CheckoutRules("+:dir"), version, myCheckoutDir, build, false);
then(myBuildLogger.getErrors()).isNotEmpty();
then(myBuildLogger.getErrors().iterator().next()).contains("Files matched by checkout rules changed between build revision and upper-limit revision");
}
use of jetbrains.buildServer.vcs.CheckoutRules in project teamcity-git by JetBrains.
the class AgentVcsSupportTest method testSubmodulesCheckoutWithCustomConfig.
@Test
public void testSubmodulesCheckoutWithCustomConfig() throws Throwable {
final AgentRunningBuild build = createRunningBuild(new HashMap<String, String>() {
{
put(PluginConfigImpl.CUSTOM_GIT_CONFIG, FileUtil.readText(dataFile("custom_config_example")));
}
});
myRoot.addProperty(Constants.BRANCH_NAME, "patch-tests");
myRoot.addProperty(Constants.SUBMODULES_CHECKOUT, SubmodulesCheckoutPolicy.CHECKOUT.name());
myVcsSupport.updateSources(myRoot, new CheckoutRules(""), GitVcsSupportTest.SUBMODULE_ADDED_VERSION, myCheckoutDir, build, false);
assertTrue(new File(myCheckoutDir, "submodule" + File.separator + "file.txt").exists());
}
use of jetbrains.buildServer.vcs.CheckoutRules in project teamcity-git by JetBrains.
the class AgentVcsSupportTest method testSubmmoduleCommitReferencedByTag_no_mirrors.
public void testSubmmoduleCommitReferencedByTag_no_mirrors() throws Exception {
final AgentRunningBuild build = createRunningBuild(false);
myRoot.addProperty(Constants.BRANCH_NAME, "TW-65043");
myRoot.addProperty(Constants.SUBMODULES_CHECKOUT, SubmodulesCheckoutPolicy.CHECKOUT.name());
myVcsSupport.updateSources(myRoot, new CheckoutRules(""), "4be4cc77ac427ecabf6ca53a76e33f6e186db6f2", myCheckoutDir, build, false);
final File file = new File(myCheckoutDir, "submodule" + File.separator + "file.txt");
assertTrue(file.exists());
assertEquals("TW-65043", FileUtil.readText(file, "UTF-8").trim());
}
use of jetbrains.buildServer.vcs.CheckoutRules in project teamcity-git by JetBrains.
the class AgentVcsSupportTest method short_lived_agent_auto_clone.
@Test
public void short_lived_agent_auto_clone() throws Exception {
myBuild.getAgentConfiguration().addConfigurationParameter(AgentMiscConstants.IS_EPHEMERAL_AGENT_PROP, "true");
final File remote = dataFile("repo_for_shallow_fetch.git");
final File shallowMarker = new File(myCheckoutDir, ".git/shallow");
final VcsRootImpl root = createRoot(remote, "refs/heads/main");
root.addProperty(Constants.CHECKOUT_POLICY, AgentCheckoutPolicy.AUTO.name());
myVcsSupport.updateSources(root, new CheckoutRules(""), "64195c330d99c467a142f682bc23d4de3a68551d", myCheckoutDir, myBuild, false);
assertTrue(shallowMarker.exists());
}
Aggregations