Skip to content

Commit

Permalink
Add a serve command to the wpt frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham committed Jun 28, 2017
1 parent a996204 commit c3f95a5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Running Tests Manually

The test server can be started using

./serve
./wpt serve

This will start HTTP servers on two ports and a websockets server on
one port. By default one web server starts on port 8000 and the other
Expand Down Expand Up @@ -121,6 +121,7 @@ The `wpt` command provides a frontend to a variety of tools for
working with and running web-platform-tests. Some of the most useful
commands are:

* `wpt serve` - For starting the wpt http server
* `wpt run` - For running tests in a browser
* `wpt lint` - For running the lint against all tests
* `wpt manifest` - For updating or generating a `MANIFEST.json` test manifest
Expand Down
4 changes: 2 additions & 2 deletions ci_unittest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ if [ $TOXENV == "py27" ] || [ $TOXENV == "pypy" ]; then

cd $ROOT
pip install --requirement tools/browserutils/requirements.txt
wpt install firefox browser --destination $HOME
wpt install firefox webdriver --destination $HOME/firefox
./wpt install firefox browser --destination $HOME
./wpt install firefox webdriver --destination $HOME/firefox
export PATH=$HOME/firefox:$PATH

cd $ROOT/resources/test
Expand Down
2 changes: 2 additions & 0 deletions tools/serve/commands.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"serve": {"path": "serve.py", "script": "run", "parser": "get_parser", "help": "Run wptserve server",
"virtualenv": false}}
8 changes: 6 additions & 2 deletions tools/serve/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,7 @@ def get_parser():
return parser


def main():
kwargs = vars(get_parser().parse_args())
def run(**kwargs):
config = load_config("config.default.json",
"config.json",
**kwargs)
Expand All @@ -784,3 +783,8 @@ def main():
item.join(1)
except KeyboardInterrupt:
logger.info("Shutting down")


def main():
kwargs = vars(get_parser().parse_args())
return run(**kwargs)
3 changes: 2 additions & 1 deletion tools/wpt/paths
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tools/wpt/
tools/browserutils/
tools/lint/
tools/manifest/
tools/serve/
tools/wpt/

0 comments on commit c3f95a5

Please sign in to comment.