Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />

<!-- Storage -->
<PackageVersion Include="ManagedEsent" Version="1.9.4" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="2.2.4" />
<PackageVersion Include="Microsoft.Database.Collections.Generic" Version="1.9.4" />
<PackageVersion Include="Microsoft.Database.Isam" Version="1.9.4" />

<!-- Compression -->
<PackageVersion Include="SharpZipLib" Version="1.3.3" />
Expand Down
6 changes: 0 additions & 6 deletions GVFS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.FunctionalTests", "GVF
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.FunctionalTests.LockHolder", "GVFS\GVFS.FunctionalTests.LockHolder\GVFS.FunctionalTests.LockHolder.csproj", "{B26985C3-250A-4805-AA97-AD0604331AC7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.GVFlt", "GVFS\GVFS.GVFlt\GVFS.GVFlt.csproj", "{B366D3B6-1E85-4015-8DB0-D5FA4331ECE4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Hooks", "GVFS\GVFS.Hooks\GVFS.Hooks.csproj", "{EDB4A40E-CFC9-486A-BDC5-AB2951FD8EDC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GVFS.Mount", "GVFS\GVFS.Mount\GVFS.Mount.csproj", "{F96089C2-6D09-4349-B65D-9CCA6160C6A5}"
Expand Down Expand Up @@ -75,10 +73,6 @@ Global
{B26985C3-250A-4805-AA97-AD0604331AC7}.Debug|x64.Build.0 = Debug|Any CPU
{B26985C3-250A-4805-AA97-AD0604331AC7}.Release|x64.ActiveCfg = Release|Any CPU
{B26985C3-250A-4805-AA97-AD0604331AC7}.Release|x64.Build.0 = Release|Any CPU
{B366D3B6-1E85-4015-8DB0-D5FA4331ECE4}.Debug|x64.ActiveCfg = Debug|Any CPU
{B366D3B6-1E85-4015-8DB0-D5FA4331ECE4}.Debug|x64.Build.0 = Debug|Any CPU
{B366D3B6-1E85-4015-8DB0-D5FA4331ECE4}.Release|x64.ActiveCfg = Release|Any CPU
{B366D3B6-1E85-4015-8DB0-D5FA4331ECE4}.Release|x64.Build.0 = Release|Any CPU
{EDB4A40E-CFC9-486A-BDC5-AB2951FD8EDC}.Debug|x64.ActiveCfg = Debug|Any CPU
{EDB4A40E-CFC9-486A-BDC5-AB2951FD8EDC}.Debug|x64.Build.0 = Debug|Any CPU
{EDB4A40E-CFC9-486A-BDC5-AB2951FD8EDC}.Release|x64.ActiveCfg = Release|Any CPU
Expand Down
1 change: 0 additions & 1 deletion GVFS/FastFetch/FastFetch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<FilesToSign Include="
$(OutputPath)\FastFetch.exe;
$(OutputPath)\GVFS.Common.dll;
$(OutputPath)\GVFS.GVFlt.dll;
$(OutputPath)\GVFS.Platform.Windows.dll;
$(OutputPath)\GVFS.Virtualization.dll;">
<Authenticode>Microsoft400</Authenticode>
Expand Down
1 change: 0 additions & 1 deletion GVFS/GVFS.FunctionalTests/GVFS.FunctionalTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<PackageReference Include="NUnitLite" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="Microsoft.Data.Sqlite" />
<PackageReference Include="Microsoft.Database.Collections.Generic" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="SharpZipLib" />
<PackageReference Include="System.ServiceProcess.ServiceController" />
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS.FunctionalTests/Tools/GVFSHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static class GVFSHelpers

private const int WindowsCurrentDiskLayoutMajorVersion = 19;
private const int MacCurrentDiskLayoutMajorVersion = 19;
private const int WindowsCurrentDiskLayoutMinimumMajorVersion = 7;
private const int WindowsCurrentDiskLayoutMinimumMajorVersion = 14;
private const int MacCurrentDiskLayoutMinimumMajorVersion = 18;

public static string ConvertPathToGitFormat(string path)
Expand Down
111 changes: 0 additions & 111 deletions GVFS/GVFS.FunctionalTests/Windows/Tests/SharedCacheUpgradeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
using GVFS.FunctionalTests.Tests.MultiEnlistmentTests;
using GVFS.FunctionalTests.Tools;
using GVFS.FunctionalTests.Windows.Tests;
using GVFS.FunctionalTests.Windows.Tools;
using GVFS.Tests.Should;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;

namespace GVFS.FunctionalTests.Windows.Windows.Tests
Expand All @@ -33,115 +31,6 @@ public void SetCacheLocation()
this.localCachePath = Path.Combine(this.localCacheParentPath, ".customGVFSCache");
}

[TestCase]
public void MountUpgradesLocalSizesToSharedCache()
{
GVFSFunctionalTestEnlistment enlistment = this.CloneAndMountEnlistment();
enlistment.UnmountGVFS();

string localCacheRoot = GVFSHelpers.GetPersistedLocalCacheRoot(enlistment.DotGVFSRoot);
string gitObjectsRoot = GVFSHelpers.GetPersistedGitObjectsRoot(enlistment.DotGVFSRoot);

// Delete the existing repo metadata
string versionJsonPath = Path.Combine(enlistment.DotGVFSRoot, GVFSHelpers.RepoMetadataName);
versionJsonPath.ShouldBeAFile(this.fileSystem);
this.fileSystem.DeleteFile(versionJsonPath);

// Since there isn't a sparse-checkout file that is used anymore one needs to be added
// in order to test the old upgrades that might have needed it
string sparseCheckoutPath = Path.Combine(enlistment.RepoRoot, TestConstants.DotGit.Info.SparseCheckoutPath);
this.fileSystem.WriteAllText(sparseCheckoutPath, "/.gitattributes\r\n");

// "13.0" was the last version before blob sizes were moved out of Esent
string metadataPath = Path.Combine(enlistment.DotGVFSRoot, GVFSHelpers.RepoMetadataName);
this.fileSystem.CreateEmptyFile(metadataPath);
GVFSHelpers.SaveDiskLayoutVersion(enlistment.DotGVFSRoot, "13", "0");
GVFSHelpers.SaveLocalCacheRoot(enlistment.DotGVFSRoot, localCacheRoot);
GVFSHelpers.SaveGitObjectsRoot(enlistment.DotGVFSRoot, gitObjectsRoot);

// Create a legacy PersistedDictionary sizes database
List<KeyValuePair<string, long>> entries = new List<KeyValuePair<string, long>>()
{
new KeyValuePair<string, long>(new string('0', 40), 1),
new KeyValuePair<string, long>(new string('1', 40), 2),
new KeyValuePair<string, long>(new string('2', 40), 4),
new KeyValuePair<string, long>(new string('3', 40), 8),
};

ESENTDatabase.CreateEsentBlobSizesDatabase(enlistment.DotGVFSRoot, entries);

enlistment.MountGVFS();

string majorVersion;
string minorVersion;
GVFSHelpers.GetPersistedDiskLayoutVersion(enlistment.DotGVFSRoot, out majorVersion, out minorVersion);

majorVersion
.ShouldBeAnInt("Disk layout version should always be an int")
.ShouldEqual(WindowsDiskLayoutUpgradeTests.CurrentDiskLayoutMajorVersion, "Disk layout version should be upgraded to the latest");

minorVersion
.ShouldBeAnInt("Disk layout version should always be an int")
.ShouldEqual(WindowsDiskLayoutUpgradeTests.CurrentDiskLayoutMinorVersion, "Disk layout version should be upgraded to the latest");

string newBlobSizesRoot = Path.Combine(Path.GetDirectoryName(gitObjectsRoot), WindowsDiskLayoutUpgradeTests.BlobSizesCacheName);
GVFSHelpers.GetPersistedBlobSizesRoot(enlistment.DotGVFSRoot)
.ShouldEqual(newBlobSizesRoot);

string blobSizesDbPath = Path.Combine(newBlobSizesRoot, WindowsDiskLayoutUpgradeTests.BlobSizesDBFileName);
newBlobSizesRoot.ShouldBeADirectory(this.fileSystem);
blobSizesDbPath.ShouldBeAFile(this.fileSystem);

foreach (KeyValuePair<string, long> entry in entries)
{
GVFSHelpers.SQLiteBlobSizesDatabaseHasEntry(blobSizesDbPath, entry.Key, entry.Value);
}

// Upgrade a second repo, and make sure all sizes from both upgrades are in the shared database

GVFSFunctionalTestEnlistment enlistment2 = this.CloneAndMountEnlistment();
enlistment2.UnmountGVFS();

// Delete the existing repo metadata
versionJsonPath = Path.Combine(enlistment2.DotGVFSRoot, GVFSHelpers.RepoMetadataName);
versionJsonPath.ShouldBeAFile(this.fileSystem);
this.fileSystem.DeleteFile(versionJsonPath);

// Since there isn't a sparse-checkout file that is used anymore one needs to be added
// in order to test the old upgrades that might have needed it
string sparseCheckoutPath2 = Path.Combine(enlistment2.RepoRoot, TestConstants.DotGit.Info.SparseCheckoutPath);
this.fileSystem.WriteAllText(sparseCheckoutPath2, "/.gitattributes\r\n");

// "13.0" was the last version before blob sizes were moved out of Esent
metadataPath = Path.Combine(enlistment2.DotGVFSRoot, GVFSHelpers.RepoMetadataName);
this.fileSystem.CreateEmptyFile(metadataPath);
GVFSHelpers.SaveDiskLayoutVersion(enlistment2.DotGVFSRoot, "13", "0");
GVFSHelpers.SaveLocalCacheRoot(enlistment2.DotGVFSRoot, localCacheRoot);
GVFSHelpers.SaveGitObjectsRoot(enlistment2.DotGVFSRoot, gitObjectsRoot);

// Create a legacy PersistedDictionary sizes database
List<KeyValuePair<string, long>> additionalEntries = new List<KeyValuePair<string, long>>()
{
new KeyValuePair<string, long>(new string('4', 40), 16),
new KeyValuePair<string, long>(new string('5', 40), 32),
new KeyValuePair<string, long>(new string('6', 40), 64),
};

ESENTDatabase.CreateEsentBlobSizesDatabase(enlistment2.DotGVFSRoot, additionalEntries);

enlistment2.MountGVFS();

foreach (KeyValuePair<string, long> entry in entries)
{
GVFSHelpers.SQLiteBlobSizesDatabaseHasEntry(blobSizesDbPath, entry.Key, entry.Value);
}

foreach (KeyValuePair<string, long> entry in additionalEntries)
{
GVFSHelpers.SQLiteBlobSizesDatabaseHasEntry(blobSizesDbPath, entry.Key, entry.Value);
}
}

private GVFSFunctionalTestEnlistment CloneAndMountEnlistment(string branch = null)
{
return this.CreateNewEnlistment(this.localCachePath, branch);
Expand Down
Loading
Loading