@kinora/reporter 0.0.4 → 0.1.1

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 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). The server URL defaults to the hosted cloud; set `KINORA_URL` only when self-hosting:
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
- KINORA_TOKEN=<project-token> npx playwright test
35
-
36
- # self-host
37
- KINORA_URL=https://kinora.example.com KINORA_TOKEN=<project-token> npx playwright test
33
+ KINORA_TOKEN=<token> npx playwright test
38
34
  ```
39
35
 
40
- Create a project API token in the kinora dashboard (Settings → API tokens).
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
 
@@ -50,22 +46,21 @@ Create a project API token in the kinora dashboard (Settings → API tokens).
50
46
  ]
51
47
  ```
52
48
 
53
- | Option | Type | Default | Description |
54
- | --------- | ------------------------------------ | ---------------------- | ------------------------------------------ |
55
- | `project` | `{ slug: string, name?: string }` | required | Target project. `name` defaults to `slug`. |
49
+ | Option | Type | Default | Description |
50
+ | --------- | ------------------------------------ | ---------------------------- | ------------------------------------------ |
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
- | `token` | `string` | env `KINORA_TOKEN` | Project API token. Prefer the env var. |
58
- | `git` | `{ sha?, branch? }` | auto on GitHub Actions | Git metadata for the run. |
59
- | `ci` | `{ provider?, runUrl?, runNumber? }` | auto on GitHub Actions | CI metadata for the run. |
53
+ | `token` | `string` | env `KINORA_TOKEN` | Project API token. Prefer the env var. |
54
+ | `git` | `{ sha?, branch?, repoUrl? }` | auto on GitHub Actions | Git metadata. `repoUrl` links a sha to its commit. |
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
- if (!sha && !branch) return void 0;
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.0.4",
4
+ "version": "0.1.1",
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.4"
39
+ "@kinora/core": "0.1.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@playwright/test": "^1.60.0",