Skip to content
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

Fix some buildbot tests under Python 3 #2610

Merged
merged 14 commits into from
Jan 20, 2017
Merged

Fix some buildbot tests under Python 3 #2610

merged 14 commits into from
Jan 20, 2017

Conversation

rodrigc
Copy link
Contributor

@rodrigc rodrigc commented Jan 16, 2017

These tests now work under Python 3:

trial buildbot.test.unit.test_steps_transfer
trial buildbot.test.unit.test_scripts_tryserver
trial buildbot.test.unit.test_schedulers_trysched

@mention-bot
Copy link

@rodrigc, thanks for your PR! By analyzing the history of the files in this pull request, we identified @douglatornell, @djmitche and @tardyp to be potential reviewers.

@@ -812,7 +813,8 @@ def addLogWithFailure(self, why, logprefix=""):
# helper for showing exceptions to the users
try:
yield self.addCompleteLog(logprefix + "err.text", why.getTraceback())
yield self.addHTMLLog(logprefix + "err.html", formatFailure(why))
yield self.addHTMLLog(logprefix + "err.html",
bytes2NativeString(formatFailure(why)))
Copy link
Member

Choose a reason for hiding this comment

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

I would expect addHTMLLog to do the ascii2unicode by itself (will probably save you a lot of fixes)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK I made the change.

cStringIO is gone in Python 3
cStringIO is gone in Python 3
cStringIO is gone in Python 3
cStringIO is gone in Python 3
StringIO.StringIO is gone in Python 3
On Python 3, map() returns a generator, not a list.
This eliminates these errors on Python 3:
  "'map' object is not subscriptable"
stringified representation of the json.

In Python 2 and Python 3, the order of the dictionary is different,
so this was causing the stringified json to be in a slightly
different order on Python 3, causing the test to fail.
…rors on Python 3.

Refactor into helper function.
This fixes errors on Python 3
@rodrigc
Copy link
Contributor Author

rodrigc commented Jan 20, 2017

@tardyp Can #2610 and #2613 go in? I've incorporated your feedback.
Future patches I have are interdependent on these patches.

Thanks.

@tardyp tardyp closed this Jan 20, 2017
@tardyp tardyp reopened this Jan 20, 2017
@tardyp
Copy link
Member

tardyp commented Jan 20, 2017

sorry, I've been struggling with the CI instabilities. need to make sure everything is okay

@tardyp tardyp merged commit 20fa808 into buildbot:master Jan 20, 2017
@rodrigc rodrigc deleted the cStringIO branch January 21, 2017 22:36
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.

None yet

3 participants