Currently, our API doesn't provide any way to get subtest results.
The dashboard does this:
|
// Slice summary file URL to infer the URL path to get single test data. |
|
resultsURL(testRun, path) { |
|
path = this.encodeTestPath(path); |
|
// This is relying on the assumption that result |
|
// files end with '-summary.json.gz' or '-summary_v2.json.gz'. |
|
let resultsSuffix = '-summary.json.gz'; |
|
if (!testRun.results_url.includes(resultsSuffix)) { |
|
resultsSuffix = '-summary_v2.json.gz'; |
|
} |
|
const resultsBase = testRun.results_url.slice(0, testRun.results_url.lastIndexOf(resultsSuffix)); |
|
return `${resultsBase}${path}`; |
|
} |
It would be much nicer if we just had an endpoint similar to /api/results, maybe even just /api/results/subtest/a/b/c.html, which similarly redirects to relevant file.
Currently, our API doesn't provide any way to get subtest results.
The dashboard does this:
wpt.fyi/webapp/components/test-file-results.js
Lines 271 to 282 in 9c624d8
It would be much nicer if we just had an endpoint similar to
/api/results, maybe even just/api/results/subtest/a/b/c.html, which similarly redirects to relevant file.