Make an npm run test command (that executes a test-in-tree shell script) that removes the tedious aspects of local unit testing:
Copy all necessary files into a correctly-named folder in my repo (the current mach-test.sh script already does this)
Copies over the folder from the Git repo into the tree in the right directory (./browser/extensions)
Change directories in the terminal to ~/src/mozilla-unified
Fetch latest changes from branch of interest, e.g. hg pull -u release
Build Firefox with this patch, ./mach build faster
Run the test of interest, ./mach mochitest path/to/test
Change directories back to the GitHub repo
Note: The dev may still need to fetch the latest changes from the branch of interest before this approach will work. i.e. hg pull -u release and will definitely need a recent, full build of Firefox ./mach build.
Note: To extend this for other studies, there may need to be a prompt that asks the dev to provide (perhaps set as local ENV variables?):
the full path for their local build of Firefox,
the full path to their GitHub repo or ./addon subfolder inside of it, and
the relative path for the unit test they want to run locally.
Note: You don't actually have to commit locally to test your patch locally. As long as there is a diff in your working directory and you build Firefox before each test, that will be what gets tested.
Make an
npm run test
command (that executes atest-in-tree
shell script) that removes the tedious aspects of local unit testing:mach-test.sh
script already does this)./browser/extensions
)~/src/mozilla-unified
hg pull -u release
./mach build faster
./mach mochitest path/to/test
Note: The dev may still need to fetch the latest changes from the branch of interest before this approach will work. i.e.
hg pull -u release
and will definitely need a recent, full build of Firefox./mach build
. Note: To extend this for other studies, there may need to be a prompt that asks the dev to provide (perhaps set as local ENV variables?):./addon
subfolder inside of it, and