Open Bug 1338070 Opened 3 years ago Updated 3 years ago

I can't seem to be able to create a *.any.js file that ends up with substitutions in the usual something.sub.html way

Categories

(Testing :: web-platform-tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: bzbarsky, Unassigned)

Details

I tried creating a test that uses the any.js infrastructure but gets substitutions via the normal .sub.something stuff.

If I try calling the new test html/dom/self-origin.any.sub.js, I get an error during manifest update:

  File "testing/web-platform/tests/tools/manifest/sourcefile.py", line 467, in manifest_items
    TestharnessTest(self, replace_end(self.url, ".any.js", ".any.html")),
  File "testing/web-platform/tests/tools/manifest/sourcefile.py", line 29, in replace_end
    assert s.endswith(old)

If I try calling it html/dom/self-origin.any.sub.js, the manifest is updated properly and we thing we have html/dom/self-origin.sub.any.html and html/dom/self-origin.sub.any.worker.html tests.

However, if I run the html/dom/self-origin.sub.any.html test, it loads /html/dom/self-origin.sub.any.js which doesn't get substitutions performed on it.  not surprising, since afaict our harness only does substitutions on things ending with .sub.someext, and this filename doesn't.
Flags: needinfo?(james)
I guess it's not terribly surprising that the code gets more brittle as we combine more features into the file name :/

Something like this could work after the next wpt sync: https://github.com/w3c/web-platform-tests/pull/4708/files#diff-fc42d85aa48305641e0c7dcb9d40fee5R1

Still, it's probably worth checking how much work it'd be to make this work.
I think maybe we can move the .sub. handling out of the file handler and put it later in the pipeline, just before the content is sent over the wire. I'll investigate.
I have a PR up to make .sub.any.js work: https://github.com/w3c/wpt-tools/pull/183
Flags: needinfo?(james)
You need to log in before you can comment on or make changes to this bug.