diff --git a/testing/web-platform/tests/resources/test/wptserver.py b/testing/web-platform/tests/resources/test/wptserver.py index 6acad835277c..fa32c33b9d78 100644 --- a/testing/web-platform/tests/resources/test/wptserver.py +++ b/testing/web-platform/tests/resources/test/wptserver.py @@ -9,12 +9,15 @@ import urllib2 class WPTServer(object): def __init__(self, wpt_root): self.wpt_root = wpt_root + + # This is a terrible hack to get the default config of wptserve. sys.path.insert(0, os.path.join(wpt_root, "tools")) - from serve.serve import Config - config = Config() - self.host = config["browser_host"] - self.http_port = config["ports"]["http"][0] - self.https_port = config["ports"]["https"][0] + from serve.serve import build_config + with build_config() as config: + self.host = config["browser_host"] + self.http_port = config["ports"]["http"][0] + self.https_port = config["ports"]["https"][0] + self.base_url = 'http://%s:%s' % (self.host, self.http_port) self.https_base_url = 'https://%s:%s' % (self.host, self.https_port) diff --git a/testing/web-platform/tests/tools/ci/jobs.py b/testing/web-platform/tests/tools/ci/jobs.py index a1f37dd60af6..6f3f64560167 100644 --- a/testing/web-platform/tests/tools/ci/jobs.py +++ b/testing/web-platform/tests/tools/ci/jobs.py @@ -23,7 +23,7 @@ job_path_map = { "!css/[^/]*$"], "lint": [".*"], "manifest_upload": [".*"], - "resources_unittest": ["resources/"], + "resources_unittest": ["resources/", "tools/"], "tools_unittest": ["tools/"], "wptrunner_unittest": ["tools/wptrunner/*"], "build_css": ["css/"], diff --git a/testing/web-platform/tests/tools/ci/tests/test_jobs.py b/testing/web-platform/tests/tools/ci/tests/test_jobs.py index ac3729cf18c5..e888ad884a18 100644 --- a/testing/web-platform/tests/tools/ci/tests/test_jobs.py +++ b/testing/web-platform/tests/tools/ci/tests/test_jobs.py @@ -7,6 +7,8 @@ def test_testharness(): assert jobs.get_jobs(["resources/testharness.js"]) == default_jobs | set(["resources_unittest"]) assert jobs.get_jobs(["resources/testharness.js"], includes=["resources_unittest"]) == set(["resources_unittest"]) + assert jobs.get_jobs(["tools/wptserve/wptserve/config.py"], + includes=["resources_unittest"]) == set(["resources_unittest"]) assert jobs.get_jobs(["foo/resources/testharness.js"], includes=["resources_unittest"]) == set()