Closed Bug 1091277 Opened 10 years ago Closed 10 years ago

Move replaceBackSlashes out of automationutils

Categories

(Testing :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla36

People

(Reporter: jgriffin, Assigned: lubin.davidg, Mentored)

References

Details

(Whiteboard: [good first bug][lang=python])

User Story

Replace all call sites of automationutils:replaceBackSlashes ( http://dxr.mozilla.org/mozilla-central/search?q=replaceBackSlashes+ext%3Apy&case=true ) with the actual method, and delete it from automationutils.py.

Attachments

(1 file, 1 obsolete file)

automationutils:replaceBackSlashes is really trivial and there's no reason to include it in any library. We should replace all call sites ( http://dxr.mozilla.org/mozilla-central/search?q=replaceBackSlashes+ext%3Apy&case=true&redirect=true ) with the actual method.
User Story: (updated)
Whiteboard: [good first bug][lang=python]
Hi. I'd like to try and help with this bug. Could you explain what you mean when you say 'the actual method'? Is there another definition of replaceBackSlashes other than in automationutils that should be imported? Or do you mean that the functionality needs to be implemented at the call sites? Thanks.
Flags: needinfo?(jgriffin)
Attached patch replaceBackSlashes.patch (obsolete) (deleted) — Splinter Review
I went ahead and made a patch in which the following changes were made: In build/automationutils.py, replaceBackSlashes was deleted; In testing/xpcshell/remotexpcshelltests.py and testing/xpcshell/runxpcshelltests.py, all instances of replaceBackSlashes were changed so that replaceBackSlashes(var) -> var.replace('\\', '/') and replaceBackSlashes is no longer imported. I did notice that after pulling the latest updates and building, the file runxpcshelltests.py was not the same as what you linked to. Changes had taken place that made the lines off. Additionally, this file did not have the lines 'from automationutils import replaceBackSlashes, addCommonOptions' or 'path = replaceBackSlashes(test_object['path']);' Can you please let me know if this patch correctly resolves the bug?
Attachment #8514456 - Flags: review?(jgriffin)
Yep, that fixes it, though it looks like you missed one instance of 'replaceBackSlashes' here: http://dxr.mozilla.org/mozilla-central/source/testing/xpcshell/runxpcshelltests.py#995
Flags: needinfo?(jgriffin)
I updated and built my directory before making any changes to the source code, but it seems my local version of runxpcshelltests.py is different from the one at http://dxr.mozilla.org/mozilla-central/source/testing/xpcshell/runxpcshelltests.py. The entire method definition in which that line occurs, makeTestId is gone for me. I've confirmed that no instances of replaceBackSlashes remain in my local copy. Is it possible that the dxr.mozilla.org version needs to be updated? Or do you think something is wrong on my end?
Adding needinfo flag
(In reply to David Lubin from comment #4) > I updated and built my directory before making any changes to the source > code, but it seems my local version of runxpcshelltests.py is different from > the one at > http://dxr.mozilla.org/mozilla-central/source/testing/xpcshell/ > runxpcshelltests.py. The entire method definition in which that line occurs, > makeTestId is gone for me. I've confirmed that no instances of > replaceBackSlashes remain in my local copy. Is it possible that the > dxr.mozilla.org version needs to be updated? Or do you think something is > wrong on my end? How did you update your directory?
I went into mozilla-central and used hg pull -u, followed by ./mach build.
(In reply to David Lubin from comment #7) > I went into mozilla-central and used hg pull -u, followed by ./mach build. makeTestId was added Oct 22 in http://hg.mozilla.org/mozilla-central/rev/b2dc4f1dc9b3. This suggests your repo is out of date for some reason, or out of sync. What does 'hg log -l 1 testing/xpcshell/runxpcshelltests.py' report?
Right now, it's giving me information about the patch I just uploaded: changeset: 213092:19fda1d3571d tag: qtip tag: replaceBackSlashes.patch tag: tip parent: 212385:671bc8f0190e user: David Lubin <lubin.davidg@gmail.com> date: Thu Oct 30 14:39:07 2014 -0400 summary: replaceBackSlashes removed from automationutils, calls to replaceBackSlashes replaced with actual method
Ah, in that case, how about 'hg log -l 4 testing/xpcshell/runxpcshelltests.py'?
This is the output: changeset: 213092:19fda1d3571d tag: qtip tag: replaceBackSlashes.patch tag: tip parent: 212385:671bc8f0190e user: David Lubin <lubin.davidg@gmail.com> date: Thu Oct 30 14:39:07 2014 -0400 summary: replaceBackSlashes removed from automationutils, calls to replaceBackSlashes replaced with actual method David-Lubins-MacBook-Pro:mozilla-central davidlubin$ hg log -l 4 testing/xpcshell/runxpcshelltests.py changeset: 213092:19fda1d3571d tag: qtip tag: replaceBackSlashes.patch tag: tip parent: 212385:671bc8f0190e user: David Lubin <lubin.davidg@gmail.com> date: Thu Oct 30 14:39:07 2014 -0400 summary: replaceBackSlashes removed from automationutils, calls to replaceBackSlashes replaced with actual method changeset: 212702:43a764935c1b user: Tom Tromey <tom@tromey.com> date: Fri Oct 24 09:40:00 2014 -0400 summary: Bug 1075072 - Pass debuggerArgs as a string to get_debugger_info. r=ted changeset: 212493:b2dc4f1dc9b3 user: Chris Manchester <cmanchester@mozilla.com> date: Wed Oct 22 15:53:42 2014 -0400 summary: Bug 1033126 - Convert xpcshell tests to use mozlog.structured format for logging.;r=ted changeset: 212405:b339acb1f7fe user: Nicholas Nethercote <nnethercote@mozilla.com> date: Thu Oct 09 19:28:33 2014 -0700 summary: Bug 1076446 (attempt 2) - Make the DMD test work on Windows. r=glandium.
I should probably mention that this is my second bug and that I didn't actually begin working with the repo in any way until the 25th. This file looks more like mine I thinks: http://hg.mozilla.org/mozilla-central/file/de805196bbc4/testing/xpcshell/runxpcshelltests.py
It looks like your repo isn't completed updated. Try this: hg qref hg qpop -a hg pull hg update -C hg qpush And then see if you see the makeTestId method in runxpcshelltests.py. If you see any errors during the above, let me know what they are.
It looks like there are errors pushing the patch back on the stack. The file looks to be up to date now, though, so I think I'll just remake the patch as it shouldn't take long. Do you know why my repo was out of date? Should I always pop all patches before I update?
Attached patch replaceBackSlashesV2.patch (deleted) — Splinter Review
I think this patch should cover everything. Please let me know what you think.
Attachment #8514456 - Attachment is obsolete: true
Attachment #8514456 - Flags: review?(jgriffin)
Attachment #8514538 - Flags: review?(jgriffin)
Also, could you please assign this bug to me?
Assignee: nobody → lubin.davidg
Status: NEW → ASSIGNED
Comment on attachment 8514538 [details] [diff] [review] replaceBackSlashesV2.patch Review of attachment 8514538 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, thanks! I'll run this on tryserver in a bit to make sure there aren't any problems.
Attachment #8514538 - Flags: review?(jgriffin) → review+
(In reply to David Lubin from comment #14) > It looks like there are errors pushing the patch back on the stack. The file > looks to be up to date now, though, so I think I'll just remake the patch as > it shouldn't take long. > > Do you know why my repo was out of date? Should I always pop all patches > before I update? That's often the easiest way. For more details, see "Updating your patches when the underlying code changes" at http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html
Try looks good!
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Thanks for the patch, David.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: