@kinora/reporter 0.1.0 → 0.1.2
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 +4 -9
- package/dist/index.mjs +5 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -27,17 +27,13 @@ export default defineConfig({
|
|
|
27
27
|
})
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
The token comes from the environment (keep it out of the config file)
|
|
30
|
+
The token comes from the environment (keep it out of the config file); the server URL defaults to the hosted cloud:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
# hosted cloud
|
|
34
33
|
KINORA_TOKEN=<token> npx playwright test
|
|
35
|
-
|
|
36
|
-
# self-host
|
|
37
|
-
KINORA_URL=https://kinora.example.com KINORA_TOKEN=<token> npx playwright test
|
|
38
34
|
```
|
|
39
35
|
|
|
40
|
-
Create
|
|
36
|
+
Create an API token in the kinora dashboard (Settings → Workspace). Self-hosting? Point at your server with `KINORA_URL` - see [selfhost/README.md](https://github.com/joris-gallot/kinora/blob/main/selfhost/README.md).
|
|
41
37
|
|
|
42
38
|
## Options
|
|
43
39
|
|
|
@@ -55,17 +51,16 @@ Create a API token in the kinora dashboard (Settings → API tokens).
|
|
|
55
51
|
| `project` | `{ slug: string, name?: string }` | required | Target project. `name` defaults to `slug`. |
|
|
56
52
|
| `url` | `string` | env `KINORA_URL`, then cloud | kinora server base URL. Set for self-host. |
|
|
57
53
|
| `token` | `string` | env `KINORA_TOKEN` | Project API token. Prefer the env var. |
|
|
58
|
-
| `git` | `{ sha?, branch? }`
|
|
54
|
+
| `git` | `{ sha?, branch?, repoUrl? }` | auto on GitHub Actions | Git metadata. `repoUrl` links a sha to its commit. |
|
|
59
55
|
| `ci` | `{ provider?, runUrl?, runNumber? }` | auto on GitHub Actions | CI metadata for the run. |
|
|
60
56
|
|
|
61
|
-
On GitHub Actions, `git` and `ci` are filled from the standard `GITHUB_*` env vars. Pass them explicitly on other CI providers.
|
|
57
|
+
On GitHub Actions, `git` and `ci` are filled from the standard `GITHUB_*` env vars (including the repo URL, so shas link to their commit in the dashboard). Pass them explicitly on other CI providers.
|
|
62
58
|
|
|
63
59
|
## CI example (GitHub Actions)
|
|
64
60
|
|
|
65
61
|
```yaml
|
|
66
62
|
- run: npx playwright test
|
|
67
63
|
env:
|
|
68
|
-
KINORA_URL: ${{ vars.KINORA_URL }}
|
|
69
64
|
KINORA_TOKEN: ${{ secrets.KINORA_TOKEN }}
|
|
70
65
|
```
|
|
71
66
|
|
package/dist/index.mjs
CHANGED
|
@@ -70,10 +70,13 @@ function countsOf(tests) {
|
|
|
70
70
|
function detectGit() {
|
|
71
71
|
const sha = process.env.GITHUB_SHA;
|
|
72
72
|
const branch = process.env.GITHUB_REF_NAME;
|
|
73
|
-
|
|
73
|
+
const { GITHUB_SERVER_URL, GITHUB_REPOSITORY } = process.env;
|
|
74
|
+
const repoUrl = GITHUB_SERVER_URL && GITHUB_REPOSITORY ? `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}` : void 0;
|
|
75
|
+
if (!sha && !branch && !repoUrl) return void 0;
|
|
74
76
|
return {
|
|
75
77
|
sha,
|
|
76
|
-
branch
|
|
78
|
+
branch,
|
|
79
|
+
repoUrl
|
|
77
80
|
};
|
|
78
81
|
}
|
|
79
82
|
function detectCi() {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinora/reporter",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
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.1.
|
|
39
|
+
"@kinora/core": "0.1.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@playwright/test": "^1.60.0",
|