Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Updating runtest.py so that it works with Python 3 #19768

Merged
merged 1 commit into from
Aug 31, 2018
Merged

Updating runtest.py so that it works with Python 3 #19768

merged 1 commit into from
Aug 31, 2018

Conversation

tannergooding
Copy link
Member

#19213 updated runtest.cmd to start calling runtest.py on Windows. For users which only have python 3 installed, this broke the ability to run tests.

This updates the runtest.py file so that it works under Python 3.

@tannergooding
Copy link
Member Author

CC. @jashook

tests/runtest.py Outdated
@@ -1318,7 +1318,7 @@ def copy_tree(src, dest):

if host_os != "Windows_NT":
# Set executable bit
os.chmod(os.path.join(dest, item), 0774)
os.chmod(os.path.join(dest, item), 774)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only line that doesn't modify a print call

@tannergooding
Copy link
Member Author

The rest of the changes were print args to print(args)

Copy link

@jashook jashook left a comment

Choose a reason for hiding this comment

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

Lgtm thanks for the changes.

tests/runtest.py Outdated
@@ -1716,7 +1716,7 @@ def parse_test_results(host_os, arch, build_type, coreclr_repo_location, test_lo
return tests

def print_summary(tests):
""" Print a summary of the test results
""" print(a summary of the test results
Copy link

Choose a reason for hiding this comment

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

This change should not be incldued

Copy link
Member Author

Choose a reason for hiding this comment

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

oops, will fix

@tannergooding
Copy link
Member Author

@jashook, there were a couple things I missed, and then I remembered "2to3.py" existed, so I just ran the script through that instead.

Validated locally that python3.7 and python2.7 both work as expected.

@@ -239,14 +239,14 @@ def __add_configuration_to_launch_json__(self):
if self.env is not None:
# Convert self.env to a defaultdict
self.env = defaultdict(lambda: None, self.env)
for key, value in env.iteritems():
for key, value in env.items():
Copy link
Member Author

Choose a reason for hiding this comment

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

Python3 removed iteritem

print
print contents
print
print()
Copy link
Member Author

Choose a reason for hiding this comment

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

python3 won't complain about just print, but does require print() for it work as intended

@tannergooding
Copy link
Member Author

All the changes required to support Python3 should be documented as part of the 3.0 release notes here: https://docs.python.org/3.0/whatsnew/3.0.html

@tannergooding
Copy link
Member Author

test Windows_NT arm64 Cross Debug Innerloop Build please
test Windows_NT arm Cross Debug Innerloop Build please

@tannergooding tannergooding merged commit 6e780ac into dotnet:master Aug 31, 2018
echesakov added a commit that referenced this pull request Oct 24, 2018
…lix queue

Port (partially) the following changes:

*  Build xunit wrappers the same way on windows and unix (#18695)
*  Update vc-runtime package to support ARM and ARM64 with current builds (#19265)
*  build-test - fix TestWrapper CS warnings (#19180)
*  Clean up build.cmd/build-test.cmd/runtest.cmd (#19291)
*  Use runtest.py to run tests for all platforms (#19213)
*  Updating runtest.py so that it works with Python 3 (#19768)
*  Fix build-test.sh wrapper build (#19779)
*  Move ARM64 Windows boxen to be Helix-provisioned (#20204)
*  Runtest.py on Windows Arm(64) (#20227)
*  Use runtest.cmd for arm(64) windows testing (#20301)
*  Do not restore or initialize buildtools for x86/arm64 (#20370)
*  Add hack for arm64/x86 to skip build tools restore (#20390)

Update Xunit to 2.4.1 prerelease version

Use the latest version (dbf0bf1) of tests/runtest.py
echesakov added a commit that referenced this pull request Oct 24, 2018
…lix queue

Port (partially) the following changes:

*  Build xunit wrappers the same way on windows and unix (#18695)
*  Work around cmd command length limit in xunit Exec task (#19095)
*  Update vc-runtime package to support ARM and ARM64 with current builds (#19265)
*  build-test - fix TestWrapper CS warnings (#19180)
*  Clean up build.cmd/build-test.cmd/runtest.cmd (#19291)
*  Use runtest.py to run tests for all platforms (#19213)
*  Updating runtest.py so that it works with Python 3 (#19768)
*  Fix build-test.sh wrapper build (#19779)
*  Move ARM64 Windows boxen to be Helix-provisioned (#20204)
*  Runtest.py on Windows Arm(64) (#20227)
*  Use runtest.cmd for arm(64) windows testing (#20301)
*  Do not restore or initialize buildtools for x86/arm64 (#20370)
*  Add hack for arm64/x86 to skip build tools restore (#20390)

Update Xunit to 2.4.1 prerelease version

Use the latest version (dbf0bf1) of tests/runtest.py
echesakov added a commit that referenced this pull request Oct 25, 2018
…lix queue

Port (partially) the following changes:

*  Build xunit wrappers the same way on windows and unix (#18695)
*  Work around cmd command length limit in xunit Exec task (#19095)
*  Update vc-runtime package to support ARM and ARM64 with current builds (#19265)
*  build-test - fix TestWrapper CS warnings (#19180)
*  Clean up build.cmd/build-test.cmd/runtest.cmd (#19291)
*  Use runtest.py to run tests for all platforms (#19213)
*  Updating runtest.py so that it works with Python 3 (#19768)
*  Fix build-test.sh wrapper build (#19779)
*  Move ARM64 Windows boxen to be Helix-provisioned (#20204)
*  Runtest.py on Windows Arm(64) (#20227)
*  Use runtest.cmd for arm(64) windows testing (#20301)
*  Do not restore or initialize buildtools for x86/arm64 (#20370)
*  Add hack for arm64/x86 to skip build tools restore (#20390)

Update Xunit to 2.4.1 prerelease version

Use the latest version (dbf0bf1) of tests/runtest.py
echesakov added a commit that referenced this pull request Oct 26, 2018
…lix queue

Port (partially) the following changes:

*  Build xunit wrappers the same way on windows and unix (#18695)
*  Work around cmd command length limit in xunit Exec task (#19095)
*  Update vc-runtime package to support ARM and ARM64 with current builds (#19265)
*  build-test - fix TestWrapper CS warnings (#19180)
*  Clean up build.cmd/build-test.cmd/runtest.cmd (#19291)
*  Use runtest.py to run tests for all platforms (#19213)
*  Updating runtest.py so that it works with Python 3 (#19768)
*  Fix build-test.sh wrapper build (#19779)
*  Move ARM64 Windows boxen to be Helix-provisioned (#20204)
*  Runtest.py on Windows Arm(64) (#20227)
*  Use runtest.cmd for arm(64) windows testing (#20301)
*  Do not restore or initialize buildtools for x86/arm64 (#20370)
*  Add hack for arm64/x86 to skip build tools restore (#20390)

Update Xunit to 2.4.1 prerelease version

Use the latest version (dbf0bf1) of tests/runtest.py
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants