Closed Bug 872174 Opened 12 years ago Closed 10 years ago

Improve mutt test function blocks to better reflect what the test is doing

Categories

(Testing Graveyard :: Mozmill, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: jfrench, Unassigned, Mentored)

References

()

Details

So stated here https://developer.mozilla.org/en-US/docs/Mozmill_Tests/Mozmill_Style_Guide#.C2.A0Test_Scripts it says the test function block name is supposed to be a camel case equivalent of the file name of the test. While working on bug 858731 in the case of mutt, there appear to be many tests which are incorrectly named according to that standard. If not most of them. Some don't match, others use a generic. eg. (mutt/mutt/tests/js/utils/savescreenshot.js) var testScreenshotSaveCorruption = function () { (mutt/mutt/tests/js/controller/dnd_chrome.js) var test = function () { So this bug represents the work to harmonize the test function block name, to what we anticipate the desired name of the test should be. If we pursue this, I could open a separate bug for the renaming of the tests in the repo to some sort of standardized naming convention; if the current underscore "test_name.js" style for mutt is considered less than ideal, and we want a consistent mutt camel case "testName.js" file name, like Mozmill. In the scenario above, we might ultimately end up with something like: mutt/mutt/tests/js/utils/saveScreenShot.js var testSaveScreenShot = function () { The first task would for me would be to build a list current file names vs. function names, so we can easily determine what they are, and determine what the new function name should be for each. If it's all supposed to be the way it is right now, feel free to mark the bug resolved invalid.
I think that conflicts a bit with bug 767286. Tests as of now have to start with test, and I made a failure in renaming those files. Now the collector can't get them anymore when specifying a whole subfolder. I would say lets bug 767286 fixed first, and we can come back to this one later. Beside that I don't think we have to duplicate the test module name in the test function. We should better use a name which reflects what this test is doing.
Depends on: 767286
Sorry, you're right, I meant to spec my proposed renaming based on the existing restriction as mutt/mutt/tests/js/utils/testSaveScreenShot.js var testSaveScreenShot = function () { But, I see where you are going with bug 767286; so we can revisit this one after that bug is resolved.
Having done all of the structural renaming work in bug 767286, I don't think there will be any work to do in this bug w.r.t. camel Case naming consistency. I will leave this bug open for now, and revisit when 767286 is resolved fixed. Maybe this bug might become only a "use a function name that better reflects what the test is doing", bug. Or closed and a new bug opened for that.
Sounds like a good compromise. So I agree, yes.
Now that bug 767286 is fixed this bug can now stand for just using function names that better reflect what the test is doing. I am adjusting the title accordingly. I will need to do some information gathering to build a list of candidates for these changes.
Summary: Harmonize mutt test function blocks with their file names → Improve mutt test function blocks to better reflect what the test is doing
Whiteboard: [mentor=whimboo][lang=js] → [mentor=whimboo][lang=js][good first bug]
I haven't had time to get back to this bug, so unassigning myself in case someone else wants to take the remainder of the work. Or maybe it can be closed without action on the issue, I defer to Henrik.
Assignee: tojonmz → nobody
Status: ASSIGNED → NEW
Mentor: hskupin
Whiteboard: [mentor=whimboo][lang=js][good first bug] → [lang=js][good first bug]
Mozmill will reach its end of life soon. We are currently working on getting all the tests for Firefox ported to Marionette. For status updates please see bug 1080766.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Whiteboard: [lang=js][good first bug]
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.