squally-reporter 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +278 -189
- package/dist/index.d.ts +40 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +251 -12
- package/dist/index.js.map +1 -0
- package/dist/trace-console.d.ts +42 -0
- package/dist/trace-console.d.ts.map +1 -0
- package/dist/trace-console.js +173 -0
- package/dist/trace-console.js.map +1 -0
- package/dist/trace-zip.d.ts +23 -0
- package/dist/trace-zip.d.ts.map +1 -0
- package/dist/trace-zip.js +132 -0
- package/dist/trace-zip.js.map +1 -0
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -1,189 +1,278 @@
|
|
|
1
|
-
# squally-reporter
|
|
2
|
-
|
|
3
|
-
Playwright reporter that sends test results to your Squally dashboard.
|
|
4
|
-
|
|
5
|
-
Learn more at [
|
|
6
|
-
|
|
7
|
-
## Requirements
|
|
8
|
-
|
|
9
|
-
- Node.js >= 22.19.0 (required by the `undici` dependency)
|
|
10
|
-
- `@playwright/test` >= 1.30.0
|
|
11
|
-
|
|
12
|
-
## Install
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm install -D squally-reporter
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Config
|
|
19
|
-
|
|
20
|
-
Set two env vars (e.g. in CI secrets or `.env`):
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
SQUALLY_API_URL=https://
|
|
24
|
-
SQUALLY_API_KEY=your-project-api-key
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Find your API key on your project's Settings page in the Squally dashboard.
|
|
28
|
-
|
|
29
|
-
Then add the reporter to `playwright.config.ts`:
|
|
30
|
-
|
|
31
|
-
```ts
|
|
32
|
-
import { defineConfig } from "@playwright/test";
|
|
33
|
-
|
|
34
|
-
export default defineConfig({
|
|
35
|
-
reporter: [
|
|
36
|
-
["list"],
|
|
37
|
-
["squally-reporter"],
|
|
38
|
-
],
|
|
39
|
-
});
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Alternatively, pass config explicitly instead of using env vars - **only if
|
|
43
|
-
`apiKey` itself comes from an env var or secret store at runtime, never as a
|
|
44
|
-
literal string in a committed file:**
|
|
45
|
-
|
|
46
|
-
```ts
|
|
47
|
-
reporter: [
|
|
48
|
-
["squally-reporter", { apiUrl: "https://
|
|
49
|
-
],
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
That's it - run your tests as usual (`npx playwright test`) and results will
|
|
53
|
-
be sent to Squally after the run finishes.
|
|
54
|
-
|
|
55
|
-
##
|
|
56
|
-
|
|
57
|
-
If your `playwright.config.ts` captures screenshots or traces, the reporter
|
|
58
|
-
uploads them to Squally so they show up next to the failing test in the
|
|
59
|
-
dashboard - no separate setup beyond the two env vars above.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
reporter
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
1
|
+
# squally-reporter
|
|
2
|
+
|
|
3
|
+
Playwright reporter that sends test results to your Squally dashboard.
|
|
4
|
+
|
|
5
|
+
Learn more at [app.squally.dev](https://app.squally.dev).
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Node.js >= 22.19.0 (required by the `undici` dependency)
|
|
10
|
+
- `@playwright/test` >= 1.30.0
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -D squally-reporter
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Config
|
|
19
|
+
|
|
20
|
+
Set two env vars (e.g. in CI secrets or `.env`):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
SQUALLY_API_URL=https://app.squally.dev
|
|
24
|
+
SQUALLY_API_KEY=your-project-api-key
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Find your API key on your project's Settings page in the Squally dashboard.
|
|
28
|
+
|
|
29
|
+
Then add the reporter to `playwright.config.ts`:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { defineConfig } from "@playwright/test";
|
|
33
|
+
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
reporter: [
|
|
36
|
+
["list"],
|
|
37
|
+
["squally-reporter"],
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Alternatively, pass config explicitly instead of using env vars - **only if
|
|
43
|
+
`apiKey` itself comes from an env var or secret store at runtime, never as a
|
|
44
|
+
literal string in a committed file:**
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
reporter: [
|
|
48
|
+
["squally-reporter", { apiUrl: "https://app.squally.dev", apiKey: process.env.SQUALLY_API_KEY }],
|
|
49
|
+
],
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
That's it - run your tests as usual (`npx playwright test`) and results will
|
|
53
|
+
be sent to Squally after the run finishes.
|
|
54
|
+
|
|
55
|
+
## Artifact upload (screenshot, trace, browser console)
|
|
56
|
+
|
|
57
|
+
If your `playwright.config.ts` captures screenshots or traces, the reporter
|
|
58
|
+
uploads them to Squally so they show up next to the failing test in the
|
|
59
|
+
dashboard - no separate setup beyond the two env vars above.
|
|
60
|
+
|
|
61
|
+
Three kinds are uploaded:
|
|
62
|
+
|
|
63
|
+
| Kind | Where it comes from |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| **Screenshot** | the file Playwright writes for a failed attempt |
|
|
66
|
+
| **Trace** | the trace zip Playwright writes |
|
|
67
|
+
| **Browser console** | read out of that trace zip by this reporter |
|
|
68
|
+
|
|
69
|
+
**The browser console needs a trace.** It is not something Playwright hands a
|
|
70
|
+
reporter: `result.stdout`/`stderr` are the output of the *Node* process - what
|
|
71
|
+
your test file printed - while what the *page* printed only exists inside the
|
|
72
|
+
trace. So the reporter opens the trace and reads it out, which means an
|
|
73
|
+
attempt with no trace has no browser console, and nothing can change that but
|
|
74
|
+
turning tracing on. Squally's attempt page says which of the two it is rather
|
|
75
|
+
than showing an empty section.
|
|
76
|
+
|
|
77
|
+
Supported trace schema versions: **5 to 10**, which covers Playwright 1.30
|
|
78
|
+
through 1.62 (1.62 writes version 8). A trace outside that range is left alone
|
|
79
|
+
and the reporter prints one warning naming the version - it never uploads an
|
|
80
|
+
empty console file, because "no messages" and "this reporter could not read
|
|
81
|
+
it" must not look the same in the dashboard.
|
|
82
|
+
|
|
83
|
+
**Only from attempts worth looking at:** artifacts are uploaded only for
|
|
84
|
+
attempts that **failed**, or that **needed a retry** (even if that retry then
|
|
85
|
+
passed) - never for an attempt that passed on its first try, regardless of how
|
|
86
|
+
`screenshot`/`trace` are configured. Nobody looks at a screenshot of a test
|
|
87
|
+
that just passed, and uploading one anyway would only eat into your
|
|
88
|
+
organization's storage for no benefit.
|
|
89
|
+
|
|
90
|
+
**You need to actually enable capture in `playwright.config.ts`** - without
|
|
91
|
+
it, Playwright doesn't produce any attachments, so there's nothing for the
|
|
92
|
+
reporter to find or upload (no error either way, it's a silent no-op):
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
export default defineConfig({
|
|
96
|
+
use: {
|
|
97
|
+
screenshot: "only-on-failure",
|
|
98
|
+
trace: "retain-on-failure",
|
|
99
|
+
},
|
|
100
|
+
// ...
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Limits.** None of these are enforced by the reporter - Squally applies them
|
|
105
|
+
when the upload is requested and answers with a reason, which is what the
|
|
106
|
+
reporter prints. The numbers below are therefore Squally's current ones rather
|
|
107
|
+
than anything this package guarantees, and can change server-side without a new
|
|
108
|
+
release of it:
|
|
109
|
+
|
|
110
|
+
- **50 MB per individual file**, the same on every plan. A larger screenshot or
|
|
111
|
+
trace is rejected before any bytes are uploaded; the reporter logs a
|
|
112
|
+
`console.warn` naming the file and moves on. The test result itself is
|
|
113
|
+
reported as usual, and the run's outcome and exit code are untouched. In the
|
|
114
|
+
dashboard that artifact is shown as skipped, with the reason, rather than
|
|
115
|
+
silently missing.
|
|
116
|
+
- **A total storage cap per organization, depending on your Squally plan.**
|
|
117
|
+
Once it is reached, further uploads are rejected the same way until you free
|
|
118
|
+
up space or upgrade. Note that a fully instrumented suite now produces up to
|
|
119
|
+
three artifacts per failed attempt rather than two.
|
|
120
|
+
- The browser console is a text file of a few KB - it is extracted from the
|
|
121
|
+
trace you are already uploading, so it adds no capture cost to your run.
|
|
122
|
+
- **Your test's own `stdout`/`stderr` is cut at 16 KB** before it is sent. That
|
|
123
|
+
is this reporter's own limit, not Squally's, and it applies whether or not
|
|
124
|
+
you capture artifacts at all.
|
|
125
|
+
- Two minutes per upload, and 30 seconds for the calls that surround it. An
|
|
126
|
+
unreachable or very slow server means a skipped upload and a `console.warn`,
|
|
127
|
+
not a CI job waiting indefinitely.
|
|
128
|
+
|
|
129
|
+
Upload is best-effort and fully non-blocking, same principle as the rest of
|
|
130
|
+
this reporter - a failed or skipped upload never fails your test run or
|
|
131
|
+
changes its exit code, it only logs a `console.warn` explaining what
|
|
132
|
+
happened.
|
|
133
|
+
|
|
134
|
+
## How results reach Squally
|
|
135
|
+
|
|
136
|
+
Results stream to Squally as your suite runs, not all at once at the end:
|
|
137
|
+
each test's result is sent in a small batch, so the "running" view in the
|
|
138
|
+
dashboard stays close to real time even for a long suite. A batch goes out on
|
|
139
|
+
whichever of these comes first:
|
|
140
|
+
|
|
141
|
+
- **25 results.** Fixed, and the same whether you shard or not.
|
|
142
|
+
- **A timer, 2 seconds × the number of shards, capped at 30 seconds.** An
|
|
143
|
+
unsharded run flushes every 2 seconds; four shards every 8; eight shards
|
|
144
|
+
every 16; fifteen shards and above every 30, where the cap holds it.
|
|
145
|
+
|
|
146
|
+
Only the timer scales. All shards of a run share one rate budget on Squally's
|
|
147
|
+
side, so without this a sixteen-shard suite would send sixteen times the
|
|
148
|
+
requests of an unsharded one and throttle itself. The 25-result threshold is
|
|
149
|
+
left alone deliberately: it bounds how long a *fast* suite waits, and
|
|
150
|
+
stretching it would delay results without bounding the burst any better.
|
|
151
|
+
|
|
152
|
+
There is no longer a single-request size limit that could discard a whole run -
|
|
153
|
+
a very large suite simply takes more, smaller requests. As a courtesy the
|
|
154
|
+
reporter still warns if a run's result count climbs well past 5,000, since that
|
|
155
|
+
usually means retries are configured higher than intended rather than a suite
|
|
156
|
+
that's actually that large.
|
|
157
|
+
|
|
158
|
+
If Squally is unreachable partway through, results already sent stay in the
|
|
159
|
+
dashboard; only what could not be delivered is lost, and your test run's exit
|
|
160
|
+
code is never affected either way.
|
|
161
|
+
|
|
162
|
+
**Only actual test runs appear.** A run shows up in Squally once your first
|
|
163
|
+
test starts, so commands that never run a test create nothing: `--list`,
|
|
164
|
+
a `globalSetup` or `webServer` that fails to start, a `--grep` that matches
|
|
165
|
+
nothing. A run that *does* execute and legitimately contains no tests — an
|
|
166
|
+
empty shard, `--only-changed` with no changed test file, `--pass-with-no-tests`
|
|
167
|
+
— is still reported, as a run with zero results.
|
|
168
|
+
|
|
169
|
+
## Tests marked with `test.fail()`
|
|
170
|
+
|
|
171
|
+
Playwright's `test.fail()` marks a test as *expected to fail*: it guards a bug
|
|
172
|
+
you already know about, and Playwright runs the test anyway to check that it
|
|
173
|
+
does still fail. The interesting moment is the opposite one - when someone
|
|
174
|
+
fixes the bug, the test starts passing and Playwright turns it red so you
|
|
175
|
+
remember to delete the marker.
|
|
176
|
+
|
|
177
|
+
The reporter passes that marker on, so Squally reads such a test the same way
|
|
178
|
+
Playwright does:
|
|
179
|
+
|
|
180
|
+
- **Marked and still failing** - shown as passing, with an "expected failure"
|
|
181
|
+
label. It does not count toward your failure numbers, your flakiness
|
|
182
|
+
verdicts, or Squally's pull-request check.
|
|
183
|
+
- **Marked and now passing** - shown as a failure, because the marker is out of
|
|
184
|
+
date and should be removed.
|
|
185
|
+
|
|
186
|
+
Both ways of marking a test are recognised: the `test.fail()` modifier and a
|
|
187
|
+
`testInfo.fail()` call inside the test body. `test.skip()` and `test.fixme()`
|
|
188
|
+
are a different statement and are not affected.
|
|
189
|
+
|
|
190
|
+
Nothing is reported for an unmarked test, so an ordinary suite is unchanged.
|
|
191
|
+
Note also that Playwright itself treats a marked, failing test as expected, so
|
|
192
|
+
with `screenshot: "only-on-failure"` it captures nothing for it - there is no
|
|
193
|
+
artifact for the reporter to upload, which is consistent rather than missing.
|
|
194
|
+
|
|
195
|
+
## Sharding
|
|
196
|
+
|
|
197
|
+
**Handled automatically - no extra setup needed.** Each shard is still a
|
|
198
|
+
separate process with its own reporter instance, but Squally now correlates
|
|
199
|
+
them itself: all shards of one CI run are grouped together and shown as one
|
|
200
|
+
run once every shard has finished, with the flip side of that guarantee being
|
|
201
|
+
that the run only completes once every shard *has* reported.
|
|
202
|
+
|
|
203
|
+
Correlation is based on an id read from your CI provider's own environment,
|
|
204
|
+
so it costs you nothing on GitHub Actions, GitLab CI or CircleCI. If your
|
|
205
|
+
provider is not one of those (or you shard locally across several separate
|
|
206
|
+
`--shard` invocations), set `SQUALLY_CI_RUN_ID` to the same value for every
|
|
207
|
+
shard of one run - anything unique per CI run and shared by its shards works,
|
|
208
|
+
e.g. a build number your CI system already exposes.
|
|
209
|
+
|
|
210
|
+
**`playwright merge-reports` is not part of this and is not recommended** for
|
|
211
|
+
getting a single run in Squally - the automatic correlation above is the
|
|
212
|
+
supported path, and produces correct per-shard timing/branch/commit
|
|
213
|
+
information that a merge job cannot (see the historical note below). Nothing
|
|
214
|
+
stops you from using `merge-reports` for Playwright's own HTML report if you
|
|
215
|
+
want that separately; just don't point this reporter at the merged result
|
|
216
|
+
expecting Squally to treat it specially.
|
|
217
|
+
|
|
218
|
+
<details>
|
|
219
|
+
<summary>Why not just use `merge-reports`, historically</summary>
|
|
220
|
+
|
|
221
|
+
An earlier version of this reporter recommended `playwright merge-reports` as
|
|
222
|
+
the way to get one Squally run out of a sharded job. That path has a real
|
|
223
|
+
problem: branch, commit, commit message and author are all read on whichever
|
|
224
|
+
machine the reporter actually runs on - during a merge that is the merge job,
|
|
225
|
+
not the shards - and without a checkout there (and without the CI provider's
|
|
226
|
+
own commit variables) they all come out empty. A run with no branch is never
|
|
227
|
+
counted as a run on your stable branch, which is what Squally's broken/healthy
|
|
228
|
+
verdicts are based on - so a "merged" run could exist in the dashboard while
|
|
229
|
+
silently contributing nothing to flakiness detection. The automatic
|
|
230
|
+
correlation above reads that information from each shard's own environment
|
|
231
|
+
instead, so this problem does not arise.
|
|
232
|
+
|
|
233
|
+
</details>
|
|
234
|
+
|
|
235
|
+
## Tested revision (optional)
|
|
236
|
+
|
|
237
|
+
If your test-automation code lives in the same repo as the application it
|
|
238
|
+
tests, Squally can already tell which commit was tested from the CI
|
|
239
|
+
provider's own commit env vars. If they're **separate repos** (e.g. a
|
|
240
|
+
dedicated E2E-test repo pointed at a deployed app), set one of the following
|
|
241
|
+
so Squally knows which application state was actually tested:
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Same repo as the application under test - Squally will trust this CI
|
|
245
|
+
# job's own commit (GITHUB_SHA / CI_COMMIT_SHA) as the tested revision.
|
|
246
|
+
SAME_REPO_AS_APP=true
|
|
247
|
+
|
|
248
|
+
# Separate repos - pass the tested revision explicitly (a commit SHA, tag,
|
|
249
|
+
# or branch name/ref).
|
|
250
|
+
TESTED_REVISION=v1.2.0
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Neither variable is required - without them, test results are still sent
|
|
254
|
+
and stored exactly as before.
|
|
255
|
+
|
|
256
|
+
**The value is normalised before it is stored**, so that the same revision
|
|
257
|
+
written two ways still compares equal: it is lowercased, and a leading `v` or a
|
|
258
|
+
`refs/heads/` prefix is removed. The example above is exactly such a case -
|
|
259
|
+
`v1.2.0` is stored as `1.2.0`. The reporter says so once per run when it
|
|
260
|
+
happens, so a value that looks different in the dashboard is not a mystery.
|
|
261
|
+
|
|
262
|
+
## Troubleshooting
|
|
263
|
+
|
|
264
|
+
Set `SQUALLY_DEBUG=1` to print detail that is otherwise kept quiet - currently
|
|
265
|
+
the browser-console extraction: how many messages were found, or that an
|
|
266
|
+
attempt's trace held none. Everything that is *not* ordinary (a trace that
|
|
267
|
+
cannot be read, an unsupported schema version, a rejected upload) is printed
|
|
268
|
+
without it.
|
|
269
|
+
|
|
270
|
+
## Support
|
|
271
|
+
|
|
272
|
+
Found a bug or have a question? Please open an issue on
|
|
273
|
+
[GitHub Issues](https://github.com/squallydev-admin/squally-reporter/issues) -
|
|
274
|
+
that's the primary way to report problems or ask questions.
|
|
275
|
+
|
|
276
|
+
## License
|
|
277
|
+
|
|
278
|
+
MIT - see [LICENSE](./LICENSE).
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,12 @@ interface AppendResultEntry {
|
|
|
19
19
|
status: "passed" | "failed" | "skipped";
|
|
20
20
|
retryCount: number;
|
|
21
21
|
repeatIndex: number;
|
|
22
|
+
/**
|
|
23
|
+
* Playwright's `test.fail()` marker (spec section 1.3.1). OPTIONAL on the
|
|
24
|
+
* wire and omitted when false, so the field costs nothing on the overwhelming
|
|
25
|
+
* majority of results.
|
|
26
|
+
*/
|
|
27
|
+
expectedFailure?: boolean;
|
|
22
28
|
durationMs: number | null;
|
|
23
29
|
errors?: AppendErrorEntry[];
|
|
24
30
|
consoleOutput: string | null;
|
|
@@ -26,7 +32,7 @@ interface AppendResultEntry {
|
|
|
26
32
|
browserName: string | null;
|
|
27
33
|
errorContext: string | null;
|
|
28
34
|
}
|
|
29
|
-
type ArtifactType = "screenshot" | "trace";
|
|
35
|
+
type ArtifactType = "screenshot" | "trace" | "console";
|
|
30
36
|
declare function truncate(value: string, max: number): string;
|
|
31
37
|
declare function truncateOrNull(value: string | null, max: number): string | null;
|
|
32
38
|
/**
|
|
@@ -58,10 +64,35 @@ declare function resolveTestedRevision(): ResolvedRevision | null;
|
|
|
58
64
|
declare function toPosixPath(p: string): string;
|
|
59
65
|
declare function stripAnsi(value: string): string;
|
|
60
66
|
declare function maskSecrets(value: string): string;
|
|
61
|
-
|
|
67
|
+
/**
|
|
68
|
+
* The console output to send, and the size it had before the cut.
|
|
69
|
+
*
|
|
70
|
+
* RETURNS A PAIR SINCE 17.09., the same shape squally-app's own
|
|
71
|
+
* prepareConsoleOutput returns (lib/ingest-v2-core.ts). The reason is a gap
|
|
72
|
+
* nobody could see from either side alone: the app records
|
|
73
|
+
* consoleOutputOriginalBytes so a truncated capture says so on the page, and
|
|
74
|
+
* it derives that number from the text it RECEIVES - which this reporter has
|
|
75
|
+
* already cut to 16 KiB. The app therefore records NULL for every
|
|
76
|
+
* reporter-sent row and the page says nothing was cut, while something was.
|
|
77
|
+
*
|
|
78
|
+
* `truncatedFromBytes` is the masked size before the cut, null when nothing
|
|
79
|
+
* was cut - the optional-field shape the wire uses for expectedFailure.
|
|
80
|
+
*
|
|
81
|
+
* NOT SENT YET, and deliberately not: squally-app's v2 result schema has no
|
|
82
|
+
* field for it (checked in lib/ingest-v2-contract.ts, resultSchema), and that
|
|
83
|
+
* schema does not use .strict(), so zod would silently STRIP an unknown key.
|
|
84
|
+
* Sending it today would look done and change nothing. The receiving side goes
|
|
85
|
+
* first in this project - that is how the console artifact itself shipped -
|
|
86
|
+
* so the value is computed and available here, and the wire field is a
|
|
87
|
+
* squally-app change this release reports rather than pre-empts.
|
|
88
|
+
*/
|
|
89
|
+
declare function prepareConsoleOutput(value: string | null): {
|
|
90
|
+
text: string | null;
|
|
91
|
+
truncatedFromBytes: number | null;
|
|
92
|
+
};
|
|
62
93
|
declare function mapErrors(errors: readonly TestError[]): AppendErrorEntry[] | undefined;
|
|
63
94
|
declare function attemptQualifiesForArtifacts(mappedStatus: AppendResultEntry["status"], retryCount: number): boolean;
|
|
64
|
-
declare function artifactKey(testName: string, filePath: string, retryCount: number, type: ArtifactType): string;
|
|
95
|
+
declare function artifactKey(testName: string, filePath: string, retryCount: number, repeatIndex: number, type: ArtifactType): string;
|
|
65
96
|
declare function parseRetryAfterMs(headerValue: string | null, nowMs: number): number | null;
|
|
66
97
|
declare function computeBackoffMs(retryNumber: number): number;
|
|
67
98
|
export default class SquallyReporter implements Reporter {
|
|
@@ -78,6 +109,11 @@ export default class SquallyReporter implements Reporter {
|
|
|
78
109
|
private runConfig;
|
|
79
110
|
private buffer;
|
|
80
111
|
private artifacts;
|
|
112
|
+
/** Trace schema versions already warned about - ONCE per run, not per
|
|
113
|
+
* attempt. A suite failing 200 tests under a Playwright this reporter does
|
|
114
|
+
* not know would otherwise print 200 identical paragraphs and teach the
|
|
115
|
+
* reader to scroll past the one thing worth reading. */
|
|
116
|
+
private warnedTraceVersions;
|
|
81
117
|
/**
|
|
82
118
|
* Every result this shard produced, counted where it is produced (0.6.0).
|
|
83
119
|
*
|
|
@@ -160,3 +196,4 @@ export declare const __internal: {
|
|
|
160
196
|
artifactKey: typeof artifactKey;
|
|
161
197
|
};
|
|
162
198
|
export {};
|
|
199
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACX,MAAM,2BAA2B,CAAC;AAcnC,UAAU,sBAAsB;IAG9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAyCD,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ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