Closed Bug 993478 Opened 10 years ago Closed 10 years ago

Let a user select docroot for the webserver

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla31

People

(Reporter: mdas, Assigned: mdas)

Details

(Whiteboard: [runner])

Attachments

(1 file, 1 obsolete file)

Right now, we hardcode our webserver to host our www/ directory for the use of our unit tests, but it'd be really useful if we can pass in any directory, so marionette test runner consumers can use the webserver.
Attached patch allow server-root to be passed (obsolete) — Splinter Review
Tested locally. You can pass --server-root and we'll check if the directory exists and use that, if it doesn't exist, we throw, and if you don't pass it in, we use our default.

All tests pass locally without --server-root, and with --server-root pointing to a copy of www/ somewhere else on my machine.
Attachment #8403403 - Flags: review?(jgriffin)
Comment on attachment 8403403 [details] [diff] [review]
allow server-root to be passed

Review of attachment 8403403 [details] [diff] [review]:
-----------------------------------------------------------------

lgtm

::: testing/marionette/client/marionette/runner/base.py
@@ +586,4 @@
>          self.shuffle = shuffle
>          self.sdcard = sdcard
>          self.sources = sources
> +        self.server_root = server_root 

nit: extra space EOL

@@ +662,5 @@
>              host = moznetwork.get_ip()
> +        docroot = self.server_root or os.path.join(os.path.dirname(os.path.dirname(__file__)), 'www')
> +        if not os.path.isdir(docroot):
> +            raise Exception("Server root %s is not a valid path" % docroot)
> +        print 'docroot %s' % docroot

Let's either remove this or replace it with self.logger.debug()
Attachment #8403403 - Flags: review?(jgriffin) → review+
Attached patch updated patchSplinter Review
updated wrt comments and landed in m-i:

https://hg.mozilla.org/integration/mozilla-inbound/rev/60d427dbb7dc
Attachment #8403403 - Attachment is obsolete: true
Attachment #8404702 - Flags: review+
Backed out for failures of form:
https://tbpl.mozilla.org/php/getParsedLog.php?id=37574920&tree=Mozilla-Inbound
{
07:57:30     INFO -  starting httpd
07:57:30     INFO -  Traceback (most recent call last):
07:57:30     INFO -    File "/builds/slave/talos-slave/test/gaia/tests/python/gaia-ui-tests/gaiatest/cli.py", line 4, in <module>
07:57:30     INFO -      main()
07:57:30     INFO -    File "/builds/slave/talos-slave/test/gaia/tests/python/gaia-ui-tests/gaiatest/runtests.py", line 49, in main
07:57:30     INFO -      cli(runner_class=GaiaTestRunner, parser_class=GaiaTestOptions)
07:57:30     INFO -    File "/builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/marionette/runtests.py", line 28, in cli
07:57:30     INFO -      runner = startTestRunner(runner_class, options, tests)
07:57:30     INFO -    File "/builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/marionette/runtests.py", line 19, in startTestRunner
07:57:30     INFO -      runner.run_tests(tests)
07:57:30     INFO -    File "/builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/marionette/runner/base.py", line 791, in run_tests
07:57:30     INFO -      self.start_httpd(need_external_ip)
07:57:30     INFO -    File "/builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/marionette/runner/base.py", line 665, in start_httpd
07:57:30     INFO -      raise Exception("Server root %s is not a valid path" % docroot)
07:57:30     INFO -  Exception: Server root /builds/slave/talos-slave/test/build/venv/lib/python2.7/site-packages/marionette/www is not a valid path
}

remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/22c2638791cf
Thanks, I'm testing a new patch on https://tbpl.mozilla.org/?tree=Try&rev=04c981433319, will land when that's green.
This went under the radar. Try is green so I've landed in inbound:
   https://hg.mozilla.org/integration/mozilla-inbound/rev/993c3b5ff459
Wonderful; thanks!
https://hg.mozilla.org/mozilla-central/rev/993c3b5ff459
Assignee: nobody → mdas
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.