ability to start runtests.pl in a certain directory

RESOLVED FIXED

Status

Testing
Mochitest
--
enhancement
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: myk, Assigned: myk)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

10 years ago
Created attachment 268434 [details] [diff] [review]
patch v1: implements feature

Right now the instructions in the MochiTest FAQ on devmo say that to run one test you should "skip the --autorun argument, and then click on the test you want to run."  But finding the test in the list every time you want to run it can be painful, especially if you're doing it over and over again as you develop a set of tests.

It should be possible to specify a test path (either to a specific test or to a directory of them) on the command line and go directly to that path when the application starts.  Here's a patch that does this.

Besides adding the command-line parameter, I also fixed what I think is a bug in server.js where it appends a slash to a directory name if necessary but then appends a child filename to the slashless version.  This makes it possible to specify --test-path=foo/bar (<-- no slash at the end), where bar is a directory containing tests, and have the links on the page of tests still work.
Attachment #268434 - Flags: review?(sayrer)

Updated

10 years ago
Attachment #268434 - Flags: review?(sayrer) → review+
(In reply to comment #0)
> Besides adding the command-line parameter, I also fixed what I think is a bug
> in server.js where it appends a slash to a directory name if necessary but then
> appends a child filename to the slashless version.  This makes it possible to
> specify --test-path=foo/bar (<-- no slash at the end), where bar is a directory
> containing tests, and have the links on the page of tests still work.

That's a nice hackaround in the index generator to make the links work, but it's more a bug in the server that for /foo it serves the same content as for /foo/; the server really should respond with a redirect to /foo/ instead.  One of these days I'll get around to fixing it.
(Assignee)

Comment 2

10 years ago
Checked in to trunk:

Checking in runtests.pl.in;
/cvsroot/mozilla/testing/mochitest/runtests.pl.in,v  <--  runtests.pl.in
new revision: 1.20; previous revision: 1.19
done
Checking in server.js;
/cvsroot/mozilla/testing/mochitest/server.js,v  <--  server.js
new revision: 1.9; previous revision: 1.8
done

I also updated the MochiTest FAQ entry "How do I run just one test?" with info on using the new command line flag to run a single test or a group of tests:

http://developer.mozilla.org/en/docs/Mochitest#How_do_I_run_just_one_test_or_group_of_tests.3F
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Component: Testing → Mochitest
Product: Core → Testing
QA Contact: testing → mochitest
You need to log in before you can comment on or make changes to this bug.