Skip to content

Update PowerShellRunner to support hard link creation and enable more functional tests on Mac#266

Merged
wilbaker merged 10 commits intomicrosoft:masterfrom
wilbaker:powershell_hardlink_and_more_mac_tests
Sep 17, 2018
Merged

Update PowerShellRunner to support hard link creation and enable more functional tests on Mac#266
wilbaker merged 10 commits intomicrosoft:masterfrom
wilbaker:powershell_hardlink_and_more_mac_tests

Conversation

@wilbaker
Copy link
Member

Fixes #262

  • Added CreateHardLink implementation to PowerShellRunner
  • Removed OS check from ModifiedPathsTests when building list of runners
  • Enabled CheckoutTests.CheckoutBranchThatHasFolderShouldGetDeleted test on Mac
  • Enabled GitCommands.RebaseTests on Mac

@wilbaker wilbaker self-assigned this Sep 12, 2018
Copy link
Contributor

@sanoursa sanoursa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor comments, feel free to take them or not.

foreach (object[] runner in FileSystemRunner.Runners.ToList())
{
return new[]
FileSystemRunner fileSystem = runner.ToList().First() as FileSystemRunner;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit pick: you're using as but not checking for null. I would just do a normal cast here so we end up with a more appropriate exception if someone ever inserts in invalid type into the list.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just do a normal cast here so we end up with a more appropriate exception if someone ever inserts in invalid type into the list.

Sounds good I'll fix this up

return hardLinkRunners.ToArray();
}

// Always return at least one runner that supports creating hard links
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it a bug in our code if we get this far? I would just throw.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanoursa this is not a bug because when we run without --full-suite the only runner will be SystemIORunner which does not support hard link creation.

I can either update the comment to include those details, or I can mark the test as full suite only, let me know if you have a preference.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, yea a comment would be helpful

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I just noticed that we had this same issue for RenameDirectory and addressed it by having SystemIORunner.RenameDirectory PInvoke to the native API. I'll see if I can do the same for hard link creation and then all of this "does runner support hard link" code can be removed.

@wilbaker wilbaker force-pushed the powershell_hardlink_and_more_mac_tests branch 2 times, most recently from a3ce35e to 4c38ca0 Compare September 14, 2018 19:17
@wilbaker wilbaker force-pushed the powershell_hardlink_and_more_mac_tests branch from d160760 to bc6f896 Compare September 15, 2018 00:26
@wilbaker wilbaker closed this Sep 15, 2018
@wilbaker wilbaker reopened this Sep 15, 2018
@wilbaker wilbaker merged commit 2270263 into microsoft:master Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants