Closed Bug 937210 Opened 11 years ago Closed 10 years ago

Some Talos class names are really weird

Categories

(Testing :: Talos, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wlach, Assigned: sambuddhabasu1)

Details

Attachments

(3 files)

For some reason in talos, many of the class names are not capitalized, so we have:

talosError
talosRegression
talosCrash
talosProcess

This is a really strange convention and is not consistent with either PEP8 or the rest of the talos codebase. Unless I'm missing something IMO we should capitalize these class names. We could use facebook's codemod for this to make sure everything's covered:

http://wrla.ch/blog/2012/06/mass-code-relicensing-with-facebooks-codemod/
Does the above make sense Joel? Or is there some rationalization behind the above naming convention that I'm unaware of?
Flags: needinfo?(jmaher)
Summary: Talos exception class names are weird → Some Talos class names are really weird
I am fine with capitalizing the names.  We just need to make sure what is printed out matches the regex stuff that tbpl uses (https://hg.mozilla.org/webtools/tbpl/file/tip/php/inc/ ..)

we can change tbpl, but it is more work.

:edmorley, where does tbpl parse for talos errors?
Flags: needinfo?(jmaher) → needinfo?(emorley)
(In reply to Joel Maher (:jmaher) from comment #2)
> I am fine with capitalizing the names.  We just need to make sure what is
> printed out matches the regex stuff that tbpl uses
> (https://hg.mozilla.org/webtools/tbpl/file/tip/php/inc/ ..)
> 
> we can change tbpl, but it is more work.
> 
> :edmorley, where does tbpl parse for talos errors?

A quick grep of the tbpl source tree (http://hg.mozilla.org/webtools/tbpl) does not find any reference to any of the class names mentioned above.
(In reply to Joel Maher (:jmaher) from comment #2)
> :edmorley, where does tbpl parse for talos errors?

https://hg.mozilla.org/webtools/tbpl/file/fb30dd66567f/php/inc/GeneralErrorFilter.php#l47

>  47        || preg_match("/^[A-Za-z]+Error:/", $line)  // . . . . . . . . . .  . . Python exceptions

(And yeah very hacky)

So won't be affected :-)
Flags: needinfo?(emorley)
I am interested in solving this bug. Please assign it to me.
Assignee: nobody → sammygamer
running command like : find /path/to/start/from/ -type f | xargs perl -pi -e 's/talosError/TalosError/g'  on the talos directory 
as in : http://www.spiration.co.uk/post/522/in-place-replacement-from-command-line
might be useful , or facebook codemod http://wrla.ch/blog/2012/06/mass-code-relicensing-with-facebooks-codemod/ 
as :wlach said in Descrition to be sure everything is covered
Attachment #8374915 - Flags: review?(jmaher)
Comment on attachment 8374915 [details] [diff] [review]
Talos class names were changed

Review of attachment 8374915 [details] [diff] [review]:
-----------------------------------------------------------------

all the xtalosError stuff is changed to xTalosError, we should either:
1) leave it alone
2) change it to XTalosError

note: I only commented on lines for a specific file, there are a couple other files with xTalosError in them.

::: talos/xtalos/etlparser.py
@@ +418,5 @@
>      args = xtalos.options_from_config(args, config_file)
>  
>      # ensure process ID is given
>      if not args.get('processID'):
> +        raise xtalos.xTalosError("No process ID option given")

we don't need to change this

@@ +423,4 @@
>  
>      # ensure path to xperf given
>      if not os.path.exists(args['xperf_path']):
> +        raise xtalos.xTalosError("ERROR: xperf_path '%s' does not exist" % args['xperf_path'])

nor this.
Attachment #8374915 - Flags: review?(jmaher) → review-
xtalosError was left as it is. The class names mentioned were changed.
Attachment #8374955 - Flags: review?(jmaher)
Comment on attachment 8374955 [details] [diff] [review]
Talos class names were changed

Review of attachment 8374955 [details] [diff] [review]:
-----------------------------------------------------------------

this looks good, let me test it on try server.
Attachment #8374955 - Flags: review?(jmaher) → review+
Well, to be consistent with PEP8 and the intent of this bug, we should also change XTalosError to XTalosError
Change talosProcess.py to TalosProcess.py . Also, as mentioned by :wlach, it has been changed to XTalosError
Attachment #8375464 - Flags: review?(jmaher)
Comment on attachment 8375464 [details] [diff] [review]
Change talks class names

Review of attachment 8375464 [details] [diff] [review]:
-----------------------------------------------------------------

thanks, this is looking good.  I am running on try to ensure this doesn't cause any random regressions
Attachment #8375464 - Flags: review?(jmaher) → review+
https://hg.mozilla.org/build/talos/rev/a87b48746f70

this will be picked up in the next talos deployment to inbound, probably late next week.
oh, this went live in inbound this morning.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: