test: fix sort-test-expectations (#12107)

This commit is contained in:
Nikolay Vitkov 2024-03-19 15:09:13 +01:00 committed by GitHub
parent c7936f0888
commit 73f3f4e173
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 95 deletions

View File

@ -584,13 +584,6 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["PASS"]
}, },
{
"testIdPattern": "[network.spec] network Page.setBypassServiceWorker *",
"platforms": ["win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{ {
"testIdPattern": "[network.spec] network Request.initiator should return the initiator", "testIdPattern": "[network.spec] network Request.initiator should return the initiator",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -1021,12 +1014,6 @@
"expectations": ["FAIL"], "expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[browsercontext.spec] BrowserContext should create new incognito context",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[browsercontext.spec] BrowserContext should fire target events", "testIdPattern": "[browsercontext.spec] BrowserContext should fire target events",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -1041,12 +1028,6 @@
"expectations": ["FAIL"], "expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[browsercontext.spec] BrowserContext should have default context",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[browsercontext.spec] BrowserContext should wait for a target", "testIdPattern": "[browsercontext.spec] BrowserContext should wait for a target",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2328,13 +2309,6 @@
"expectations": ["FAIL"], "expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch can launch and close the browser",
"platforms": ["win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{ {
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should be able to launch Chrome", "testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should be able to launch Chrome",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2671,13 +2645,6 @@
"expectations": ["FAIL"], "expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[network.spec] network Network Events Page.Events.RequestServedFromCache",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{ {
"testIdPattern": "[network.spec] network Network Events Page.Events.Response", "testIdPattern": "[network.spec] network Network Events Page.Events.Response",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2825,13 +2792,6 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[network.spec] network Response.buffer should throw if the response does not have a body",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{ {
"testIdPattern": "[network.spec] network Response.buffer should work", "testIdPattern": "[network.spec] network Response.buffer should work",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2867,13 +2827,6 @@
"expectations": ["FAIL", "PASS"], "expectations": ["FAIL", "PASS"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[network.spec] network Response.fromServiceWorker Response.fromServiceWorker",
"platforms": ["win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{ {
"testIdPattern": "[network.spec] network Response.fromServiceWorker Response.fromServiceWorker", "testIdPattern": "[network.spec] network Response.fromServiceWorker Response.fromServiceWorker",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2909,13 +2862,6 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[network.spec] network Response.text should wait until response completes",
"platforms": ["win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{ {
"testIdPattern": "[network.spec] network Response.text should work", "testIdPattern": "[network.spec] network Response.text should work",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3830,13 +3776,6 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch userDataDir option restores preferences",
"platforms": ["win32"],
"parameters": ["firefox", "headless", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{ {
"testIdPattern": "[network.spec] network Network Events Page.Events.Request", "testIdPattern": "[network.spec] network Network Events Page.Events.Request",
"platforms": ["linux"], "platforms": ["linux"],
@ -3879,34 +3818,6 @@
"expectations": ["FAIL", "PASS"], "expectations": ["FAIL", "PASS"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work for an element with an offset",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox", "headful"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work for an element with an offset",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox", "headless"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work with a rotated element",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox", "headful"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work with a rotated element",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox", "headless"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{ {
"testIdPattern": "[target.spec] Target should close a service worker", "testIdPattern": "[target.spec] Target should close a service worker",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],

View File

@ -78,14 +78,14 @@ const toBeRemoved = new Set();
for (let i = testExpectations.length - 1; i >= 0; i--) { for (let i = testExpectations.length - 1; i >= 0; i--) {
const expectation = testExpectations[i]; const expectation = testExpectations[i];
const params = new Set(expectation.parameters); const params = new Set(expectation.parameters);
const labels = new Set(expectation.expectations); const expectations = new Set(expectation.expectations);
const platforms = new Set(expectation.platforms); const platforms = new Set(expectation.platforms);
let foundMatch = false; let foundMatch = false;
for (let j = i - 1; j >= 0; j--) { for (let j = i - 1; j >= 0; j--) {
const candidate = testExpectations[j]; const candidate = testExpectations[j];
const candidateParams = new Set(candidate.parameters); const candidateParams = new Set(candidate.parameters);
const candidateLabels = new Set(candidate.expectations); const candidateExpectations = new Set(candidate.expectations);
const candidatePlatforms = new Set(candidate.platforms); const candidatePlatforms = new Set(candidate.platforms);
if ( if (
@ -93,11 +93,11 @@ for (let i = testExpectations.length - 1; i >= 0; i--) {
expectation.testIdPattern, expectation.testIdPattern,
candidate.testIdPattern candidate.testIdPattern
) && ) &&
isSubset(candidateParams, params) && isSubset(candidatePlatforms, platforms) &&
isSubset(candidatePlatforms, platforms) (isSubset(params, candidateParams) || isSubset(candidateParams, params))
) { ) {
foundMatch = true; foundMatch = true;
if (isSubset(candidateLabels, labels)) { if (isSubset(candidateExpectations, expectations)) {
console.log('removing', expectation, 'already covered by', candidate); console.log('removing', expectation, 'already covered by', candidate);
toBeRemoved.add(expectation); toBeRemoved.add(expectation);
} }
@ -105,7 +105,7 @@ for (let i = testExpectations.length - 1; i >= 0; i--) {
} }
} }
if (!foundMatch && isSubset(new Set(['PASS']), labels)) { if (!foundMatch && isSubset(new Set(['PASS']), expectations)) {
console.log( console.log(
'removing', 'removing',
expectation, expectation,