@kinora/reporter 0.0.2 → 0.0.4
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 +7 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -27,9 +27,13 @@ export default defineConfig({
|
|
|
27
27
|
})
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
The
|
|
30
|
+
The token comes from the environment (keep it out of the config file). The server URL defaults to the hosted cloud; set `KINORA_URL` only when self-hosting:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
+
# hosted cloud
|
|
34
|
+
KINORA_TOKEN=<project-token> npx playwright test
|
|
35
|
+
|
|
36
|
+
# self-host
|
|
33
37
|
KINORA_URL=https://kinora.example.com KINORA_TOKEN=<project-token> npx playwright test
|
|
34
38
|
```
|
|
35
39
|
|
|
@@ -49,7 +53,7 @@ Create a project API token in the kinora dashboard (Settings → API tokens).
|
|
|
49
53
|
| Option | Type | Default | Description |
|
|
50
54
|
| --------- | ------------------------------------ | ---------------------- | ------------------------------------------ |
|
|
51
55
|
| `project` | `{ slug: string, name?: string }` | required | Target project. `name` defaults to `slug`. |
|
|
52
|
-
| `url` | `string` | env `KINORA_URL
|
|
56
|
+
| `url` | `string` | env `KINORA_URL`, then cloud | kinora server base URL. Set for self-host. |
|
|
53
57
|
| `token` | `string` | env `KINORA_TOKEN` | Project API token. Prefer the env var. |
|
|
54
58
|
| `git` | `{ sha?, branch? }` | auto on GitHub Actions | Git metadata for the run. |
|
|
55
59
|
| `ci` | `{ provider?, runUrl?, runNumber? }` | auto on GitHub Actions | CI metadata for the run. |
|
|
@@ -67,7 +71,7 @@ On GitHub Actions, `git` and `ci` are filled from the standard `GITHUB_*` env va
|
|
|
67
71
|
|
|
68
72
|
## Notes
|
|
69
73
|
|
|
70
|
-
- If `
|
|
74
|
+
- If `KINORA_TOKEN` is missing, the reporter logs a warning and skips the upload, so local runs aren't affected. `KINORA_URL` is optional (defaults to the hosted cloud).
|
|
71
75
|
- Traces are uploaded only for tests that produced one, so enable `trace` in your Playwright config (`on-first-retry`, `retain-on-failure`, etc.).
|
|
72
76
|
- Cross-run test identity is the file + title path + Playwright project name, so history stays stable as long as those don't change.
|
|
73
77
|
|
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { FullConfig, FullResult, Reporter, Suite } from "@playwright/test/report
|
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
5
|
interface KinoraReporterOptions {
|
|
6
|
-
/** kinora server base URL. Defaults to env KINORA_URL. */
|
|
6
|
+
/** kinora server base URL. Defaults to env KINORA_URL, then the hosted cloud. Set for self-host. */
|
|
7
7
|
url?: string;
|
|
8
8
|
/** Project API token. Defaults to env KINORA_TOKEN (keep it out of the config file). */
|
|
9
9
|
token?: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import process from "node:process";
|
|
3
|
-
import { IngestError, createIngestClient, isTraceAttachment, makeTestKey } from "@kinora/core";
|
|
3
|
+
import { DEFAULT_KINORA_URL, IngestError, createIngestClient, isTraceAttachment, makeTestKey } from "@kinora/core";
|
|
4
4
|
//#region src/index.ts
|
|
5
5
|
function identity(test) {
|
|
6
6
|
let file = "";
|
|
@@ -97,10 +97,10 @@ var KinoraReporter = class {
|
|
|
97
97
|
this.suite = suite;
|
|
98
98
|
}
|
|
99
99
|
async onEnd(result) {
|
|
100
|
-
const url = this.options.url ?? process.env.KINORA_URL;
|
|
100
|
+
const url = this.options.url ?? process.env.KINORA_URL ?? DEFAULT_KINORA_URL;
|
|
101
101
|
const token = this.options.token ?? process.env.KINORA_TOKEN;
|
|
102
|
-
if (!
|
|
103
|
-
console.warn("[kinora] skipping upload: missing
|
|
102
|
+
if (!token) {
|
|
103
|
+
console.warn("[kinora] skipping upload: missing token (set KINORA_TOKEN)");
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
const tests = (this.suite?.allTests() ?? []).map(toNormTest);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinora/reporter",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"description": "Playwright reporter that uploads test results to a kinora server",
|
|
6
6
|
"author": "Joris Gallot",
|
|
7
7
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@playwright/test": ">=1.40.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@kinora/core": "0.0.
|
|
39
|
+
"@kinora/core": "0.0.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@playwright/test": "^1.60.0",
|