findCallerFrame should not call String.match on a filename (testUndoTabFromContextMenu.js)

RESOLVED FIXED

Status

defect
RESOLVED FIXED
8 years ago
13 days ago

People

(Reporter: whimboo, Assigned: whimboo)

Tracking

({regression})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [lib][mozmill-test-failure], )

Attachments

(2 attachments)

Module:    testUndoTabFromContextMenu.js
Test:      testUndoTabFromContextMenu    
Failure:   invalid quantifier 
Branches:  ALL
Platforms: ALL

With the landing of the assertions module in our current shared module system, we introduced an orange failure. Not sure how to reproduce so far but looks like something is wrong with calling the findCallerFrame method.
A web search showed me that it is related to RegEx. I will dig into later.
Ok, so this only fails if the repository gets cloned to a temporary location on OS X, e.g. "/var/folders/ur/urRSHOmhFJOHFVCrfZAVW++++TI/-Tmp-/tmpfgdil4.mozmill-tests".

Due to the contained special characters '+' and |-| it's not a valid regex and the call 'frame.filename.match(filename)' will fail. We should simply check if the filename is contained. No need to call match here.
Summary: Test failure 'invalid quantifier ' in testUndoTabFromContextMenu → findCallerFrame should not call String.match on a filename (testUndoTabFromContextMenu.js)
Whiteboard: [mozmill-test-failure] → [shared module][mozmill-test-failure]
A Pivotal Tracker story has been created for this Bug: https://www.pivotaltracker.com/story/show/15762377
Comment on attachment 545874 [details] [diff] [review]
Patch v1

Looks good.
Attachment #545874 - Flags: review?(dave.hunt) → review+
Comment on attachment 545878 [details] [diff] [review]
Patch v1 (api refactor)

r+, looks fine. 

I agree this was the most appropriate fix. For times when we really do want to inject a string into a regex, I filed Bug 671705.
Attachment #545878 - Flags: review?(gmealer) → review+
Landed on API refactoring repo:
https://github.com/geoelectric/mozmill-api-refactor/commit/57f7fe588d3e74413d86d28d6d8425b0394694ec
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Component: Mozmill Tests → Mozmill Shared Modules
Component: Mozmill Shared Modules → Mozmill Tests
Whiteboard: [shared module][mozmill-test-failure] → [lib]
Whiteboard: [lib] → [lib][mozmill-test-failure]
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.