use of jetbrains.buildServer.util.TestFor in project teamcity-git by JetBrains.
the class GitPatchTest method submodules_and_checkout_rules2.
@TestFor(issues = "TW-50097")
@Test(dataProvider = "patchInSeparateProcess")
public void submodules_and_checkout_rules2(boolean patchInSeparateProcess) throws Exception {
myConfigBuilder.setSeparateProcessForPatch(patchInSeparateProcess);
VcsRoot root = getRoot("sub-submodule", true);
checkPatch(root, "submodules_and_checkout_rules2", null, "ce6044093939bb47283439d97a1c80f759669ff5", new CheckoutRules("+:first-level-submodule/sub-sub"));
}
use of jetbrains.buildServer.util.TestFor in project teamcity-git by JetBrains.
the class GitServerUtilTest method url_with_newline.
@TestFor(issues = "TW-50043")
@Test(dataProviderClass = GitVcsRootTest.class, dataProvider = "urlsWithNewLines")
public void url_with_newline(@NotNull String url) throws Exception {
File dir = myTempFiles.createTempDir();
try {
GitServerUtil.getRepository(dir, new URIish(url));
fail("No error for url '" + url + "'");
} catch (VcsException e) {
// expected
}
}
use of jetbrains.buildServer.util.TestFor in project teamcity-git by JetBrains.
the class GitVcsSupportTest method should_update_local_ref_when_it_locked.
@TestFor(issues = "TW-16351")
@Test(dataProvider = "doFetchInSeparateProcess", dataProviderClass = FetchOptionsDataProvider.class)
public void should_update_local_ref_when_it_locked(boolean fetchInSeparateProcess) throws Exception {
setInternalProperty(Constants.CUSTOM_CLONE_PATH_ENABLED, "true");
File remoteRepositoryDir = new File(myTmpDir, "repo_for_fetch");
copyRepository(dataFile("repo_for_fetch.1"), remoteRepositoryDir);
myConfigBuilder.setSeparateProcessForFetch(fetchInSeparateProcess);
GitVcsSupport support = getSupport();
VcsRootImpl root = getRoot("master", false, remoteRepositoryDir);
String branch = root.getProperty(Constants.BRANCH_NAME);
File customRootDir = new File(myTmpDir, "custom-dir");
root.addProperty(Constants.PATH, customRootDir.getAbsolutePath());
RepositoryStateData state = support.getCurrentState(root);
String v1 = GitUtils.versionRevision(state.getBranchRevisions().get(state.getDefaultBranchName()));
support.collectChanges(root, "a7274ca8e024d98c7d59874f19f21d26ee31d41d", "add81050184d3c818560bdd8839f50024c188586", CheckoutRules.DEFAULT);
// now remote repository contains new commits
copyRepository(dataFile("repo_for_fetch.2"), remoteRepositoryDir);
File branchLockFile = createBranchLockFile(customRootDir, branch);
assertTrue(branchLockFile.exists());
state = support.getCurrentState(root);
String v2 = GitUtils.versionRevision(state.getBranchRevisions().get(state.getDefaultBranchName()));
// local repository is updated
assertFalse(v2.equals(v1));
support.collectChanges(root, v1, v2, CheckoutRules.DEFAULT);
}
use of jetbrains.buildServer.util.TestFor in project teamcity-git by JetBrains.
the class GitVcsSupportTest method fetch_process_should_respect_fetch_timeout.
@Test
@TestFor(issues = "TW-17910")
public void fetch_process_should_respect_fetch_timeout() throws Exception {
// MockFetcher waits for 10 seconds
// set teamcity.execution.timeout = 2, we should not get TimeoutException
Properties beforeTestProperties = System.getProperties();
final String defaultProcessExecutionTimeoutProperty = "teamcity.execution.timeout";
System.setProperty(defaultProcessExecutionTimeoutProperty, "2");
try {
String classpath = myConfigBuilder.build().getFetchClasspath() + File.pathSeparator + ClasspathUtil.composeClasspath(new Class[] { MockFetcher.class }, null, null);
myConfigBuilder.setSeparateProcessForFetch(true).setFetchClasspath(classpath).setFetcherClassName(MockFetcher.class.getName());
final GitVcsSupport support = getSupport();
final VcsRootImpl root = (VcsRootImpl) getRoot("master");
support.collectChanges(root, VERSION_TEST_HEAD, MERGE_BRANCH_VERSION, CheckoutRules.DEFAULT);
} catch (Exception e) {
fail(e.getMessage());
} finally {
System.setProperties(beforeTestProperties);
}
}
use of jetbrains.buildServer.util.TestFor in project teamcity-git by JetBrains.
the class GitVcsSupportTest method test_long_input_for_fetcher_process.
/*
* Test reproduces a bug in Fetcher code: Fetcher worked only if all parameters of VcsRoot
* sent to process input as string were smaller than 512 bytes (most of the cases) or size mod 512 = 0.
*/
@TestFor(issues = "TW-13330")
@Test
public void test_long_input_for_fetcher_process() throws IOException, VcsException {
myConfigBuilder.setSeparateProcessForFetch(true);
GitVcsSupport support = getSupport();
VcsRootImpl root = (VcsRootImpl) getRoot("version-test");
root.addProperty("param", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + // with such long param size of input for fetcher process is greater than 512 bytes
"bbbbbbbbbbbbbbbbbbbbb");
support.collectChanges(root, "2276eaf76a658f96b5cf3eb25f3e1fda90f6b653", "f3f826ce85d6dad25156b2d7550cedeb1a422f4c", CheckoutRules.DEFAULT);
}
Aggregations