Closed Bug 429690 Opened 12 years ago Closed 11 years ago

browser tests cannot be run individually


(Testing :: Mochitest, defect)

Not set


(Not tracked)



(Reporter: sdwilsh, Assigned: Gavin)


(Keywords: fixed1.9.0.7, fixed1.9.1)


(1 file, 1 obsolete file)

It'd be really useful to be able to run only one test, instead of all the tests in a directory.
OS: Mac OS X → All
Hardware: PC → All
Summary: browser tests cannot be ran individually → browser tests cannot be run individually
Component: Testing → BrowserTest
Product: Core → Testing
QA Contact: testing → browsertest
Version: Trunk → unspecified
Attached patch patch (obsolete) — Splinter Review
This makes --test-path handle a single file. A few other minor changes:

- change summary foreground colour to white (easier to read on green or red, I find)
- make results div flex (makes it look better in the "no tests" case). This makes text inside it wrap rather than scroll, so add a default window width to avoid that happening in the common case.
- have getHTMLLogFromTests and Tester.start support running no tests, and use this when passed an invalid --test-path (with appropriate error message rather than failing silently)
Assignee: nobody →
Attachment #352881 - Flags: review?(dtownsend)
Attachment #352881 - Flags: review?(dtownsend) → review+
Comment on attachment 352881 [details] [diff] [review]

>+        // Invalid testPath...
>+        if (!testsDir.exists())
>+          return [];
>+        // If we were passed a specific file, run only that test.
>+        if (testsDir.isFile() && fileNameRegexp.test(testsDir.leafName))
>+          return [new browserTestFile(requestPath + "/" + gConfig.testPath)];

Make this return an empty array if it is a file but doesn't match the regexp
Attached patch updated patchSplinter Review
Attachment #352881 - Attachment is obsolete: true
Went through full&partial browser chrome test runs on Mac and Windows with that patch, it's ready to land.
Keywords: checkin-needed
Version: unspecified → Trunk
Does this then work with TEST_FILE when doing top level make mochitest-browser?
Does setting TEST_FILE cause to be invoked with --test-path? If so, probably!
It sure does!

I think I'll probably land this on 1.9.1 and 1.9.0 as well (need to check the status of the harness on 1.9.0, not sure we've been backporting all the fixes).
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
V.Fixed, per bug 472677 comment 6.
will need to be updated (after branch(es) checkin).
(In reply to comment #9)
> will need to be updated (after branch(es) checkin).

I've updated that document (it was also filled with falsehoods and inaccuracies).
Component: BrowserTest → Mochitest
You need to log in before you can comment on or make changes to this bug.