We store shard number in the report metadata event and then sort shard
files by shard number. This guarantees that within each project sharded
events will always go in stable order.
Usually, we can just chain two locators with `>>` to implement
`Locator.locator(locator)`. However, this does not play nicely with more
advanced inner locators like `or` and `and`:
```ts
const child = page.locator('input').or(page.locator('button'));
page.locator('parent').locator(child);
```
One would expect the above to locate "input or button" inside a
"parent". However, currently it locates "input inside a parent" or
"button", because it's translated to `parent >> input >>
internal:or="button"`.
To fix this, we have to wrap inner locator into `internal:chain` and
query it separately from the parent.
Fixes#23724.
* Fix report downloading from Azure (reports are now zipped)
* Extracted upload logic into an action
* Extracted PR number file generation into its own job
We have been optionally adding `-<number>` in multiple places, and these
might collide in various circumstances, for example: two contexts at the
same time, one of them has the second trace chunk.
References #23387.
Partial fix for https://github.com/microsoft/playwright/issues/6319
After this fix, the following scenario won't leak and the context state
(cookies, storage, etc) can be reused by the new page sessions:
```js
for (let i = 0; i < 1000; ++i) {
const page = await context.newPage();
await page.goto('...');
await page.close('...');
}
```
Fixes
```
Notice: Report url: https://mspwblobreport.z1.web.core.windows.net/run-5533005176-1-a0b0752662f8af5f841ff7a65b04d02066474ff2/index.html
ReferenceError: fs is not defined
at eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15143:16), <anonymous>:30:18)
at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15144:12)
at main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15236:26)
at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:15217:1
at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:15268:3
at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:152[71](https://github.com/microsoft/playwright/actions/runs/5533535965/jobs/10097205178#step:12:72):12)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
```
Fixes#24144.
Previously, we only matched by url, which confuses GET and HEAD requests
where the latter is usually zero-sized.
Also make sure that resources are sorted by their monotonicTime, since
that's not always the case in the trace file, where they are sorted by
the "response body retrieved" time.