MultiBaseLocalDiskRepositoryManagerTest: fix for running on Mac from Eclipse
The alternateRepositoryLocation test was failing when running from Eclipse on Mac because the created repository location would be: /private/var/rest/of/path while the alternateBasePath is: /var/rest/of/path This difference comes from the fact that on Mac the /var is a symlink to /private/var and the creation of the repository would resolve the location using getCanonicalFile(). Use alternateBasePath.toRealPath() to resolve any symlinks in the alternateBasePath. NOTE: this issue doesn't show up when running tests from bazel as bazel's sandboxing uses different path locations. Change-Id: I2cb1adc48e16edc5adffd7b7f8eea2b5ea1a60f3
This commit is contained in:
@@ -93,12 +93,14 @@ public class MultiBaseLocalDiskRepositoryManagerTest {
|
|||||||
Repository repo = repoManager.createRepository(someProjectKey);
|
Repository repo = repoManager.createRepository(someProjectKey);
|
||||||
assertThat(repo.getDirectory()).isNotNull();
|
assertThat(repo.getDirectory()).isNotNull();
|
||||||
assertThat(repo.getDirectory().exists()).isTrue();
|
assertThat(repo.getDirectory().exists()).isTrue();
|
||||||
assertThat(repo.getDirectory().getParent()).isEqualTo(alternateBasePath.toString());
|
assertThat(repo.getDirectory().getParent())
|
||||||
|
.isEqualTo(alternateBasePath.toRealPath().toString());
|
||||||
|
|
||||||
repo = repoManager.openRepository(someProjectKey);
|
repo = repoManager.openRepository(someProjectKey);
|
||||||
assertThat(repo.getDirectory()).isNotNull();
|
assertThat(repo.getDirectory()).isNotNull();
|
||||||
assertThat(repo.getDirectory().exists()).isTrue();
|
assertThat(repo.getDirectory().exists()).isTrue();
|
||||||
assertThat(repo.getDirectory().getParent()).isEqualTo(alternateBasePath.toString());
|
assertThat(repo.getDirectory().getParent())
|
||||||
|
.isEqualTo(alternateBasePath.toRealPath().toString());
|
||||||
|
|
||||||
assertThat(repoManager.getBasePath(someProjectKey).toAbsolutePath().toString())
|
assertThat(repoManager.getBasePath(someProjectKey).toAbsolutePath().toString())
|
||||||
.isEqualTo(alternateBasePath.toString());
|
.isEqualTo(alternateBasePath.toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user