Skip to content

Commit

Permalink
Merge pull request #32: Enable an initial set of functional tests and…
Browse files Browse the repository at this point in the history
… standup Mac Functional Test Pipeline

 - Add 'SupportsGVFSService' under construction flag, and only attempt to register/unregister when it's true
  - Add a new 'NeedsUpdatesForNonVirtualizedMode' category to functional tests
  - Update functional tests to run all tests not flagged with 'NeedsUpdatesForNonVirtualizedMode'
  - Update pipelines to run Mac functional tests
  • Loading branch information
derrickstolee authored Aug 9, 2019
2 parents 5d9a0f2 + c30507d commit 3809a64
Show file tree
Hide file tree
Showing 42 changed files with 74 additions and 21 deletions.
16 changes: 15 additions & 1 deletion .azure-pipelines/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@ jobs:
steps:
- template: templates/windows-build-and-unit-test.yml

- job: macOS
- job: macOS_Build_and_UnitTests
variables:
platformFriendlyName: macOS
pool:
name: 'Hosted macOS'
steps:
- template: templates/macos-build-and-unit-test.yml

- job: macOS_FunctionalTests
variables:
platformFriendlyName: macOS
timeoutInMinutes: 30
pool:
name: 'Hosted macOS'
dependsOn: macOS_Build_and_UnitTests
condition: succeeded()
steps:
- checkout: none # Use the drop from Build_macOS job
- template: templates/macos-functional-test.yml
20 changes: 10 additions & 10 deletions .azure-pipelines/templates/macos-build-and-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ steps:
publishRunAttachments: true
condition: succeededOrFailed()

#- script: Scripts/Mac/CI/CreateBuildDrop.sh $(configuration) $(Build.ArtifactStagingDirectory)/Tests
# displayName: Create functional test drop.
- script: Scripts/Mac/CI/CreateBuildDrop.sh $(configuration) $(Build.ArtifactStagingDirectory)/Tests
displayName: Create functional test drop.

#- task: PublishBuildArtifacts@1
# displayName: Publish functional test drop artifact.
# inputs:
# pathtoPublish: $(Build.ArtifactStagingDirectory)/Tests
# artifactName: "FunctionalTests_$(platformFriendlyName)_$(configuration)"
# parallel: true
# parallelCount: 8
# condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: Publish functional test drop artifact.
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/Tests
artifactName: "FunctionalTests_$(platformFriendlyName)_$(configuration)"
parallel: true
parallelCount: 8
condition: succeededOrFailed()
6 changes: 0 additions & 6 deletions .azure-pipelines/templates/macos-functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ steps:
displayName: Cleanup
condition: always()

- task: PublishBuildArtifacts@1
displayName: Publish kext logs
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/kext.log
artifactName: kext.log

- bash: sudo rm -rf $(Build.BinariesDirectory)/FunctionalTests_$(platformFriendlyName)_$(configuration)
displayName: Cleanup phase 2
condition: always()
Expand Down
5 changes: 4 additions & 1 deletion GVFS/GVFS.Common/GVFSPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,19 @@ public class UnderConstructionFlags
public UnderConstructionFlags(
bool supportsGVFSUpgrade = true,
bool supportsGVFSConfig = true,
bool supportsNuGetEncryption = true)
bool supportsNuGetEncryption = true,
bool supportsGVFSService = false)
{
this.SupportsGVFSUpgrade = supportsGVFSUpgrade;
this.SupportsGVFSConfig = supportsGVFSConfig;
this.SupportsNuGetEncryption = supportsNuGetEncryption;
this.SupportsGVFSService = supportsGVFSService;
}

public bool SupportsGVFSUpgrade { get; }
public bool SupportsGVFSConfig { get; }
public bool SupportsNuGetEncryption { get; }
public bool SupportsGVFSService { get; }
}
}
}
2 changes: 2 additions & 0 deletions GVFS/GVFS.FunctionalTests/Categories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public static class Categories
public const string WindowsOnly = "WindowsOnly";
public const string MacOnly = "MacOnly";

public const string NeedsUpdatesForNonVirtualizedMode = "NeedsUpdatesForNonVirtualizedMode";

public static class MacTODO
{
// Tests that require #360 (detecting/handling new empty folders)
Expand Down
6 changes: 6 additions & 0 deletions GVFS/GVFS.FunctionalTests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ public static void Main(string[] args)
excludeCategories.Add(Categories.MacOnly);
}

// For now, run all of the tests not flagged as needing to be updated to work
// with the non-virtualized solution
includeCategories.Clear();
excludeCategories.Clear();
excludeCategories.Add(Categories.NeedsUpdatesForNonVirtualizedMode);

GVFSTestConfig.DotGVFSRoot = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? ".vfsforgit" : ".gvfs";

GVFSTestConfig.RepoToClone =
Expand Down
1 change: 1 addition & 0 deletions GVFS/GVFS.FunctionalTests/Tests/DiskLayoutVersionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace GVFS.FunctionalTests.Tests
{
[TestFixture]
[Category(Categories.ExtraCoverage)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class DiskLayoutVersionTests : TestsWithEnlistmentPerTestCase
{
private const int WindowsCurrentDiskLayoutMajorVersion = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
{
[TestFixture]
[Category(Categories.ExtraCoverage)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class CacheServerTests : TestsWithEnlistmentPerFixture
{
private const string CustomUrl = "https://myCache";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
[TestFixture]
[NonParallelizable]
[Category(Categories.ExtraCoverage)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class DiagnoseTests : TestsWithEnlistmentPerFixture
{
private FileSystemRunner fileSystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
[NonParallelizable]
[Category(Categories.ExtraCoverage)]
[Category(Categories.WindowsOnly)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class UpgradeReminderTests : TestsWithEnlistmentPerFixture
{
private const string HighestAvailableVersionFileName = "HighestAvailableVersion";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
{
[TestFixture]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class GitCorruptObjectTests : TestsWithEnlistmentPerFixture
{
private FileSystemRunner fileSystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
{
[TestFixtureSource(typeof(FileSystemRunner), nameof(FileSystemRunner.Runners))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class GitMoveRenameTests : TestsWithEnlistmentPerFixture
{
private string testFileContents = "0123456789";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
{
[TestFixture]
[Category(Categories.ExtraCoverage)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class MountTests : TestsWithEnlistmentPerFixture
{
private const int GVFSGenericError = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
{
[TestFixture]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class PackfileMaintenanceStepTests : TestsWithEnlistmentPerFixture
{
private FileSystemRunner fileSystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
{
[TestFixture]
[NonParallelizable]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class PrefetchVerbTests : TestsWithEnlistmentPerFixture
{
private const string PrefetchCommitsAndTreesLock = "prefetch-commits-trees.lock";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
[TestFixture]
[Category(Categories.ExtraCoverage)]
[Category(Categories.MacTODO.TestNeedsToLockFile)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class PrefetchVerbWithoutSharedCacheTests : TestsWithEnlistmentPerFixture
{
private const string PrefetchPackPrefix = "prefetch";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
{
[TestFixture]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class SparseTests : TestsWithEnlistmentPerFixture
{
private FileSystemRunner fileSystem = new SystemIORunner();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
{
[TestFixture]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class StatusVerbTests : TestsWithEnlistmentPerFixture
{
[TestCase]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
{
// MacOnly until issue #297 (add SymLink support for Windows) is complete
[Category(Categories.MacOnly)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
[TestFixture]
public class SymbolicLinkTests : TestsWithEnlistmentPerFixture
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerFixture
{
[TestFixture]
[Category(Categories.ExtraCoverage)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class UnmountTests : TestsWithEnlistmentPerFixture
{
private FileSystemRunner fileSystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace GVFS.FunctionalTests.Tests.EnlistmentPerTestCase
{
[TestFixture]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class CaseOnlyFolderRenameTests : TestsWithEnlistmentPerTestCase
{
private FileSystemRunner fileSystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace GVFS.FunctionalTests.Tests.EnlistmentPerTestCase
{
[TestFixture]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class LooseObjectStepTests : TestsWithEnlistmentPerTestCase
{
private const string TempPackFolder = "tempPacks";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace GVFS.FunctionalTests.Tests.EnlistmentPerTestCase
{
[TestFixture]
[Category(Categories.ExtraCoverage)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class RepairTests : TestsWithEnlistmentPerTestCase
{
[TestCase]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class AddStageTests : GitRepoTests
{
public AddStageTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class CherryPickConflictTests : GitRepoTests
{
public CherryPickConflictTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class DeleteEmptyFolderTests : GitRepoTests
{
public DeleteEmptyFolderTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class EnumerationMergeTest : GitRepoTests
{
// Commit that found GvFlt Bug 12258777: Entries are sometimes skipped during
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class GitCommandsTests : GitRepoTests
{
public const string TopLevelFolderToCreate = "level1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class MergeConflictTests : GitRepoTests
{
public MergeConflictTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class RebaseConflictTests : GitRepoTests
{
public RebaseConflictTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
1 change: 1 addition & 0 deletions GVFS/GVFS.FunctionalTests/Tests/GitCommands/RebaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class RebaseTests : GitRepoTests
{
public RebaseTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class ResetHardTests : GitRepoTests
{
private const string ResetHardCommand = "reset --hard";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class ResetMixedTests : GitRepoTests
{
public ResetMixedTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class ResetSoftTests : GitRepoTests
{
public ResetSoftTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
3 changes: 2 additions & 1 deletion GVFS/GVFS.FunctionalTests/Tests/GitCommands/StatusTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class StatusTests : GitRepoTests
{
public StatusTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class UpdateIndexTests : GitRepoTests
{
public UpdateIndexTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace GVFS.FunctionalTests.Tests.GitCommands
{
[TestFixtureSource(typeof(GitRepoTests), nameof(GitRepoTests.ValidateWorkingTree))]
[Category(Categories.GitCommands)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class UpdateRefTests : GitRepoTests
{
public UpdateRefTests(Settings.ValidateWorkingTreeMode validateWorkingTree)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace GVFS.FunctionalTests.Tests.MultiEnlistmentTests
[TestFixture]
[Category(Categories.ExtraCoverage)]
[Category(Categories.MacTODO.NeedsGVFSConfig)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class ConfigVerbTests : TestsWithMultiEnlistment
{
private const string IntegerSettingKey = "functionalTest_Integer";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace GVFS.FunctionalTests.Tests.MultiEnlistmentTests
[NonParallelizable]
[Category(Categories.ExtraCoverage)]
[Category(Categories.MacTODO.NeedsServiceVerb)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class ServiceVerbTests : TestsWithMultiEnlistment
{
private static readonly string[] EmptyRepoList = new string[] { };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace GVFS.FunctionalTests.Tests.MultiEnlistmentTests
{
[TestFixture]
[Category(Categories.ExtraCoverage)]
[Category(Categories.NeedsUpdatesForNonVirtualizedMode)]
public class SharedCacheTests : TestsWithMultiEnlistment
{
private const string WellKnownFile = "Readme.md";
Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS/CommandLine/MountVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ protected override void Execute(GVFSEnlistment enlistment)
this.ReportErrorAndExit(tracer, errorMessage);
}

if (!this.Unattended)
if (!this.Unattended && GVFSPlatform.Instance.UnderConstruction.SupportsGVFSService)
{
tracer.RelatedInfo($"{nameof(this.Execute)}: Registering for automount");

Expand Down
2 changes: 1 addition & 1 deletion GVFS/GVFS/CommandLine/UnmountVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public override void Execute()
this.ReportErrorAndExit(errorMessage);
}

if (!this.Unattended && !this.SkipUnregister)
if (!this.Unattended && !this.SkipUnregister && GVFSPlatform.Instance.UnderConstruction.SupportsGVFSService)
{
if (!this.ShowStatusWhileRunning(
() => { return this.UnregisterRepo(root, out errorMessage); },
Expand Down

0 comments on commit 3809a64

Please sign in to comment.