Skip to content

[POSIX] convert Mac-specific functional tests to POSIX where viable#1529

Merged
chrisd8088 merged 3 commits intomicrosoft:masterfrom
github:posix-only-func-tests
Sep 24, 2019
Merged

[POSIX] convert Mac-specific functional tests to POSIX where viable#1529
chrisd8088 merged 3 commits intomicrosoft:masterfrom
github:posix-only-func-tests

Conversation

@chrisd8088
Copy link
Contributor

Where appropriate, convert functional tests marked MacOnly into POSIXOnly tests which also execute on Linux.

The rename(2) function is identical on Linux and Mac, so update its DllImport wrapper name to POSIXRename() from MacRename() in GVFSLockTests.

Finally, use generic POSIX options to ln(1) in BashRunner because the GitStatusReportsSymLinkChanges() functional test will fail on Linux otherwise, as ln -s -F does not have the same meaning as on BSD/Darwin; the -F flag does not imply -f on
Linux but instead tries to hard link a directory. Thus the deletion of the target testFilePath in the test does not occur and the test fails. Instead, we use ln -s -f in the CreateSymbolicLink() method in BashRunner which suffices on both types of systems.

Where appropriate, convert functional tests marked MacOnly
into POSIXOnly tests which also execute on Linux.
The rename(2) function is identical on Linux and Mac, so
update its DllImport wrapper name to POSIXRename() from
MacRename() in GVFSLockTests.
The GitStatusReportsSymLinkChanges() functional test will
fail on Linux because "ln -s -F" does not have the same
meaning as on BSD/Darwin; the -F flag does not imply -f on
Linux but instead tries to hard-link a directory.  Thus
the deletion of the target testFilePath in the test does
not occur and the test fails.

Instead, we use "ln -s -f" in the CreateSymbolicLink()
method in BashRunner which suffices on both types of
systems.
@chrisd8088 chrisd8088 changed the title POSIX-only functional tests [WIP] [POSIX] POSIX-only functional tests Sep 22, 2019
@chrisd8088 chrisd8088 closed this Sep 23, 2019
@chrisd8088 chrisd8088 reopened this Sep 23, 2019
@chrisd8088 chrisd8088 removed the WIP label Sep 24, 2019
@chrisd8088 chrisd8088 changed the title [WIP] [POSIX] POSIX-only functional tests [POSIX] convert MacOnly functional tests to POSIXOnly where appropriate Sep 24, 2019
@chrisd8088 chrisd8088 changed the title [POSIX] convert MacOnly functional tests to POSIXOnly where appropriate [POSIX] convert Mac-specific functional tests for POSIX where viable Sep 24, 2019
@chrisd8088 chrisd8088 marked this pull request as ready for review September 24, 2019 03:34
@chrisd8088 chrisd8088 requested a review from wilbaker September 24, 2019 03:34
@chrisd8088
Copy link
Contributor Author

@wilbaker -- This PR now contains just the POSIX-specific bits from #1413 (which has been simplified as a result), as we discussed.

And, as a bonus, I found some ways to simplify this set of changes too, so I'm glad I took the time to re-review these. Let me know if you see anything of concern, though!

@chrisd8088 chrisd8088 changed the title [POSIX] convert Mac-specific functional tests for POSIX where viable [POSIX] convert Mac-specific functional tests to POSIX where viable Sep 24, 2019
@chrisd8088 chrisd8088 merged commit 7a2bc66 into microsoft:master Sep 24, 2019
@chrisd8088 chrisd8088 deleted the posix-only-func-tests branch September 24, 2019 17:36
@chrisd8088
Copy link
Contributor Author

Thanks for the 👍 @wilbaker!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants