Skip to content

Fix/disable tests that fail on Unix - #294

Merged
jpreese merged 1 commit into
TestableIO:masterfrom
fgreinacher:fix-unix-tests
Jul 6, 2018
Merged

jpreese merged 1 commit into
TestableIO:masterfrom
fgreinacher:fix-unix-tests

Conversation

@fgreinacher

@fgreinacher fgreinacher commented Jul 4, 2018 •

Copy link
Copy Markdown
Contributor

This MR makes the Travis build green, by either

  • fixing tests that were buggy (e.g. by not using MockUnixSupport consistently)
  • fixing implementation issues
  • ignoring tests that don't make sense on Unix (mostly ACL, UNC paths, character limitations in paths)

@jpreese jpreese left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR! I went ahead and added a couple comments.

[TestCase(" ")]
public void MockDirectory_GetAccessControl_ShouldThrowArgumentExceptionIfPathContainsOnlyWhitespaces(string path)
{
if (MockUnixSupport.IsUnixPlatform())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of this block of code throughout the test project, what do we think about categorizing Windows tests?

I think this would declutter the test runner a bit more (no need for inconclusives) and would also clearly show that the feature we're testing is intended for Windows.

yield return new object[] { XFS.Path(@"c:\temp//\\///folder"), XFS.Path(@"c:\temp\folder") };
yield return new object[] { XFS.Path(@"\\unc\folder"), XFS.Path(@"\\unc\folder") };
yield return new object[] { XFS.Path(@"\\unc/folder\\foo"), XFS.Path(@"\\unc\folder\foo") };
if (!MockUnixSupport.IsUnixPlatform())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this would be a little better if we just removed these values from the test data, and then made a new Windows test that checked just the two unc paths. This way we're testing drive paths and unc paths in two different tests. What do you think?

fileSystem.AddFile(@"C:\LOUD\file.txt", "foo");
fileSystem.AddDirectory(@"C:\test\SUBDirectory");
fileSystem.AddDirectory(@"C:\LOUD\SUBDirectory");
fileSystem.AddFile(MockUnixSupport.Path(@"C:\test\file.txt"), "foo");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we, for consistency, use XFS as the namespace instead of MockUnixSupport? My first gut reaction was what is the difference between MockUnitSupport and XFS? If we chose one and stuck with it, I think the experience would be a little better.

yield return @"..\";
yield return @"aaa\vv..\";

if (!MockUnixSupport.IsUnixPlatform())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a little confusing to me. If we're not on a Unix platform, go ahead and add these values to the test data.. but the comment says that these aren't a problem on Unix, so why would we exclude these? If they do need to be excluded, I would go with a similar approach as outlined above where we'd just go ahead and remove these and leverage a Windows test.

@jpreese jpreese added the type: bug Issues that describe misbehaving functionality label Jul 5, 2018
@jpreese

jpreese commented Jul 6, 2018

Copy link
Copy Markdown
Member

In order to increase our velocity, I'm just going to go ahead and merge in this PR since it will immensely help moving forward with PRs and validating against Linux. I think everything will work, I just have some opinions as to how things may have been done a little cleaner.

Regardless if we do agree with the above comments, we can revisit in a future PR.

@jpreese
jpreese merged commit c07563f into TestableIO:master Jul 6, 2018
@jpreese jpreese removed the type: bug Issues that describe misbehaving functionality label Jul 7, 2018
@fgreinacher

Copy link
Copy Markdown
Contributor Author

Thanks - busy days for me. Will take care of the follow-ups!

@jpreese

jpreese commented Jul 7, 2018

Copy link
Copy Markdown
Member

Sounds good! As stated above, they were mostly just suggestions. If you feel differently, I'd love to hear your counter thoughts.

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