Skip to content

remote-run: make tests partially pass on Windows #20961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2018

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Dec 3, 2018

Not all the tests are possible to run on Windows since they expect a
Unix-like shell environment. However, the rest of the tests can be
accommodated. This actually found an issue in the implementation.
Since the implementation assumes the target is POSIX/Unix-y, we should
use posixpath rather than os.path which uses the host's path style.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

Not all the tests are possible to run on Windows since they expect a
Unix-like shell environment.  However, the rest of the tests can be
accommodated.  This actually found an issue in the implementation.
Since the implementation assumes the target is POSIX/Unix-y, we should
use posixpath rather than os.path which uses the host's path style.
@compnerd
Copy link
Member Author

compnerd commented Dec 3, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 3, 2018

Build failed
Swift Test OS X Platform
Git Sha - 043912f

@compnerd
Copy link
Member Author

compnerd commented Dec 3, 2018

@swift-ci please test macOS platform

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

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

I didn't know posixpath existed. Thanks!

if source_prefix.endswith(os.path.sep):
source_prefix = source_prefix[:-len(os.path.sep)]
if source_prefix.endswith(posixpath.sep):
source_prefix = source_prefix[:-len(posixpath.sep)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Arguably these should be using host-style paths, but I guess the tests aren't going to do that any time soon.

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 think that some of it needs to be host style and some of it target style. However, since we can always use / even on Windows, I think we can get away with this. The target style paths will be needed at some point, and we can deal with it then.

@compnerd compnerd merged commit 688db2b into swiftlang:master Dec 3, 2018
@compnerd compnerd deleted the remote-run branch December 3, 2018 20:23
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.

3 participants