Cache manifest in travis
diff --git a/.travis.yml b/.travis.yml
index 98d2d64..6f9abb5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -93,6 +93,7 @@
 cache:
   directories:
     - $HOME/.cache/pip
+    - $HOME/meta
 notifications:
   email:
     on_success: never
diff --git a/tools/ci/ci_lint.sh b/tools/ci/ci_lint.sh
index 5ee2ceb..46b317e 100644
--- a/tools/ci/ci_lint.sh
+++ b/tools/ci/ci_lint.sh
@@ -4,5 +4,6 @@
 WPT_ROOT=$(readlink -f $SCRIPT_DIR/../..)
 cd $WPT_ROOT
 
-./wpt manifest
+mkdir -p ~/meta
+./wpt manifest -p ~/meta/MANIFEST.json
 ./wpt lint
diff --git a/tools/wpt/commands.json b/tools/wpt/commands.json
index 42c8c16..1ab767f 100644
--- a/tools/wpt/commands.json
+++ b/tools/wpt/commands.json
@@ -3,7 +3,7 @@
             "virtualenv": true, "install": ["requests"], "requirements": ["../wptrunner/requirements.txt"]},
     "files-changed": {"path": "testfiles.py", "script": "run_changed_files", "parser": "get_parser",
                       "help": "Get a list of files that have changed", "virtualenv": false},
-    "tests-affected": {"path": "testfiles.py", "script": "run_tests_affected", "parser": "get_parser",
+    "tests-affected": {"path": "testfiles.py", "script": "run_tests_affected", "parser": "get_parser_affected",
                        "help": "Get a list of tests affected by changes", "virtualenv": false},
     "install": {"path": "install.py", "script": "run", "parser": "get_parser", "help": "Install browser components"}
 }
diff --git a/tools/wpt/testfiles.py b/tools/wpt/testfiles.py
index e17eefa..4d6781d 100644
--- a/tools/wpt/testfiles.py
+++ b/tools/wpt/testfiles.py
@@ -194,6 +194,15 @@
     return parser
 
 
+def get_parser_affected():
+    parser = get_parser()
+    parser.add_argument("--metadata",
+                        dest="metadata_root",
+                        action="store",
+                        default=wpt_root,
+                        help="Directory that will contain MANIFEST.json")
+    return parser
+
 def get_revish(**kwargs):
     revish = kwargs["revish"]
     if kwargs["revish"] is None:
@@ -211,6 +220,7 @@
 def run_tests_affected(**kwargs):
     revish = get_revish(**kwargs)
     changed, _ = files_changed(revish, kwargs["ignore_dirs"])
-    tests_changed, dependents = affected_testfiles(changed, set(["conformance-checkers", "docs", "tools"]))
+    tests_changed, dependents = affected_testfiles(changed, set(["conformance-checkers", "docs", "tools"]),
+                                                   manifest_path=os.path.join(kwargs["metadata_root"], "MANIFEST.json"))
     for item in sorted(tests_changed | dependents):
         print(os.path.relpath(item, wpt_root))
diff --git a/tools/wpt/tests/test_wpt.py b/tools/wpt/tests/test_wpt.py
index 8eb4e76..e3b8d1f 100644
--- a/tools/wpt/tests/test_wpt.py
+++ b/tools/wpt/tests/test_wpt.py
@@ -34,7 +34,9 @@
         if os.path.exists(fx_path):
             shutil.rmtree(fx_path)
         with pytest.raises(SystemExit) as excinfo:
-            wpt.main(argv=["run", "--no-pause", "--install-browser", "--yes", "firefox", "/dom/nodes/Element-tagName.html"])
+            wpt.main(argv=["run", "--no-pause", "--install-browser", "--yes",
+                           "--metadata", "~/meta/",
+                           "firefox", "/dom/nodes/Element-tagName.html"])
         assert os.path.exists(fx_path)
         shutil.rmtree(fx_path)
         assert excinfo.value.code == 0
@@ -44,7 +46,9 @@
 
 def test_run_chrome():
     with pytest.raises(SystemExit) as excinfo:
-        wpt.main(argv=["run", "--yes", "--no-pause", "--binary-arg", "headless", "chrome", "/dom/nodes/Element-tagName.html"])
+        wpt.main(argv=["run", "--yes", "--no-pause", "--binary-arg", "headless",
+                       "--metadata", "~/meta/",
+                       "chrome", "/dom/nodes/Element-tagName.html"])
     assert excinfo.value.code == 0
 
 
@@ -93,7 +97,7 @@
     # that specific commit. But we can at least test it returns something sensible
     commit = "9047ac1d9f51b1e9faa4f9fad9c47d109609ab09"
     with pytest.raises(SystemExit) as excinfo:
-        wpt.main(argv=["tests-affected", "%s~..%s" % (commit, commit)])
+        wpt.main(argv=["tests-affected", "--metadata", "~/meta/", "%s~..%s" % (commit, commit)])
     assert excinfo.value.code == 0
     out, err = capsys.readouterr()
     assert "html/browsers/offline/appcache/workers/appcache-worker.html" in out