Skip to content

Commit adf535d

Browse files
committed
scalar: remove mount and unmount verbs
- Remove mount and unmount verbs - Clone no longer calls mount - Removed mount-all and unmount-all from the service verb - Updated functional tests as needed for above changes - Remove code for unloading the kext from the installer, there is no kext for Scalar - Stop calling 'service --unmount-all' as '--unmount-all' is no longer supported. For now call '--help' instead (until the service is able to stop its inflight maintenance task).
1 parent 09d6e8d commit adf535d

29 files changed

Lines changed: 84 additions & 1413 deletions

Scalar.FunctionalTests/Tests/DiskLayoutVersionTests.cs

Lines changed: 0 additions & 71 deletions
This file was deleted.

Scalar.FunctionalTests/Tests/EnlistmentPerFixture/CloneTests.cs

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,11 @@ public class CloneTests : TestsWithEnlistmentPerFixture
1515
private const int ScalarGenericError = 3;
1616

1717
[TestCase]
18-
public void CloneInsideMountedEnlistment()
18+
public void CloneInsideExistingEnlistment()
1919
{
2020
this.SubfolderCloneShouldFail();
2121
}
2222

23-
[TestCase]
24-
public void CloneInsideUnmountedEnlistment()
25-
{
26-
this.Enlistment.UnmountScalar();
27-
this.SubfolderCloneShouldFail();
28-
this.Enlistment.MountScalar();
29-
}
30-
3123
[TestCase]
3224
public void CloneWithLocalCachePathWithinSrc()
3325
{
@@ -53,20 +45,19 @@ public void SparseCloneWithNoFetchOfCommitsAndTreesSucceeds()
5345

5446
try
5547
{
56-
enlistment = ScalarFunctionalTestEnlistment.CloneAndMountWithPerRepoCache(ScalarTestConfig.PathToScalar, skipFetchCommitsAndTrees: true);
48+
enlistment = ScalarFunctionalTestEnlistment.CloneWithPerRepoCache(ScalarTestConfig.PathToScalar, skipFetchCommitsAndTrees: true);
5749

5850
ProcessResult result = GitProcess.InvokeProcess(enlistment.RepoRoot, "status");
5951
result.ExitCode.ShouldEqual(0, result.Errors);
6052
}
6153
finally
6254
{
63-
enlistment?.UnmountAndDeleteAll();
55+
enlistment?.DeleteAll();
6456
}
6557
}
6658

6759
[TestCase]
6860
[Category(Categories.MacOnly)]
69-
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
7061
public void CloneWithDefaultLocalCacheLocation()
7162
{
7263
FileSystemRunner fileSystem = FileSystemRunner.DefaultRunner;
@@ -77,8 +68,6 @@ public void CloneWithDefaultLocalCacheLocation()
7768

7869
ProcessStartInfo processInfo = new ProcessStartInfo(ScalarTestConfig.PathToScalar);
7970

80-
// Needs update for non-virtualized mode: this used to have --no-mount to avoid an issue
81-
// with registering the mount with the service.
8271
processInfo.Arguments = $"clone {Properties.Settings.Default.RepoToClone} {newEnlistmentRoot} --no-fetch-commits-and-trees";
8372
processInfo.WindowStyle = ProcessWindowStyle.Hidden;
8473
processInfo.CreateNoWindow = true;
@@ -102,14 +91,14 @@ public void CloneWithDefaultLocalCacheLocation()
10291
[TestCase]
10392
public void CloneToPathWithSpaces()
10493
{
105-
ScalarFunctionalTestEnlistment enlistment = ScalarFunctionalTestEnlistment.CloneAndMountEnlistmentWithSpacesInPath(ScalarTestConfig.PathToScalar);
106-
enlistment.UnmountAndDeleteAll();
94+
ScalarFunctionalTestEnlistment enlistment = ScalarFunctionalTestEnlistment.CloneEnlistmentWithSpacesInPath(ScalarTestConfig.PathToScalar);
95+
enlistment.DeleteAll();
10796
}
10897

10998
[TestCase]
11099
public void CloneCreatesCorrectFilesInRoot()
111100
{
112-
ScalarFunctionalTestEnlistment enlistment = ScalarFunctionalTestEnlistment.CloneAndMount(ScalarTestConfig.PathToScalar);
101+
ScalarFunctionalTestEnlistment enlistment = ScalarFunctionalTestEnlistment.Clone(ScalarTestConfig.PathToScalar);
113102
try
114103
{
115104
Directory.GetFiles(enlistment.EnlistmentRoot).ShouldBeEmpty("There should be no files in the enlistment root after cloning");
@@ -120,7 +109,7 @@ public void CloneCreatesCorrectFilesInRoot()
120109
}
121110
finally
122111
{
123-
enlistment.UnmountAndDeleteAll();
112+
enlistment.DeleteAll();
124113
}
125114
}
126115

Scalar.FunctionalTests/Tests/EnlistmentPerFixture/FetchCommitsAndTreesWithoutSharedCacheTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void FetchCommitsAndTreesCleansUpBadPrefetchPack()
104104
[TestCase, Order(4)]
105105
public void FetchCommitsAndTreesCleansUpOldPrefetchPack()
106106
{
107-
this.Enlistment.UnmountScalar();
107+
this.Enlistment.UnregisterRepo();
108108

109109
string[] prefetchPacks = this.ReadPrefetchPackFileNames();
110110
long oldestPackTimestamp = this.GetOldestPackTimestamp(prefetchPacks);
@@ -135,7 +135,7 @@ public void FetchCommitsAndTreesCleansUpOldPrefetchPack()
135135
[Category(Categories.MacTODO.TestNeedsToLockFile)]
136136
public void FetchCommitsAndTreesFailsWhenItCannotRemoveABadPrefetchPack()
137137
{
138-
this.Enlistment.UnmountScalar();
138+
this.Enlistment.UnregisterRepo();
139139

140140
string[] prefetchPacks = this.ReadPrefetchPackFileNames();
141141
long mostRecentPackTimestamp = this.GetMostRecentPackTimestamp(prefetchPacks);
@@ -168,7 +168,7 @@ public void FetchCommitsAndTreesFailsWhenItCannotRemoveABadPrefetchPack()
168168
[Category(Categories.MacTODO.TestNeedsToLockFile)]
169169
public void FetchCommitsAndTreesFailsWhenItCannotRemoveAPrefetchPackNewerThanBadPrefetchPack()
170170
{
171-
this.Enlistment.UnmountScalar();
171+
this.Enlistment.UnregisterRepo();
172172

173173
string[] prefetchPacks = this.ReadPrefetchPackFileNames();
174174
long oldestPackTimestamp = this.GetOldestPackTimestamp(prefetchPacks);
@@ -202,7 +202,7 @@ public void FetchCommitsAndTreesFailsWhenItCannotRemoveAPrefetchPackNewerThanBad
202202
[Category(Categories.MacTODO.TestNeedsToLockFile)]
203203
public void FetchCommitsAndTreesFailsWhenItCannotRemoveAPrefetchIdxNewerThanBadPrefetchPack()
204204
{
205-
this.Enlistment.UnmountScalar();
205+
this.Enlistment.UnregisterRepo();
206206

207207
string[] prefetchPacks = this.ReadPrefetchPackFileNames();
208208
long oldestPackTimestamp = this.GetOldestPackTimestamp(prefetchPacks);
@@ -239,7 +239,7 @@ public void FetchCommitsAndTreesFailsWhenItCannotRemoveAPrefetchIdxNewerThanBadP
239239
[TestCase, Order(8)]
240240
public void FetchCommitsAndTreesCleansUpStaleTempPrefetchPacks()
241241
{
242-
this.Enlistment.UnmountScalar();
242+
this.Enlistment.UnregisterRepo();
243243

244244
// Create stale packs and idxs in the temp folder
245245
string stalePackContents = "StalePack";

Scalar.FunctionalTests/Tests/EnlistmentPerFixture/LooseObjectStepTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public LooseObjectStepTests()
3131
[Order(1)]
3232
public void NoLooseObjectsDoesNothing()
3333
{
34-
this.Enlistment.UnmountScalar();
34+
this.Enlistment.UnregisterRepo();
3535
this.DeleteFiles(this.GetLooseObjectFiles());
3636

3737
this.DeleteFiles(this.GetLooseObjectFiles());
@@ -133,7 +133,7 @@ public void CorruptLooseObjectIsDeleted()
133133

134134
private void ClearAllObjects()
135135
{
136-
this.Enlistment.UnmountScalar();
136+
this.Enlistment.UnregisterRepo();
137137

138138
// Delete/Move any starting loose objects and packfiles
139139
this.DeleteFiles(this.GetLooseObjectFiles());

0 commit comments

Comments
 (0)