web-platform-tests gets its test list from a manifest file that's
generated from the content of the tests. Unfortunately generating this
manifest is slow, so it's unreasonable to create it from scratch for
every test run. Until recently the generated manifest was kept
in-tree, which was suboptimal in a few ways:
- The manifest tended to get out of sync with the actual source
- The large json file caused problems for tooling including source control and the review frontends.
We previously switched mach wpt to download a manifest on demand and
apply an incremental update. However this work missed the usage in
jstests.py. This continued to use the increasing outdated in-tree
manifest, which causes a number of problems
- It doesn't have an up-to-date list of tests
- It blocks removing that file
- It blocks landing various optimisations to make updating the manifest faster.
This patch fixes jstests.py to use a downloaded manifest. Unlike the
tests run through a mach frontend jstests.py doesn't know where the
objdir is, so it's hard to work out where to download the
manifest. This patch adopts a heuristic approach; if the path to the
jsshell looks like <root>/dist/bin and <root>/_tests exists, we assume
it's a gecko-like objdir and use <root>/_tests/web-platform/ for the
manifest; otherwise we just put it into the system tempdir.
Because the manifest has to be updated on startup, this patch causes a
startup time regression, but this will be considerably reduced by the
work in Bug 1497898 for which this is a prerequisite.