@jskit-ai/jskit-catalog 0.2.131 → 0.2.133
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/catalog/packages.json +117 -86
- package/package.json +1 -1
- package/scripts/testing/command.mjs +180 -50
- package/scripts/testing/file-stop.mjs +24 -10
- package/scripts/testing/run-files.mjs +58 -0
- package/scripts/testing/time-report.mjs +28 -18
package/catalog/packages.json
CHANGED
|
@@ -6,55 +6,55 @@
|
|
|
6
6
|
"release": {
|
|
7
7
|
"packages": {
|
|
8
8
|
"@jskit-ai/agent": "0.1.6",
|
|
9
|
-
"@jskit-ai/agent-docs": "0.1.
|
|
9
|
+
"@jskit-ai/agent-docs": "0.1.381",
|
|
10
10
|
"@jskit-ai/agent-runtime": "0.1.57",
|
|
11
11
|
"@jskit-ai/architecture-inspector": "0.1.37",
|
|
12
|
-
"@jskit-ai/assistant-core": "0.2.
|
|
13
|
-
"@jskit-ai/assistant-runtime": "0.2.
|
|
14
|
-
"@jskit-ai/assistant-voice": "0.2.
|
|
15
|
-
"@jskit-ai/assistant-voice-sherpa": "0.1.
|
|
12
|
+
"@jskit-ai/assistant-core": "0.2.107",
|
|
13
|
+
"@jskit-ai/assistant-runtime": "0.2.115",
|
|
14
|
+
"@jskit-ai/assistant-voice": "0.2.115",
|
|
15
|
+
"@jskit-ai/assistant-voice-sherpa": "0.1.162",
|
|
16
16
|
"@jskit-ai/auth-core": "0.2.43",
|
|
17
17
|
"@jskit-ai/auth-pass": "0.1.12",
|
|
18
18
|
"@jskit-ai/auth-provider-local-core": "0.2.52",
|
|
19
19
|
"@jskit-ai/auth-provider-local-db-core": "0.1.215",
|
|
20
|
-
"@jskit-ai/auth-provider-oidc-core": "0.2.
|
|
20
|
+
"@jskit-ai/auth-provider-oidc-core": "0.2.82",
|
|
21
21
|
"@jskit-ai/auth-provider-supabase-core": "0.2.46",
|
|
22
|
-
"@jskit-ai/auth-web": "0.2.
|
|
22
|
+
"@jskit-ai/auth-web": "0.2.72",
|
|
23
23
|
"@jskit-ai/config-eslint": "0.1.255",
|
|
24
24
|
"@jskit-ai/connector-google-calendar": "0.2.64",
|
|
25
25
|
"@jskit-ai/connectors-catalog": "0.2.69",
|
|
26
26
|
"@jskit-ai/connectors-core": "0.2.64",
|
|
27
27
|
"@jskit-ai/connectors-web": "0.2.64",
|
|
28
|
-
"@jskit-ai/console-core": "0.2.
|
|
29
|
-
"@jskit-ai/console-web": "0.1.
|
|
30
|
-
"@jskit-ai/crud-core": "0.2.
|
|
28
|
+
"@jskit-ai/console-core": "0.2.77",
|
|
29
|
+
"@jskit-ai/console-web": "0.1.315",
|
|
30
|
+
"@jskit-ai/crud-core": "0.2.66",
|
|
31
31
|
"@jskit-ai/database-runtime": "0.1.295",
|
|
32
32
|
"@jskit-ai/database-runtime-mysql": "0.1.293",
|
|
33
33
|
"@jskit-ai/database-runtime-postgres": "0.1.292",
|
|
34
34
|
"@jskit-ai/http-runtime": "0.2.39",
|
|
35
|
-
"@jskit-ai/http-web": "0.2.
|
|
36
|
-
"@jskit-ai/jskit-catalog": "0.2.
|
|
35
|
+
"@jskit-ai/http-web": "0.2.73",
|
|
36
|
+
"@jskit-ai/jskit-catalog": "0.2.133",
|
|
37
37
|
"@jskit-ai/kernel": "0.2.38",
|
|
38
38
|
"@jskit-ai/material-web": "0.1.17",
|
|
39
|
-
"@jskit-ai/mobile-capacitor": "0.2.
|
|
39
|
+
"@jskit-ai/mobile-capacitor": "0.2.64",
|
|
40
40
|
"@jskit-ai/oidc-issuer-core": "0.1.65",
|
|
41
41
|
"@jskit-ai/payments-core": "0.2.53",
|
|
42
42
|
"@jskit-ai/payments-web": "0.2.39",
|
|
43
|
-
"@jskit-ai/realtime": "0.2.
|
|
43
|
+
"@jskit-ai/realtime": "0.2.67",
|
|
44
44
|
"@jskit-ai/release": "0.1.18",
|
|
45
45
|
"@jskit-ai/resource-core": "0.1.229",
|
|
46
46
|
"@jskit-ai/resource-crud-core": "0.1.231",
|
|
47
47
|
"@jskit-ai/resource-runtime": "0.2.61",
|
|
48
|
-
"@jskit-ai/rewarded-core": "0.2.
|
|
49
|
-
"@jskit-ai/rewarded-web": "0.2.
|
|
50
|
-
"@jskit-ai/shell-web": "0.2.
|
|
48
|
+
"@jskit-ai/rewarded-core": "0.2.77",
|
|
49
|
+
"@jskit-ai/rewarded-web": "0.2.91",
|
|
50
|
+
"@jskit-ai/shell-web": "0.2.64",
|
|
51
51
|
"@jskit-ai/storage-runtime": "0.1.284",
|
|
52
52
|
"@jskit-ai/uploads-image-web": "0.2.38",
|
|
53
53
|
"@jskit-ai/uploads-runtime": "0.2.38",
|
|
54
|
-
"@jskit-ai/users-core": "0.2.
|
|
55
|
-
"@jskit-ai/users-web": "0.2.
|
|
56
|
-
"@jskit-ai/workspaces-core": "0.2.
|
|
57
|
-
"@jskit-ai/workspaces-web": "0.2.
|
|
54
|
+
"@jskit-ai/users-core": "0.2.77",
|
|
55
|
+
"@jskit-ai/users-web": "0.2.99",
|
|
56
|
+
"@jskit-ai/workspaces-core": "0.2.77",
|
|
57
|
+
"@jskit-ai/workspaces-web": "0.2.99"
|
|
58
58
|
},
|
|
59
59
|
"singletonPackages": [
|
|
60
60
|
"@jskit-ai/assistant-runtime",
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
"packageId": "@jskit-ai/assistant-core",
|
|
188
|
-
"version": "0.2.
|
|
188
|
+
"version": "0.2.107",
|
|
189
189
|
"description": "Reusable assistant client/server/shared primitives without surface-specific routes or settings ownership.",
|
|
190
190
|
"jskit": {
|
|
191
191
|
"kind": "runtime",
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
},
|
|
370
370
|
{
|
|
371
371
|
"packageId": "@jskit-ai/assistant-runtime",
|
|
372
|
-
"version": "0.2.
|
|
372
|
+
"version": "0.2.115",
|
|
373
373
|
"description": "Capability-based assistant runtime with per-surface chat, transcripts, settings, and action tools.",
|
|
374
374
|
"jskit": {
|
|
375
375
|
"kind": "runtime",
|
|
@@ -475,16 +475,16 @@
|
|
|
475
475
|
},
|
|
476
476
|
"packageJson": {
|
|
477
477
|
"dependencies": {
|
|
478
|
-
"@jskit-ai/assistant-core": "0.2.
|
|
478
|
+
"@jskit-ai/assistant-core": "0.2.107",
|
|
479
479
|
"@jskit-ai/resource-core": "0.1.229",
|
|
480
480
|
"json-rest-schema": "^1.0.20"
|
|
481
481
|
},
|
|
482
482
|
"peerDependencies": {
|
|
483
483
|
"@jskit-ai/http-runtime": "0.2.39",
|
|
484
|
-
"@jskit-ai/http-web": "0.2.
|
|
484
|
+
"@jskit-ai/http-web": "0.2.73",
|
|
485
485
|
"@jskit-ai/kernel": "0.2.38",
|
|
486
|
-
"@jskit-ai/realtime": "0.2.
|
|
487
|
-
"@jskit-ai/shell-web": "0.2.
|
|
486
|
+
"@jskit-ai/realtime": "0.2.67",
|
|
487
|
+
"@jskit-ai/shell-web": "0.2.64",
|
|
488
488
|
"@tanstack/vue-query": "^5.90.5",
|
|
489
489
|
"vue": "^3.5.13",
|
|
490
490
|
"vuetify": "^4.0.0",
|
|
@@ -495,7 +495,7 @@
|
|
|
495
495
|
},
|
|
496
496
|
{
|
|
497
497
|
"packageId": "@jskit-ai/assistant-voice",
|
|
498
|
-
"version": "0.2.
|
|
498
|
+
"version": "0.2.115",
|
|
499
499
|
"description": "Duplex voice conversations with application-owned targets and authorization, and the speech service engine with its client.",
|
|
500
500
|
"jskit": {
|
|
501
501
|
"kind": "runtime",
|
|
@@ -541,7 +541,7 @@
|
|
|
541
541
|
},
|
|
542
542
|
"packageJson": {
|
|
543
543
|
"dependencies": {
|
|
544
|
-
"@jskit-ai/assistant-core": "0.2.
|
|
544
|
+
"@jskit-ai/assistant-core": "0.2.107",
|
|
545
545
|
"ws": "^8.20.1"
|
|
546
546
|
},
|
|
547
547
|
"peerDependencies": {
|
|
@@ -553,7 +553,7 @@
|
|
|
553
553
|
},
|
|
554
554
|
{
|
|
555
555
|
"packageId": "@jskit-ai/assistant-voice-sherpa",
|
|
556
|
-
"version": "0.1.
|
|
556
|
+
"version": "0.1.162",
|
|
557
557
|
"description": "Optional native Sherpa speech engine and explicit model preparation for assistant voice.",
|
|
558
558
|
"jskit": {
|
|
559
559
|
"kind": "runtime",
|
|
@@ -591,7 +591,7 @@
|
|
|
591
591
|
},
|
|
592
592
|
"packageJson": {
|
|
593
593
|
"dependencies": {
|
|
594
|
-
"@jskit-ai/assistant-voice": "0.2.
|
|
594
|
+
"@jskit-ai/assistant-voice": "0.2.115",
|
|
595
595
|
"sherpa-onnx-node": "1.13.6"
|
|
596
596
|
}
|
|
597
597
|
}
|
|
@@ -888,7 +888,7 @@
|
|
|
888
888
|
},
|
|
889
889
|
{
|
|
890
890
|
"packageId": "@jskit-ai/auth-provider-oidc-core",
|
|
891
|
-
"version": "0.2.
|
|
891
|
+
"version": "0.2.82",
|
|
892
892
|
"description": "Sign in through any OpenID Connect issuer: self-registration or a static client, app-owned sessions, and back-channel logout.",
|
|
893
893
|
"jskit": {
|
|
894
894
|
"kind": "runtime",
|
|
@@ -1028,7 +1028,7 @@
|
|
|
1028
1028
|
},
|
|
1029
1029
|
{
|
|
1030
1030
|
"packageId": "@jskit-ai/auth-web",
|
|
1031
|
-
"version": "0.2.
|
|
1031
|
+
"version": "0.2.72",
|
|
1032
1032
|
"description": "Auth web module: Fastify auth routes plus web login/sign-out scaffolds.",
|
|
1033
1033
|
"jskit": {
|
|
1034
1034
|
"kind": "runtime",
|
|
@@ -1373,7 +1373,7 @@
|
|
|
1373
1373
|
"@jskit-ai/auth-core": "0.2.43",
|
|
1374
1374
|
"@jskit-ai/http-runtime": "0.2.39",
|
|
1375
1375
|
"@jskit-ai/kernel": "0.2.38",
|
|
1376
|
-
"@jskit-ai/shell-web": "0.2.
|
|
1376
|
+
"@jskit-ai/shell-web": "0.2.64",
|
|
1377
1377
|
"@tanstack/vue-query": "^5.90.5",
|
|
1378
1378
|
"pinia": "^4.0.3",
|
|
1379
1379
|
"vue": "^3.5.44",
|
|
@@ -1533,7 +1533,7 @@
|
|
|
1533
1533
|
},
|
|
1534
1534
|
{
|
|
1535
1535
|
"packageId": "@jskit-ai/console-core",
|
|
1536
|
-
"version": "0.2.
|
|
1536
|
+
"version": "0.2.77",
|
|
1537
1537
|
"description": "Console runtime: console settings schema, bootstrap flags, actions, and HTTP routes.",
|
|
1538
1538
|
"jskit": {
|
|
1539
1539
|
"kind": "runtime",
|
|
@@ -1617,7 +1617,7 @@
|
|
|
1617
1617
|
"packageJson": {
|
|
1618
1618
|
"dependencies": {
|
|
1619
1619
|
"@jskit-ai/resource-core": "0.1.229",
|
|
1620
|
-
"@jskit-ai/users-core": "0.2.
|
|
1620
|
+
"@jskit-ai/users-core": "0.2.77",
|
|
1621
1621
|
"json-rest-schema": "^1.0.20"
|
|
1622
1622
|
},
|
|
1623
1623
|
"peerDependencies": {
|
|
@@ -1631,7 +1631,7 @@
|
|
|
1631
1631
|
},
|
|
1632
1632
|
{
|
|
1633
1633
|
"packageId": "@jskit-ai/console-web",
|
|
1634
|
-
"version": "0.1.
|
|
1634
|
+
"version": "0.1.315",
|
|
1635
1635
|
"description": "Authenticated console surface scaffold and surface policy wiring.",
|
|
1636
1636
|
"jskit": {
|
|
1637
1637
|
"kind": "runtime",
|
|
@@ -1725,17 +1725,17 @@
|
|
|
1725
1725
|
},
|
|
1726
1726
|
"packageJson": {
|
|
1727
1727
|
"dependencies": {
|
|
1728
|
-
"@jskit-ai/console-core": "0.2.
|
|
1728
|
+
"@jskit-ai/console-core": "0.2.77"
|
|
1729
1729
|
},
|
|
1730
1730
|
"peerDependencies": {
|
|
1731
|
-
"@jskit-ai/auth-web": "0.2.
|
|
1732
|
-
"@jskit-ai/shell-web": "0.2.
|
|
1731
|
+
"@jskit-ai/auth-web": "0.2.72",
|
|
1732
|
+
"@jskit-ai/shell-web": "0.2.64"
|
|
1733
1733
|
}
|
|
1734
1734
|
}
|
|
1735
1735
|
},
|
|
1736
1736
|
{
|
|
1737
1737
|
"packageId": "@jskit-ai/crud-core",
|
|
1738
|
-
"version": "0.2.
|
|
1738
|
+
"version": "0.2.66",
|
|
1739
1739
|
"description": "Shared server-side CRUD service, repository, route, and query helpers.",
|
|
1740
1740
|
"jskit": {
|
|
1741
1741
|
"kind": "runtime",
|
|
@@ -2000,7 +2000,7 @@
|
|
|
2000
2000
|
},
|
|
2001
2001
|
{
|
|
2002
2002
|
"packageId": "@jskit-ai/http-web",
|
|
2003
|
-
"version": "0.2.
|
|
2003
|
+
"version": "0.2.73",
|
|
2004
2004
|
"description": "Neutral Vue request, command, resource, and CRUD UI runtime for JSKIT web applications.",
|
|
2005
2005
|
"jskit": {
|
|
2006
2006
|
"kind": "runtime",
|
|
@@ -2094,8 +2094,8 @@
|
|
|
2094
2094
|
"peerDependencies": {
|
|
2095
2095
|
"@jskit-ai/http-runtime": "0.2.39",
|
|
2096
2096
|
"@jskit-ai/kernel": "0.2.38",
|
|
2097
|
-
"@jskit-ai/realtime": "0.2.
|
|
2098
|
-
"@jskit-ai/shell-web": "0.2.
|
|
2097
|
+
"@jskit-ai/realtime": "0.2.67",
|
|
2098
|
+
"@jskit-ai/shell-web": "0.2.64",
|
|
2099
2099
|
"@tanstack/vue-query": "^5.90.5",
|
|
2100
2100
|
"vue": "^3.5.13",
|
|
2101
2101
|
"vue-router": "^5.0.4",
|
|
@@ -2134,7 +2134,7 @@
|
|
|
2134
2134
|
},
|
|
2135
2135
|
{
|
|
2136
2136
|
"packageId": "@jskit-ai/mobile-capacitor",
|
|
2137
|
-
"version": "0.2.
|
|
2137
|
+
"version": "0.2.64",
|
|
2138
2138
|
"description": "Thin Capacitor client integration for JSKIT mobile-shell launch routing and auth callback completion.",
|
|
2139
2139
|
"jskit": {
|
|
2140
2140
|
"kind": "runtime",
|
|
@@ -2186,7 +2186,7 @@
|
|
|
2186
2186
|
},
|
|
2187
2187
|
"peerDependencies": {
|
|
2188
2188
|
"@jskit-ai/kernel": "0.2.38",
|
|
2189
|
-
"@jskit-ai/shell-web": "0.2.
|
|
2189
|
+
"@jskit-ai/shell-web": "0.2.64"
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
2192
2192
|
},
|
|
@@ -2386,7 +2386,7 @@
|
|
|
2386
2386
|
},
|
|
2387
2387
|
{
|
|
2388
2388
|
"packageId": "@jskit-ai/realtime",
|
|
2389
|
-
"version": "0.2.
|
|
2389
|
+
"version": "0.2.67",
|
|
2390
2390
|
"description": "Thin, generic realtime runtime wrappers for socket.io server and client.",
|
|
2391
2391
|
"jskit": {
|
|
2392
2392
|
"kind": "runtime",
|
|
@@ -2645,7 +2645,7 @@
|
|
|
2645
2645
|
},
|
|
2646
2646
|
{
|
|
2647
2647
|
"packageId": "@jskit-ai/rewarded-core",
|
|
2648
|
-
"version": "0.2.
|
|
2648
|
+
"version": "0.2.77",
|
|
2649
2649
|
"description": "Rewarded workflow runtime plus internal CRUD providers for rules, provider configs, watch sessions, and unlock receipts.",
|
|
2650
2650
|
"jskit": {
|
|
2651
2651
|
"kind": "runtime",
|
|
@@ -2760,11 +2760,11 @@
|
|
|
2760
2760
|
},
|
|
2761
2761
|
"packageJson": {
|
|
2762
2762
|
"dependencies": {
|
|
2763
|
-
"@jskit-ai/crud-core": "0.2.
|
|
2763
|
+
"@jskit-ai/crud-core": "0.2.66",
|
|
2764
2764
|
"@jskit-ai/resource-core": "0.1.229",
|
|
2765
2765
|
"@jskit-ai/resource-crud-core": "0.1.231",
|
|
2766
|
-
"@jskit-ai/users-core": "0.2.
|
|
2767
|
-
"@jskit-ai/workspaces-core": "0.2.
|
|
2766
|
+
"@jskit-ai/users-core": "0.2.77",
|
|
2767
|
+
"@jskit-ai/workspaces-core": "0.2.77",
|
|
2768
2768
|
"json-rest-schema": "^1.0.20"
|
|
2769
2769
|
},
|
|
2770
2770
|
"peerDependencies": {
|
|
@@ -2778,7 +2778,7 @@
|
|
|
2778
2778
|
},
|
|
2779
2779
|
{
|
|
2780
2780
|
"packageId": "@jskit-ai/rewarded-web",
|
|
2781
|
-
"version": "0.2.
|
|
2781
|
+
"version": "0.2.91",
|
|
2782
2782
|
"description": "Rewarded gate client workflow with explicitly composed application delivery.",
|
|
2783
2783
|
"jskit": {
|
|
2784
2784
|
"kind": "runtime",
|
|
@@ -2827,19 +2827,19 @@
|
|
|
2827
2827
|
},
|
|
2828
2828
|
"packageJson": {
|
|
2829
2829
|
"dependencies": {
|
|
2830
|
-
"@jskit-ai/rewarded-core": "0.2.
|
|
2830
|
+
"@jskit-ai/rewarded-core": "0.2.77"
|
|
2831
2831
|
},
|
|
2832
2832
|
"peerDependencies": {
|
|
2833
2833
|
"@jskit-ai/http-runtime": "0.2.39",
|
|
2834
2834
|
"@jskit-ai/kernel": "0.2.38",
|
|
2835
|
-
"@jskit-ai/shell-web": "0.2.
|
|
2835
|
+
"@jskit-ai/shell-web": "0.2.64",
|
|
2836
2836
|
"vue": "^3.5.13"
|
|
2837
2837
|
}
|
|
2838
2838
|
}
|
|
2839
2839
|
},
|
|
2840
2840
|
{
|
|
2841
2841
|
"packageId": "@jskit-ai/shell-web",
|
|
2842
|
-
"version": "0.2.
|
|
2842
|
+
"version": "0.2.64",
|
|
2843
2843
|
"description": "Web shell layout runtime with outlet-based placement contributions.",
|
|
2844
2844
|
"jskit": {
|
|
2845
2845
|
"kind": "runtime",
|
|
@@ -3420,7 +3420,7 @@
|
|
|
3420
3420
|
},
|
|
3421
3421
|
{
|
|
3422
3422
|
"packageId": "@jskit-ai/users-core",
|
|
3423
|
-
"version": "0.2.
|
|
3423
|
+
"version": "0.2.77",
|
|
3424
3424
|
"description": "Users/account runtime plus HTTP routes for account features.",
|
|
3425
3425
|
"jskit": {
|
|
3426
3426
|
"kind": "runtime",
|
|
@@ -3618,7 +3618,7 @@
|
|
|
3618
3618
|
},
|
|
3619
3619
|
{
|
|
3620
3620
|
"packageId": "@jskit-ai/users-web",
|
|
3621
|
-
"version": "0.2.
|
|
3621
|
+
"version": "0.2.99",
|
|
3622
3622
|
"description": "Users web module with account, profile, and user-specific shell UI.",
|
|
3623
3623
|
"jskit": {
|
|
3624
3624
|
"kind": "runtime",
|
|
@@ -3824,14 +3824,14 @@
|
|
|
3824
3824
|
"packageJson": {
|
|
3825
3825
|
"dependencies": {
|
|
3826
3826
|
"@jskit-ai/uploads-image-web": "0.2.38",
|
|
3827
|
-
"@jskit-ai/users-core": "0.2.
|
|
3827
|
+
"@jskit-ai/users-core": "0.2.77"
|
|
3828
3828
|
},
|
|
3829
3829
|
"peerDependencies": {
|
|
3830
|
-
"@jskit-ai/auth-web": "0.2.
|
|
3830
|
+
"@jskit-ai/auth-web": "0.2.72",
|
|
3831
3831
|
"@jskit-ai/http-runtime": "0.2.39",
|
|
3832
|
-
"@jskit-ai/http-web": "0.2.
|
|
3832
|
+
"@jskit-ai/http-web": "0.2.73",
|
|
3833
3833
|
"@jskit-ai/kernel": "0.2.38",
|
|
3834
|
-
"@jskit-ai/shell-web": "0.2.
|
|
3834
|
+
"@jskit-ai/shell-web": "0.2.64",
|
|
3835
3835
|
"@tanstack/vue-query": "^5.90.5",
|
|
3836
3836
|
"vue": "^3.5.13",
|
|
3837
3837
|
"vue-router": "^5.0.4",
|
|
@@ -3841,7 +3841,7 @@
|
|
|
3841
3841
|
},
|
|
3842
3842
|
{
|
|
3843
3843
|
"packageId": "@jskit-ai/workspaces-core",
|
|
3844
|
-
"version": "0.2.
|
|
3844
|
+
"version": "0.2.77",
|
|
3845
3845
|
"description": "Workspace tenancy runtime plus HTTP routes, role catalog, and workspace config scaffolding.",
|
|
3846
3846
|
"jskit": {
|
|
3847
3847
|
"kind": "runtime",
|
|
@@ -4035,7 +4035,7 @@
|
|
|
4035
4035
|
"dependencies": {
|
|
4036
4036
|
"@jskit-ai/resource-core": "0.1.229",
|
|
4037
4037
|
"@jskit-ai/resource-crud-core": "0.1.231",
|
|
4038
|
-
"@jskit-ai/users-core": "0.2.
|
|
4038
|
+
"@jskit-ai/users-core": "0.2.77",
|
|
4039
4039
|
"json-rest-schema": "^1.0.20"
|
|
4040
4040
|
},
|
|
4041
4041
|
"peerDependencies": {
|
|
@@ -4049,7 +4049,7 @@
|
|
|
4049
4049
|
},
|
|
4050
4050
|
{
|
|
4051
4051
|
"packageId": "@jskit-ai/workspaces-web",
|
|
4052
|
-
"version": "0.2.
|
|
4052
|
+
"version": "0.2.99",
|
|
4053
4053
|
"description": "Workspace web module: workspace selector, tools widget, workspace surfaces, members UI, and settings hosts.",
|
|
4054
4054
|
"jskit": {
|
|
4055
4055
|
"kind": "runtime",
|
|
@@ -4297,15 +4297,15 @@
|
|
|
4297
4297
|
},
|
|
4298
4298
|
"packageJson": {
|
|
4299
4299
|
"dependencies": {
|
|
4300
|
-
"@jskit-ai/users-core": "0.2.
|
|
4301
|
-
"@jskit-ai/workspaces-core": "0.2.
|
|
4300
|
+
"@jskit-ai/users-core": "0.2.77",
|
|
4301
|
+
"@jskit-ai/workspaces-core": "0.2.77"
|
|
4302
4302
|
},
|
|
4303
4303
|
"peerDependencies": {
|
|
4304
|
-
"@jskit-ai/auth-web": "0.2.
|
|
4305
|
-
"@jskit-ai/http-web": "0.2.
|
|
4304
|
+
"@jskit-ai/auth-web": "0.2.72",
|
|
4305
|
+
"@jskit-ai/http-web": "0.2.73",
|
|
4306
4306
|
"@jskit-ai/kernel": "0.2.38",
|
|
4307
|
-
"@jskit-ai/shell-web": "0.2.
|
|
4308
|
-
"@jskit-ai/users-web": "0.2.
|
|
4307
|
+
"@jskit-ai/shell-web": "0.2.64",
|
|
4308
|
+
"@jskit-ai/users-web": "0.2.99",
|
|
4309
4309
|
"@tanstack/vue-query": "^5.90.5",
|
|
4310
4310
|
"vue": "^3.5.13",
|
|
4311
4311
|
"vue-router": "^5.0.4",
|
|
@@ -4337,7 +4337,7 @@
|
|
|
4337
4337
|
"@jskit-ai/shell-web"
|
|
4338
4338
|
],
|
|
4339
4339
|
"packageId": "@jskit-ai/assistant-runtime",
|
|
4340
|
-
"packageVersion": "0.2.
|
|
4340
|
+
"packageVersion": "0.2.115",
|
|
4341
4341
|
"documentPath": "patterns/assistant-surface/PATTERN.md",
|
|
4342
4342
|
"examplePath": "patterns/assistant-surface/example",
|
|
4343
4343
|
"files": [
|
|
@@ -4350,6 +4350,37 @@
|
|
|
4350
4350
|
"src/placement.js"
|
|
4351
4351
|
]
|
|
4352
4352
|
},
|
|
4353
|
+
{
|
|
4354
|
+
"id": "assistant/model-sized-results",
|
|
4355
|
+
"title": "Model-sized tool results",
|
|
4356
|
+
"summary": "Keep what an action gives the assistant within its result limit with text over markup, the first part of long text and the action that reads the rest, and paged lists, so the catalogue's own cut stays the last resort.",
|
|
4357
|
+
"keywords": [
|
|
4358
|
+
"ai",
|
|
4359
|
+
"assistant",
|
|
4360
|
+
"document",
|
|
4361
|
+
"email",
|
|
4362
|
+
"limit",
|
|
4363
|
+
"long text",
|
|
4364
|
+
"maxToolResultBytes",
|
|
4365
|
+
"paging",
|
|
4366
|
+
"read on",
|
|
4367
|
+
"result",
|
|
4368
|
+
"size",
|
|
4369
|
+
"tool"
|
|
4370
|
+
],
|
|
4371
|
+
"requires": [
|
|
4372
|
+
"@jskit-ai/assistant-core"
|
|
4373
|
+
],
|
|
4374
|
+
"packageId": "@jskit-ai/assistant-core",
|
|
4375
|
+
"packageVersion": "0.2.107",
|
|
4376
|
+
"documentPath": "patterns/model-sized-results/PATTERN.md",
|
|
4377
|
+
"examplePath": "patterns/model-sized-results/example",
|
|
4378
|
+
"files": [
|
|
4379
|
+
"packages/inbox/src/server/inbox.js",
|
|
4380
|
+
"packages/inbox/src/server/inboxActions.js",
|
|
4381
|
+
"packages/inbox/src/server/types.js"
|
|
4382
|
+
]
|
|
4383
|
+
},
|
|
4353
4384
|
{
|
|
4354
4385
|
"id": "auth/accounts-hub",
|
|
4355
4386
|
"title": "Accounts hub",
|
|
@@ -4399,7 +4430,7 @@
|
|
|
4399
4430
|
"@jskit-ai/shell-web"
|
|
4400
4431
|
],
|
|
4401
4432
|
"packageId": "@jskit-ai/auth-web",
|
|
4402
|
-
"packageVersion": "0.2.
|
|
4433
|
+
"packageVersion": "0.2.72",
|
|
4403
4434
|
"documentPath": "patterns/auth-surface/PATTERN.md",
|
|
4404
4435
|
"examplePath": "patterns/auth-surface/example",
|
|
4405
4436
|
"files": [
|
|
@@ -4440,7 +4471,7 @@
|
|
|
4440
4471
|
"@jskit-ai/auth-web"
|
|
4441
4472
|
],
|
|
4442
4473
|
"packageId": "@jskit-ai/auth-provider-oidc-core",
|
|
4443
|
-
"packageVersion": "0.2.
|
|
4474
|
+
"packageVersion": "0.2.82",
|
|
4444
4475
|
"documentPath": "patterns/oidc-sign-in/PATTERN.md",
|
|
4445
4476
|
"examplePath": "patterns/oidc-sign-in/example",
|
|
4446
4477
|
"files": [
|
|
@@ -4469,7 +4500,7 @@
|
|
|
4469
4500
|
"@jskit-ai/kernel"
|
|
4470
4501
|
],
|
|
4471
4502
|
"packageId": "@jskit-ai/auth-web",
|
|
4472
|
-
"packageVersion": "0.2.
|
|
4503
|
+
"packageVersion": "0.2.72",
|
|
4473
4504
|
"documentPath": "patterns/own-design-sign-in/PATTERN.md",
|
|
4474
4505
|
"examplePath": "patterns/own-design-sign-in/example",
|
|
4475
4506
|
"files": [
|
|
@@ -4941,7 +4972,7 @@
|
|
|
4941
4972
|
"@jskit-ai/shell-web"
|
|
4942
4973
|
],
|
|
4943
4974
|
"packageId": "@jskit-ai/console-web",
|
|
4944
|
-
"packageVersion": "0.1.
|
|
4975
|
+
"packageVersion": "0.1.315",
|
|
4945
4976
|
"documentPath": "patterns/console-surface/PATTERN.md",
|
|
4946
4977
|
"examplePath": "patterns/console-surface/example",
|
|
4947
4978
|
"files": [
|
|
@@ -5001,7 +5032,7 @@
|
|
|
5001
5032
|
"@jskit-ai/resource-crud-core"
|
|
5002
5033
|
],
|
|
5003
5034
|
"packageId": "@jskit-ai/crud-core",
|
|
5004
|
-
"packageVersion": "0.2.
|
|
5035
|
+
"packageVersion": "0.2.66",
|
|
5005
5036
|
"documentPath": "patterns/crud-feature-package/PATTERN.md",
|
|
5006
5037
|
"examplePath": "patterns/crud-feature-package/example",
|
|
5007
5038
|
"files": [
|
|
@@ -5036,7 +5067,7 @@
|
|
|
5036
5067
|
"@jskit-ai/resource-crud-core"
|
|
5037
5068
|
],
|
|
5038
5069
|
"packageId": "@jskit-ai/http-web",
|
|
5039
|
-
"packageVersion": "0.2.
|
|
5070
|
+
"packageVersion": "0.2.73",
|
|
5040
5071
|
"documentPath": "patterns/crud-screen-set/PATTERN.md",
|
|
5041
5072
|
"examplePath": "patterns/crud-screen-set/example",
|
|
5042
5073
|
"files": [
|
|
@@ -5153,7 +5184,7 @@
|
|
|
5153
5184
|
"@jskit-ai/mobile-capacitor"
|
|
5154
5185
|
],
|
|
5155
5186
|
"packageId": "@jskit-ai/mobile-capacitor",
|
|
5156
|
-
"packageVersion": "0.2.
|
|
5187
|
+
"packageVersion": "0.2.64",
|
|
5157
5188
|
"documentPath": "patterns/android-application/PATTERN.md",
|
|
5158
5189
|
"examplePath": "patterns/android-application/example",
|
|
5159
5190
|
"files": [
|
|
@@ -5177,7 +5208,7 @@
|
|
|
5177
5208
|
"@jskit-ai/shell-web"
|
|
5178
5209
|
],
|
|
5179
5210
|
"packageId": "@jskit-ai/realtime",
|
|
5180
|
-
"packageVersion": "0.2.
|
|
5211
|
+
"packageVersion": "0.2.67",
|
|
5181
5212
|
"documentPath": "patterns/realtime-application/PATTERN.md",
|
|
5182
5213
|
"examplePath": "patterns/realtime-application/example",
|
|
5183
5214
|
"files": [
|
|
@@ -5201,7 +5232,7 @@
|
|
|
5201
5232
|
"@jskit-ai/rewarded-web"
|
|
5202
5233
|
],
|
|
5203
5234
|
"packageId": "@jskit-ai/rewarded-web",
|
|
5204
|
-
"packageVersion": "0.2.
|
|
5235
|
+
"packageVersion": "0.2.91",
|
|
5205
5236
|
"documentPath": "patterns/google-rewarded/PATTERN.md",
|
|
5206
5237
|
"examplePath": "patterns/google-rewarded/example",
|
|
5207
5238
|
"files": [
|
|
@@ -5228,7 +5259,7 @@
|
|
|
5228
5259
|
"@jskit-ai/shell-web"
|
|
5229
5260
|
],
|
|
5230
5261
|
"packageId": "@jskit-ai/shell-web",
|
|
5231
|
-
"packageVersion": "0.2.
|
|
5262
|
+
"packageVersion": "0.2.64",
|
|
5232
5263
|
"documentPath": "patterns/application-shell/PATTERN.md",
|
|
5233
5264
|
"examplePath": "patterns/application-shell/example",
|
|
5234
5265
|
"files": [
|
|
@@ -5274,7 +5305,7 @@
|
|
|
5274
5305
|
"@jskit-ai/shell-web"
|
|
5275
5306
|
],
|
|
5276
5307
|
"packageId": "@jskit-ai/shell-web",
|
|
5277
|
-
"packageVersion": "0.2.
|
|
5308
|
+
"packageVersion": "0.2.64",
|
|
5278
5309
|
"documentPath": "patterns/page-and-placement/PATTERN.md",
|
|
5279
5310
|
"examplePath": "patterns/page-and-placement/example",
|
|
5280
5311
|
"files": [
|
|
@@ -5311,7 +5342,7 @@
|
|
|
5311
5342
|
"@jskit-ai/users-web"
|
|
5312
5343
|
],
|
|
5313
5344
|
"packageId": "@jskit-ai/users-web",
|
|
5314
|
-
"packageVersion": "0.2.
|
|
5345
|
+
"packageVersion": "0.2.99",
|
|
5315
5346
|
"documentPath": "patterns/account-settings/PATTERN.md",
|
|
5316
5347
|
"examplePath": "patterns/account-settings/example",
|
|
5317
5348
|
"files": [
|
|
@@ -5344,7 +5375,7 @@
|
|
|
5344
5375
|
"@jskit-ai/users-core"
|
|
5345
5376
|
],
|
|
5346
5377
|
"packageId": "@jskit-ai/users-core",
|
|
5347
|
-
"packageVersion": "0.2.
|
|
5378
|
+
"packageVersion": "0.2.77",
|
|
5348
5379
|
"documentPath": "patterns/user-administration-server/PATTERN.md",
|
|
5349
5380
|
"examplePath": "patterns/user-administration-server/example",
|
|
5350
5381
|
"files": [
|
|
@@ -5380,7 +5411,7 @@
|
|
|
5380
5411
|
"@jskit-ai/workspaces-core"
|
|
5381
5412
|
],
|
|
5382
5413
|
"packageId": "@jskit-ai/workspaces-core",
|
|
5383
|
-
"packageVersion": "0.2.
|
|
5414
|
+
"packageVersion": "0.2.77",
|
|
5384
5415
|
"documentPath": "patterns/workspace-server/PATTERN.md",
|
|
5385
5416
|
"examplePath": "patterns/workspace-server/example",
|
|
5386
5417
|
"files": [
|
|
@@ -5410,7 +5441,7 @@
|
|
|
5410
5441
|
"@jskit-ai/workspaces-web"
|
|
5411
5442
|
],
|
|
5412
5443
|
"packageId": "@jskit-ai/workspaces-web",
|
|
5413
|
-
"packageVersion": "0.2.
|
|
5444
|
+
"packageVersion": "0.2.99",
|
|
5414
5445
|
"documentPath": "patterns/workspace-surfaces/PATTERN.md",
|
|
5415
5446
|
"examplePath": "patterns/workspace-surfaces/example",
|
|
5416
5447
|
"files": [
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import os from "node:os";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { Readable } from "node:stream";
|
|
7
|
-
import { pathToFileURL } from "node:url";
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
8
|
import { toPosixPath } from "../files.mjs";
|
|
9
9
|
import { BUDGET_VARIABLE, testConcurrency } from "./budget.mjs";
|
|
10
10
|
import { DATABASES_OPTION, testDatabaseRunFor } from "./databases.mjs";
|
|
@@ -22,17 +22,21 @@ import {
|
|
|
22
22
|
} from "./time-report.mjs";
|
|
23
23
|
|
|
24
24
|
// `jskit test [node options] [files or globs]`: node --test, running test files in parallel within the machine's test
|
|
25
|
-
// budget (budget.mjs)
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
25
|
+
// budget (budget.mjs), the files whose last run took longest first and a file with no recorded time before them all, so
|
|
26
|
+
// a long file never starts last and runs on alone. Each run's process is run-files.mjs, node:test's run() of the files
|
|
27
|
+
// in that order, since node --test sorts the files it is given by name; it takes node --test's options as node --test
|
|
28
|
+
// does, and its other node options reach every test file's process as from node --test. A file that truly must run
|
|
29
|
+
// alone says why on its first line, `// jskit-test: alone - <reason>`, and runs after the others, one such file at a
|
|
30
|
+
// time. That second run writes a reporter's file destination beside the first run's (`<name>.alone<ext>`) instead of
|
|
31
|
+
// over it. With --test-shard=<index>/<total> each run takes only its shard's files, picked by name as node --test picks
|
|
32
|
+
// a shard's files, so a shard is the same files on every machine, whatever times each recorded.
|
|
29
33
|
// Given no files, it takes node's default files less the helpers and fixtures under a support/ or fixtures/ folder or
|
|
30
34
|
// src/test/, names them to node --test, and fails instead of leaving out a file under tests/ named as a test that
|
|
31
35
|
// node's default misses, or when it finds no test file at all, before preparing any test database; the run's report
|
|
32
36
|
// fails a file it takes that declares no tests.
|
|
33
37
|
// Every run also reports to time-report.mjs, which times the command's files against coarse bounds, and preloads
|
|
34
38
|
// file-stop.mjs, which stops a file still running at a generous multiple of its time, or at the linger bound
|
|
35
|
-
// after its last test, naming what its process still has open. Marked files get the same. With --databases, a run whose
|
|
39
|
+
// after its last test and after hooks, naming what its process still has open. Marked files get the same. With --databases, a run whose
|
|
36
40
|
// test databases let fewer files run at once than the budget asked for (no usable TEST_DB_NAME, or copies the database
|
|
37
41
|
// user may not create) says so, and why, at its start and its end, and fails once its tests have run: a machine that
|
|
38
42
|
// should run files in parallel never silently runs them one at a time. A budget set to what the databases allow
|
|
@@ -73,6 +77,51 @@ const REPORTER = "--test-reporter";
|
|
|
73
77
|
const DESTINATION = "--test-reporter-destination";
|
|
74
78
|
const TIME_REPORTER = new URL("./time-report.mjs", import.meta.url).href;
|
|
75
79
|
const FILE_STOP = new URL("./file-stop.mjs", import.meta.url).href;
|
|
80
|
+
const RUN_FILES = fileURLToPath(new URL("./run-files.mjs", import.meta.url));
|
|
81
|
+
// node's own options, node --test's and the others a test command passes, that take a value, which may follow as the
|
|
82
|
+
// next argument (`--test-reporter spec`): that argument is the value, never a file.
|
|
83
|
+
const VALUE_OPTIONS = new Set([
|
|
84
|
+
"--test-concurrency", "--test-coverage-branches", "--test-coverage-exclude", "--test-coverage-functions",
|
|
85
|
+
"--test-coverage-include", "--test-coverage-lines", "--test-global-setup", "--test-isolation", "--experimental-test-isolation",
|
|
86
|
+
"--test-name-pattern", "--test-random-seed", "--test-reporter", "--test-reporter-destination", "--test-rerun-failures",
|
|
87
|
+
SHARD, "--test-skip-pattern", "--test-timeout", "--experimental-test-tag-filter", "--conditions", "-C",
|
|
88
|
+
"--disable-warning", "--env-file", "--env-file-if-exists", "--experimental-loader", "--import", "--input-type", "--loader",
|
|
89
|
+
"--require", "-r"
|
|
90
|
+
]);
|
|
91
|
+
// node's test runner options (Node 22 to 26), and --watch, which runs it in watch mode.
|
|
92
|
+
const TEST_OPTION = /^--(?:experimental-test|test|watch)(?:-|$)/u;
|
|
93
|
+
// What node --test's own process reads of them (parseCommandLine() in node's internal/test_runner/utils.js), as the
|
|
94
|
+
// run() option each is. They go to run() alone, never among the runner's own node options: run() gives each file's
|
|
95
|
+
// process those it reads (the name, skip and tag patterns, only, timeout, force exit, rerun failures, randomize and
|
|
96
|
+
// seed), as node --test does, and node:test in the runner would apply a name pattern or `only` to its own entry for each
|
|
97
|
+
// file, named as the file, and leave every file out; --watch would watch the runner itself.
|
|
98
|
+
const RUN_OPTIONS = Object.freeze({
|
|
99
|
+
"--test": { flag: true },
|
|
100
|
+
"--test-concurrency": { key: "concurrency", number: true },
|
|
101
|
+
"--test-timeout": { key: "timeout", number: true },
|
|
102
|
+
"--test-name-pattern": { key: "testNamePatterns", list: true },
|
|
103
|
+
"--test-skip-pattern": { key: "testSkipPatterns", list: true },
|
|
104
|
+
"--test-only": { key: "only", flag: true },
|
|
105
|
+
"--test-force-exit": { key: "forceExit", flag: true },
|
|
106
|
+
"--test-global-setup": { key: "globalSetupPath" },
|
|
107
|
+
"--test-isolation": { key: "isolation" },
|
|
108
|
+
"--experimental-test-isolation": { key: "isolation" },
|
|
109
|
+
"--test-coverage-include": { key: "coverageIncludeGlobs", list: true },
|
|
110
|
+
"--test-coverage-exclude": { key: "coverageExcludeGlobs", list: true },
|
|
111
|
+
"--test-coverage-branches": { key: "branchCoverage", number: true },
|
|
112
|
+
"--test-coverage-functions": { key: "functionCoverage", number: true },
|
|
113
|
+
"--test-coverage-lines": { key: "lineCoverage", number: true },
|
|
114
|
+
"--test-rerun-failures": { key: "rerunFailuresFilePath" },
|
|
115
|
+
[REPORTER]: { key: "reporters", list: true },
|
|
116
|
+
[DESTINATION]: { key: "destinations", list: true },
|
|
117
|
+
"--experimental-test-coverage": { key: "coverage", flag: true },
|
|
118
|
+
"--test-randomize": { key: "randomize", flag: true },
|
|
119
|
+
"--test-random-seed": { key: "randomSeed", number: true },
|
|
120
|
+
"--experimental-test-tag-filter": { key: "testTagFilters", list: true },
|
|
121
|
+
"--watch": { key: "watch", flag: true }
|
|
122
|
+
});
|
|
123
|
+
// The test options each file's process reads itself, which reach it from the runner's own options.
|
|
124
|
+
const FILE_OPTIONS = new Set(["--test-update-snapshots", "--experimental-test-module-mocks", "--experimental-test-snapshots"]);
|
|
76
125
|
// Every test file's process compiles the same modules; Node's compile cache keeps them for the next process and run.
|
|
77
126
|
// A cache the environment names, or NODE_DISABLE_COMPILE_CACHE=1, wins.
|
|
78
127
|
const COMPILE_CACHE = path.join("node_modules", ".cache", "jskit-node-compile-cache");
|
|
@@ -131,19 +180,12 @@ function markedDestination(destination, kind) {
|
|
|
131
180
|
return path.join(dir, `${name}.${kind}${ext}`);
|
|
132
181
|
}
|
|
133
182
|
|
|
134
|
-
/**
|
|
135
|
-
* A run of marked files' options: the parallel run's, with each file destination moved beside it and without the
|
|
136
|
-
* shard, which `markedShard` has already applied to those files.
|
|
137
|
-
* @param {string[]} options
|
|
138
|
-
* @param {"alone" | "network"} kind
|
|
139
|
-
*/
|
|
183
|
+
/** A run of marked files' options: the parallel run's, with each file destination moved beside it. */
|
|
140
184
|
function markedRunOptions(options, kind) {
|
|
141
185
|
const result = [];
|
|
142
186
|
for (let index = 0; index < options.length; index += 1) {
|
|
143
187
|
const option = options[index];
|
|
144
|
-
if (option ===
|
|
145
|
-
else if (option.startsWith(`${SHARD}=`)) continue;
|
|
146
|
-
else if (option === DESTINATION && index + 1 < options.length) {
|
|
188
|
+
if (option === DESTINATION && index + 1 < options.length) {
|
|
147
189
|
result.push(option, markedDestination(options[index + 1], kind));
|
|
148
190
|
index += 1;
|
|
149
191
|
} else if (option.startsWith(`${DESTINATION}=`)) result.push(`${DESTINATION}=${markedDestination(option.slice(DESTINATION.length + 1), kind)}`);
|
|
@@ -153,20 +195,68 @@ function markedRunOptions(options, kind) {
|
|
|
153
195
|
}
|
|
154
196
|
|
|
155
197
|
/**
|
|
156
|
-
* The
|
|
157
|
-
*
|
|
198
|
+
* The arguments after `jskit test` as node's options, each with its value, and the files and globs. An option takes the
|
|
199
|
+
* next argument as its value when it is one of VALUE_OPTIONS, or an option jskit does not know and that argument
|
|
200
|
+
* matches no file; any other argument names files.
|
|
201
|
+
*/
|
|
202
|
+
function splitArguments(args, cwd) {
|
|
203
|
+
const options = [];
|
|
204
|
+
const candidates = [];
|
|
205
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
206
|
+
const argument = args[index];
|
|
207
|
+
if (!argument.startsWith("-")) {
|
|
208
|
+
candidates.push(argument);
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
options.push(argument);
|
|
212
|
+
const next = args[index + 1];
|
|
213
|
+
if (argument.includes("=") || next === undefined || next.startsWith("-")) continue;
|
|
214
|
+
if (VALUE_OPTIONS.has(argument) || (!TEST_OPTION.test(argument) && findTestFiles([next], cwd).length < 1)) {
|
|
215
|
+
options.push(next);
|
|
216
|
+
index += 1;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return { options, candidates };
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* The shard `--test-shard=<index>/<total>` names, or null, and the options without it: jskit test picks a shard's files
|
|
224
|
+
* itself, by name as node --test picks them, so a shard takes the same files on every machine, whatever times each one
|
|
225
|
+
* recorded.
|
|
158
226
|
*/
|
|
159
|
-
function
|
|
227
|
+
function takeShard(options) {
|
|
160
228
|
const at = options.findIndex((option) => option === SHARD || option.startsWith(`${SHARD}=`));
|
|
161
|
-
if (at < 0) return
|
|
162
|
-
const
|
|
163
|
-
|
|
229
|
+
if (at < 0) return { shard: null, options };
|
|
230
|
+
const spaced = options[at] === SHARD;
|
|
231
|
+
const value = spaced ? options[at + 1] : options[at].slice(SHARD.length + 1);
|
|
232
|
+
const [index, total] = String(value).split("/").map(Number);
|
|
233
|
+
if (!(Number.isInteger(total) && total >= 1 && Number.isInteger(index) && index >= 1 && index <= total)) {
|
|
234
|
+
throw new Error(`jskit test: ${SHARD} is <index>/<total>, whole numbers with the index from 1 to the total, not ${value}.`);
|
|
235
|
+
}
|
|
236
|
+
return { shard: { index, total }, options: options.filter((_, position) => position !== at && !(spaced && position === at + 1)) };
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// The longest recorded time first, a file with none (Infinity) before them all; equal times keep their order.
|
|
240
|
+
const longestFirst = (first, second) => (first.ms === second.ms ? 0 : first.ms < second.ms ? 1 : -1);
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* A run's files of its shard, picked by name as node --test picks them, in the order the run starts them: the longest
|
|
244
|
+
* time recorded in the last run first (file-times.json, recordTestTimes()), a file with none before them all, as it may
|
|
245
|
+
* be the longest; equal times by name.
|
|
246
|
+
* @param {string[]} files by name
|
|
247
|
+
* @param {Record<string, number>} recorded
|
|
248
|
+
* @param {{ index: number, total: number } | null} shard
|
|
249
|
+
*/
|
|
250
|
+
function startOrder(files, recorded, shard) {
|
|
251
|
+
return files.filter((_, position) => !shard || position % shard.total === shard.index - 1)
|
|
252
|
+
.map((file) => ({ file, ms: recorded[file] ?? Infinity })).sort(longestFirst).map(({ file }) => file);
|
|
164
253
|
}
|
|
165
254
|
|
|
166
255
|
/**
|
|
167
256
|
* The node --test runs for these arguments: one in parallel within the budget, then the files that must reach an
|
|
168
|
-
* outside service, in parallel too, then the files that must run alone
|
|
169
|
-
* processes get the network guard: all but
|
|
257
|
+
* outside service, in parallel too, then the files that must run alone, each run's files last, in the order it starts
|
|
258
|
+
* them (`runFiles`, startOrder()). `guarded` says, for each run, whether its processes get the network guard: all but
|
|
259
|
+
* the run of network files.
|
|
170
260
|
* @param {string[]} args the arguments after `jskit test`
|
|
171
261
|
* @param {{ cwd?: string, concurrency?: number }} [options]
|
|
172
262
|
*/
|
|
@@ -174,11 +264,10 @@ function planTestRuns(args, { cwd = process.cwd(), concurrency = testConcurrency
|
|
|
174
264
|
if (args.some((argument) => /^--test-concurrency(?:=|$)/u.test(argument))) {
|
|
175
265
|
throw new Error("jskit test takes the test concurrency from the machine's budget; remove --test-concurrency.");
|
|
176
266
|
}
|
|
177
|
-
const
|
|
178
|
-
// An argument that matches no file is
|
|
179
|
-
//
|
|
180
|
-
const
|
|
181
|
-
const named = [...new Set([...matched.values()].flat())].sort();
|
|
267
|
+
const split = splitArguments(args, cwd);
|
|
268
|
+
// An argument that matches no file is a typo, which the run leaves out, as node --test does; with none that matches,
|
|
269
|
+
// the run is the default files (defaultTestFiles).
|
|
270
|
+
const named = [...new Set(split.candidates.flatMap((candidate) => findTestFiles([candidate], cwd)))].sort();
|
|
182
271
|
const files = named.length > 0 ? named : defaultTestFiles(cwd);
|
|
183
272
|
const missed = named.length > 0 ? [] : missedTestFiles(files, cwd);
|
|
184
273
|
if (missed.length > 0) {
|
|
@@ -188,25 +277,16 @@ function planTestRuns(args, { cwd = process.cwd(), concurrency = testConcurrency
|
|
|
188
277
|
}
|
|
189
278
|
const { alone, network, problems } = readMarkedFiles(files, cwd);
|
|
190
279
|
if (problems.length > 0) throw new Error(`jskit test:\n- ${problems.join("\n- ")}`);
|
|
280
|
+
const { shard, options } = takeShard(split.options);
|
|
281
|
+
const recorded = readRecordedTimes(cwd);
|
|
191
282
|
const parallel = ["--test", `--test-concurrency=${concurrency}`];
|
|
192
|
-
if (alone.length < 1 && network.length < 1) {
|
|
193
|
-
// Given no files, node --test is given this run's, since its own default takes the helpers this one leaves out.
|
|
194
|
-
const runs = named.length > 0 ? [[...parallel, ...args]] : files.length > 0 ? [[...parallel, ...args, ...files]] : [];
|
|
195
|
-
return { concurrency, files: files.length, paths: files, alone, network, runs, guarded: runs.map(() => true) };
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const options = args.filter((argument) => !(matched.get(argument)?.length > 0));
|
|
199
283
|
const marked = new Set([...alone, ...network].map((entry) => entry.file));
|
|
200
284
|
const others = files.filter((file) => !marked.has(file));
|
|
201
|
-
const shardNetwork = markedShard(network.map((entry) => entry.file), options);
|
|
202
|
-
const shardAlone = markedShard(alone.map((entry) => entry.file), options);
|
|
203
285
|
const runs = [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
: [])
|
|
209
|
-
];
|
|
286
|
+
{ prefix: parallel, options, files: startOrder(others, recorded, shard), guarded: true },
|
|
287
|
+
{ prefix: parallel, options: markedRunOptions(options, "network"), files: startOrder(network.map(({ file }) => file), recorded, shard), guarded: false },
|
|
288
|
+
{ prefix: ["--test", "--test-concurrency=1"], options: markedRunOptions(options, "alone"), files: startOrder(alone.map(({ file }) => file), recorded, shard), guarded: true }
|
|
289
|
+
].filter((run) => run.files.length > 0);
|
|
210
290
|
return {
|
|
211
291
|
concurrency,
|
|
212
292
|
// The most files running at once: the guarded ones, then the network ones, each run in parallel.
|
|
@@ -214,11 +294,58 @@ function planTestRuns(args, { cwd = process.cwd(), concurrency = testConcurrency
|
|
|
214
294
|
paths: files,
|
|
215
295
|
alone,
|
|
216
296
|
network,
|
|
217
|
-
runs: runs.map((
|
|
218
|
-
|
|
297
|
+
runs: runs.map((run) => [...run.prefix, ...run.options, ...run.files]),
|
|
298
|
+
runFiles: runs.map((run) => run.files),
|
|
299
|
+
guarded: runs.map((run) => run.guarded)
|
|
219
300
|
};
|
|
220
301
|
}
|
|
221
302
|
|
|
303
|
+
/**
|
|
304
|
+
* How run-files.mjs runs a run: its node options, the run's options that are not node --test's, and the settings of its
|
|
305
|
+
* run() (node --test's options as run() takes them, and its reporters paired with their destinations as node pairs
|
|
306
|
+
* them, by position, spec on stdout when none is given and stdout for a lone reporter). A test option node knows that
|
|
307
|
+
* jskit test does not is refused, never dropped.
|
|
308
|
+
* @param {string[]} options a run's options, without its files
|
|
309
|
+
* @returns {{ nodeOptions: string[], settings: Record<string, unknown> }}
|
|
310
|
+
*/
|
|
311
|
+
function runnerInvocation(options) {
|
|
312
|
+
const nodeOptions = [];
|
|
313
|
+
const settings = {};
|
|
314
|
+
for (let index = 0; index < options.length; index += 1) {
|
|
315
|
+
const option = options[index];
|
|
316
|
+
const equals = option.startsWith("--") ? option.indexOf("=") : -1;
|
|
317
|
+
const name = equals > 0 ? option.slice(0, equals) : option;
|
|
318
|
+
const known = RUN_OPTIONS[name];
|
|
319
|
+
if (!known) {
|
|
320
|
+
if (TEST_OPTION.test(name) && !FILE_OPTIONS.has(name)) {
|
|
321
|
+
throw new Error(`jskit test does not take node's ${name}; run node --test for it.`);
|
|
322
|
+
}
|
|
323
|
+
nodeOptions.push(option);
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
let text = true;
|
|
327
|
+
if (!known.flag) {
|
|
328
|
+
text = equals > 0 ? option.slice(equals + 1) : options[index + 1];
|
|
329
|
+
if (equals < 0) index += 1;
|
|
330
|
+
}
|
|
331
|
+
if (text === undefined) throw new Error(`jskit test: ${name} takes a value.`);
|
|
332
|
+
if (!known.key) continue;
|
|
333
|
+
const value = known.number ? Number(text) : text;
|
|
334
|
+
if (known.list) (settings[known.key] ??= []).push(value);
|
|
335
|
+
else settings[known.key] = value;
|
|
336
|
+
}
|
|
337
|
+
const { reporters = [], destinations = [] } = settings;
|
|
338
|
+
delete settings.destinations;
|
|
339
|
+
if (reporters.length === 0 && destinations.length === 0) reporters.push("spec");
|
|
340
|
+
if (reporters.length === 1 && destinations.length === 0) destinations.push("stdout");
|
|
341
|
+
if (reporters.length !== destinations.length) {
|
|
342
|
+
throw new Error(`jskit test: ${reporters.length} ${REPORTER} and ${destinations.length} ${DESTINATION}: node pairs them ` +
|
|
343
|
+
"by position, so give each reporter its destination.");
|
|
344
|
+
}
|
|
345
|
+
settings.reporters = reporters.map((reporter, index) => ({ name: reporter, destination: destinations[index] }));
|
|
346
|
+
return { nodeOptions, settings };
|
|
347
|
+
}
|
|
348
|
+
|
|
222
349
|
/**
|
|
223
350
|
* The run with the time reporter added before its own options (node takes the arguments after a file as files), writing
|
|
224
351
|
* to `destination`. Node pairs reporters and destinations by position, and gives a run with no reporter `spec` on
|
|
@@ -331,7 +458,13 @@ async function runTests(args) {
|
|
|
331
458
|
? networkGuardEnvironment(process.env, "jskit test")
|
|
332
459
|
: { NODE_OPTIONS: withoutNetworkGuard(process.env.NODE_OPTIONS) })
|
|
333
460
|
};
|
|
334
|
-
|
|
461
|
+
// run-files.mjs runs the files in their start order, with the run's node options as its own.
|
|
462
|
+
const files = plan.runFiles[index];
|
|
463
|
+
const timed = withTimeReporter(run, collected[index]);
|
|
464
|
+
const { nodeOptions, settings } = runnerInvocation(timed.slice(0, timed.length - files.length));
|
|
465
|
+
const settingsFile = path.join(timesDirectory, `run-${index}.settings.json`);
|
|
466
|
+
writeFileSync(settingsFile, JSON.stringify({ ...settings, files }));
|
|
467
|
+
const { code, signal } = await runNode([...preload, ...nodeOptions, RUN_FILES, settingsFile], env);
|
|
335
468
|
if (exitCode === 0) exitCode = code;
|
|
336
469
|
// An interrupted run ends the whole command.
|
|
337
470
|
interrupted = Boolean(signal);
|
|
@@ -364,9 +497,6 @@ async function runTests(args) {
|
|
|
364
497
|
/** A pooled file's name in the pool's output: its group's name, then its path in the group's directory. */
|
|
365
498
|
const pooledName = ({ group, file }) => `${group.name}: ${file}`;
|
|
366
499
|
|
|
367
|
-
// The longest recorded time first, a file with none (Infinity) before them all; equal times keep their order.
|
|
368
|
-
const longestFirst = (first, second) => (first.ms === second.ms ? 0 : first.ms < second.ms ? 1 : -1);
|
|
369
|
-
|
|
370
500
|
/**
|
|
371
501
|
* The files of a pool's groups (runTestPool), each with its group, why it runs alone or reaches the network (or
|
|
372
502
|
* undefined), and its time in its group's record, the longest first. A group takes files and globs only: a node option
|
|
@@ -555,4 +685,4 @@ async function runTestPool(groups) {
|
|
|
555
685
|
return exitCode;
|
|
556
686
|
}
|
|
557
687
|
|
|
558
|
-
export { defaultTestFiles, findTestFiles, missedTestFiles, planTestPool, planTestRuns, runTestPool, runTests, withTimeReporter };
|
|
688
|
+
export { defaultTestFiles, findTestFiles, missedTestFiles, planTestPool, planTestRuns, runTestPool, runTests, runnerInvocation, withTimeReporter };
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
// (node --test starts one per file, with NODE_TEST_CONTEXT set), it stops the file at the time `jskit test` gave it
|
|
3
3
|
// (fileStop in time-report.mjs): a file that never finishes, because a test has no timeout or a server, child
|
|
4
4
|
// process, timer or socket was left open, then fails by name and the rest of the run still finishes and reports. It
|
|
5
|
-
// also stops a file whose tests have all ended but whose process is still running
|
|
6
|
-
// linger bound): something its tests left open, an interval, a server, a socket or a child
|
|
5
|
+
// also stops a file whose tests and top-level after() hooks have all ended but whose process is still running
|
|
6
|
+
// `lingerMs` later (the linger bound): something its tests left open, an interval, a server, a socket or a child
|
|
7
|
+
// process, keeps it alive. Its after hooks, its teardown, get a bound of their own of the same length from its last
|
|
8
|
+
// test, so one that never ends is stopped too.
|
|
7
9
|
// Before it stops one, it says what is still open, from process.getActiveResourcesInfo() read in that process, or
|
|
8
10
|
// that nothing is: then the process was still busy when its stop got a turn. The runner's own process, worker threads
|
|
9
11
|
// and the processes a test starts do nothing.
|
|
@@ -68,21 +70,26 @@ if (stopsFile && isMainThread && process.env.NODE_TEST_CONTEXT && !runsTestFiles
|
|
|
68
70
|
const record = (prefix, value) =>
|
|
69
71
|
writeFileSync(path.join(path.dirname(stopsFile), `${prefix}${process.pid}.json`), JSON.stringify(value));
|
|
70
72
|
const started = performance.now();
|
|
71
|
-
// node:test has
|
|
73
|
+
// node:test has started the root's after() hooks, and has run them all; then the file's module had finished
|
|
74
|
+
// loading too.
|
|
72
75
|
let testsEnded = false;
|
|
76
|
+
let hooksEnded = false;
|
|
73
77
|
let loaded = false;
|
|
74
78
|
// Tests running that started after the root's after() hooks: those a file declares after a top-level await.
|
|
75
79
|
let late = 0;
|
|
76
|
-
// When the linger bound last started, and its timer
|
|
80
|
+
// When the linger bound last started, and its timer: at the file's last test while its after hooks run, then at
|
|
81
|
+
// their end.
|
|
77
82
|
let ended = null;
|
|
78
83
|
let lingering;
|
|
79
84
|
let stopping = false;
|
|
80
85
|
const lingered = () => {
|
|
81
86
|
stopping = true;
|
|
82
|
-
const value = {
|
|
87
|
+
const value = {
|
|
88
|
+
file: hang.file, ms: Math.round(performance.now() - ended), resources: heldOpen(), afterHooks: !hooksEnded
|
|
89
|
+
};
|
|
83
90
|
record(LINGERED_PREFIX, value);
|
|
84
|
-
writeFileSync(2, `\njskit test: stopped ${value.file} ${(value.ms / 1000).toFixed(1)} s after its last test
|
|
85
|
-
`${describeHold(value.resources)}.\n`);
|
|
91
|
+
writeFileSync(2, `\njskit test: stopped ${value.file} ${(value.ms / 1000).toFixed(1)} s after its last test` +
|
|
92
|
+
`${value.afterHooks ? ", its after hooks still running" : " and after hooks"}, ${describeHold(value.resources)}.\n`);
|
|
86
93
|
exit.call(process, 1);
|
|
87
94
|
};
|
|
88
95
|
const settle = () => {
|
|
@@ -106,14 +113,21 @@ if (stopsFile && isMainThread && process.env.NODE_TEST_CONTEXT && !runsTestFiles
|
|
|
106
113
|
const nodeTest = await import("node:test");
|
|
107
114
|
// node:test runs the root's after() hooks, this one first, as soon as the file's last test so far has ended. A
|
|
108
115
|
// test declared after a top-level await comes later still, so the bound starts once the file's module has also
|
|
109
|
-
// finished loading, when its import settles; a test that starts after that holds the bound until it ends.
|
|
110
|
-
|
|
116
|
+
// finished loading, when its import settles; a test that starts after that holds the bound until it ends. The
|
|
117
|
+
// after() hook this one adds runs after the file's own, as node:test runs the root's hooks as they are added, and
|
|
118
|
+
// starts the bound again at their end. One that throws ends node:test's run of them, and the bound runs on from the
|
|
119
|
+
// file's last test.
|
|
120
|
+
nodeTest.after((context) => {
|
|
111
121
|
testsEnded = true;
|
|
112
122
|
const loading = () => {
|
|
113
123
|
loaded = true;
|
|
114
124
|
settle();
|
|
115
125
|
};
|
|
116
126
|
import(pathToFileURL(entry).href).then(loading, loading);
|
|
127
|
+
context.after(() => {
|
|
128
|
+
hooksEnded = true;
|
|
129
|
+
settle();
|
|
130
|
+
});
|
|
117
131
|
});
|
|
118
132
|
nodeTest.beforeEach(() => {
|
|
119
133
|
if (!testsEnded) return;
|
|
@@ -125,7 +139,7 @@ if (stopsFile && isMainThread && process.env.NODE_TEST_CONTEXT && !runsTestFiles
|
|
|
125
139
|
late = Math.max(0, late - 1);
|
|
126
140
|
settle();
|
|
127
141
|
});
|
|
128
|
-
// How long after its last test the file's process ended, for the run's report.
|
|
142
|
+
// How long after its last test and after hooks the file's process ended, for the run's report.
|
|
129
143
|
process.once("exit", () => {
|
|
130
144
|
if (ended !== null && !stopping) record(EXITED_PREFIX, { file: hang.file, ms: Math.round(performance.now() - ended) });
|
|
131
145
|
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// The runner process of one `jskit test` run (command.mjs), in place of node --test's own: node:test's run() over the
|
|
2
|
+
// run's files in the order it is given them, the longest first, where node --test sorts the files it is given by name.
|
|
3
|
+
// Its one argument is a settings file: the files, the run() options command.mjs read from the run's node --test options,
|
|
4
|
+
// and the reporters, each paired with its destination as node pairs them. It fails as node --test fails, when a file or
|
|
5
|
+
// the run reports a failure. The run's other node options are this process's own, so node passes them on to each test
|
|
6
|
+
// file's process as node --test does. A signal ends the run: its files' processes are stopped and the reporters finish.
|
|
7
|
+
import { createWriteStream, readFileSync } from "node:fs";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import process from "node:process";
|
|
11
|
+
import { run } from "node:test";
|
|
12
|
+
import * as builtInReporters from "node:test/reporters";
|
|
13
|
+
import { pathToFileURL } from "node:url";
|
|
14
|
+
|
|
15
|
+
const BUILT_IN_REPORTERS = new Set(["dot", "junit", "lcov", "spec", "tap"]);
|
|
16
|
+
const STREAM_DESTINATIONS = { stdout: process.stdout, stderr: process.stderr };
|
|
17
|
+
const URL_SPECIFIER = /^[a-z][a-z\d+.-]*:/iu;
|
|
18
|
+
|
|
19
|
+
/** A reporter module as node --test resolves its name: a path, or a package, from the working directory. */
|
|
20
|
+
function reporterSpecifier(name) {
|
|
21
|
+
if (path.isAbsolute(name) || name.startsWith(".")) return pathToFileURL(path.resolve(name)).href;
|
|
22
|
+
if (URL_SPECIFIER.test(name)) return name;
|
|
23
|
+
try {
|
|
24
|
+
return pathToFileURL(createRequire(path.join(process.cwd(), "package.json")).resolve(name)).href;
|
|
25
|
+
} catch {
|
|
26
|
+
// A package that only ESM imports resolve: from here, which is under the application's node_modules.
|
|
27
|
+
return name;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The reporter `--test-reporter` names, as node --test makes it: a class is constructed, a generator used as it is. */
|
|
32
|
+
async function loadReporter(name) {
|
|
33
|
+
let reporter = BUILT_IN_REPORTERS.has(name) ? builtInReporters[name] : await import(reporterSpecifier(name));
|
|
34
|
+
if (reporter?.default) reporter = reporter.default;
|
|
35
|
+
if (reporter?.prototype && Object.getOwnPropertyDescriptor(reporter.prototype, "constructor")) reporter = new reporter();
|
|
36
|
+
if (!reporter) throw new Error(`jskit test: --test-reporter ${name} names no test reporter.`);
|
|
37
|
+
return reporter;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const { files, reporters, ...options } = JSON.parse(readFileSync(process.argv[2], "utf8"));
|
|
41
|
+
// Every reporter is ready before the run starts, so each sees all of its events.
|
|
42
|
+
const outputs = await Promise.all(reporters.map(async ({ name, destination }) => ({
|
|
43
|
+
reporter: await loadReporter(name),
|
|
44
|
+
destination: STREAM_DESTINATIONS[destination] ?? createWriteStream(destination, { flush: true })
|
|
45
|
+
})));
|
|
46
|
+
const abort = new AbortController();
|
|
47
|
+
const interrupt = () => {
|
|
48
|
+
process.off("SIGINT", interrupt);
|
|
49
|
+
process.off("SIGTERM", interrupt);
|
|
50
|
+
abort.abort();
|
|
51
|
+
};
|
|
52
|
+
process.on("SIGINT", interrupt);
|
|
53
|
+
process.on("SIGTERM", interrupt);
|
|
54
|
+
const events = run({ ...options, files, signal: abort.signal });
|
|
55
|
+
events.on("test:summary", (summary) => {
|
|
56
|
+
if (!summary.success) process.exitCode = 1;
|
|
57
|
+
});
|
|
58
|
+
for (const { reporter, destination } of outputs) events.compose(reporter).pipe(destination);
|
|
@@ -12,8 +12,9 @@ import { EXITED_PREFIX, LINGERED_PREFIX, STOPPED_PREFIX, describeHold } from "./
|
|
|
12
12
|
// bounds in test-time-bounds.json, `{ "runMs": ..., "fileMs": ..., "lingerMs": ..., "files": { "<path>": ... } }`, with
|
|
13
13
|
// the measurement. A file that has not finished by a generous multiple of its time is stopped while it runs
|
|
14
14
|
// (file-stop.mjs), so one file that never ends fails by name instead of holding up the whole run until a runner's
|
|
15
|
-
// own ceiling ends it; so is a file still running `lingerMs` after its last test
|
|
16
|
-
//
|
|
15
|
+
// own ceiling ends it; so is a file still running `lingerMs` after its last test and after hooks, or whose after hooks
|
|
16
|
+
// still run `lingerMs` after its last test, naming what keeps it running, and a file still busy then that ends by itself
|
|
17
|
+
// before its stop gets a turn fails the run too. So does a file the run took
|
|
17
18
|
// as a test file that declares no tests, a helper or fixture outside the folders `jskit test` sets apart.
|
|
18
19
|
const SHOWN = 10;
|
|
19
20
|
// Stops a file at twice its bound (at least two seconds, well past any file's start-up), or at ten times its recorded
|
|
@@ -31,10 +32,13 @@ const BOUNDS_FILE = "test-time-bounds.json";
|
|
|
31
32
|
// running), then 1.0 s (realtime's providerRuntime.test.js, a 1 s one), 0.2 s in six suites and 0.1 s or less in the
|
|
32
33
|
// other 42.
|
|
33
34
|
const LINGER_MS = 10_000;
|
|
34
|
-
// What a file past the linger bound is told to do: close what its tests left open,
|
|
35
|
+
// What a file past the linger bound is told to do: close what its tests left open, finish the work it still does, or
|
|
36
|
+
// end what its after hooks wait on.
|
|
35
37
|
const CLOSE_WHAT_IS_OPEN = "Close what its tests leave open (an interval, a server, a socket, a child process) in the test or an after hook.";
|
|
36
|
-
const FINISH_THE_WORK = "Find the work it still does after its last test
|
|
37
|
-
"it) and finish it within
|
|
38
|
+
const FINISH_THE_WORK = "Find the work it still does after its last test and after hooks (work a test or an after hook started " +
|
|
39
|
+
"without waiting for it) and finish it within them.";
|
|
40
|
+
const END_THE_WAIT = "Find what its after hooks wait on that never ends (a server's open connections, a child process, a promise " +
|
|
41
|
+
"nothing settles) and end it.";
|
|
38
42
|
const DEFAULT_BOUNDS = Object.freeze({ runMs: 45 * 60_000, fileMs: 10 * 60_000, lingerMs: LINGER_MS, files: Object.freeze({}) });
|
|
39
43
|
const FILE_TIMES = path.join("node_modules", ".cache", "jskit-test", "file-times.json");
|
|
40
44
|
|
|
@@ -107,8 +111,9 @@ function fileStop({ bound, recorded }) {
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
/**
|
|
110
|
-
* Writes when each of the run's files is stopped, keyed by its absolute path, for file-stop.mjs, and how long
|
|
111
|
-
* after its last test (`lingerMs`, the same for every file); returns
|
|
114
|
+
* Writes when each of the run's files is stopped, keyed by its absolute path, for file-stop.mjs, and how long after its
|
|
115
|
+
* last test and after hooks, and its after hooks after its last test (`lingerMs`, the same for every file); returns
|
|
116
|
+
* the file.
|
|
112
117
|
* @param {{ cwd: string, files: string[], directory: string }} options `files`: the run's test files, relative to cwd
|
|
113
118
|
*/
|
|
114
119
|
function writeFileStops({ cwd, files, directory }) {
|
|
@@ -134,11 +139,12 @@ function writeFileStops({ cwd, files, directory }) {
|
|
|
134
139
|
* @param {{ bounds: { runMs: number, fileMs: number, lingerMs?: number, files: Record<string, number> },
|
|
135
140
|
* files: Record<string, number>, tests: Array<{ file: string, name: string, ms: number }>, wallMs: number,
|
|
136
141
|
* stopped?: Array<{ file: string, ms: number, reason: string }>,
|
|
137
|
-
* lingered?: Array<{ file: string, ms: number, resources: string[] }>,
|
|
142
|
+
* lingered?: Array<{ file: string, ms: number, resources: string[], afterHooks?: boolean }>,
|
|
138
143
|
* exited?: Array<{ file: string, ms: number }>, empty?: string[] }} times `stopped`: the files stopped while running;
|
|
139
|
-
* `lingered`: those stopped after their last test
|
|
140
|
-
*
|
|
141
|
-
*
|
|
144
|
+
* `lingered`: those stopped after their last test and after hooks, or while their after hooks still ran
|
|
145
|
+
* (`afterHooks`), with what was still open; `exited`: how long after its last test and after hooks each other file's
|
|
146
|
+
* process ended, failing one past `lingerMs`, which was still busy then with nothing holding it open; `empty`: the
|
|
147
|
+
* files that passed declaring no tests, which fail too
|
|
142
148
|
*/
|
|
143
149
|
function checkTestTimes({ bounds, files, tests, wallMs, stopped = [], lingered = [], exited = [], empty = [] }) {
|
|
144
150
|
const rows = Object.entries(files).map(([name, ms]) => ({ name, ms, bound: bounds.files[name] ?? bounds.fileMs }));
|
|
@@ -146,11 +152,14 @@ function checkTestTimes({ bounds, files, tests, wallMs, stopped = [], lingered =
|
|
|
146
152
|
const lingerMs = bounds.lingerMs ?? LINGER_MS;
|
|
147
153
|
const overruns = [
|
|
148
154
|
...stopped.map((stop) => `${stop.file} was stopped after ${seconds(stop.ms)}, ${stop.reason}: it did not finish.`),
|
|
149
|
-
...lingered.map((stop) =>
|
|
150
|
-
`${
|
|
155
|
+
...lingered.map((stop) => (stop.afterHooks
|
|
156
|
+
? `${stop.file}'s after hooks still ran ${seconds(stop.ms)} after its last test, and it was stopped, ` +
|
|
157
|
+
`${describeHold(stop.resources)}. ${END_THE_WAIT}`
|
|
158
|
+
: `${stop.file} outlived its last test and after hooks by ${seconds(stop.ms)} and was stopped, ` +
|
|
159
|
+
`${describeHold(stop.resources)}. ${stop.resources.length > 0 ? CLOSE_WHAT_IS_OPEN : FINISH_THE_WORK}`)),
|
|
151
160
|
// Its stop never got a turn: the process was still working when the bound passed, then ended with nothing open.
|
|
152
161
|
...exited.filter((exit) => exit.ms > lingerMs).map((exit) => `${exit.file} ended ${seconds(exit.ms)} after its last ` +
|
|
153
|
-
`test, past its ${seconds(lingerMs)} linger bound: busy, not held open. ${FINISH_THE_WORK}`),
|
|
162
|
+
`test and after hooks, past its ${seconds(lingerMs)} linger bound: busy, not held open. ${FINISH_THE_WORK}`),
|
|
154
163
|
...rows.filter((row) => row.ms > row.bound && !ended.has(row.name))
|
|
155
164
|
.map((row) => `${row.name} took ${seconds(row.ms)}, past its ${seconds(row.bound)} bound.`)
|
|
156
165
|
];
|
|
@@ -164,7 +173,7 @@ function checkTestTimes({ bounds, files, tests, wallMs, stopped = [], lingered =
|
|
|
164
173
|
];
|
|
165
174
|
const longest = [...exited].sort((a, b) => b.ms - a.ms)[0];
|
|
166
175
|
if (longest) {
|
|
167
|
-
lines.push(`jskit test: the longest a file's process lived after its last test, time / bound: ` +
|
|
176
|
+
lines.push(`jskit test: the longest a file's process lived after its last test and after hooks, time / bound: ` +
|
|
168
177
|
`${seconds(longest.ms)} / ${seconds(lingerMs)} ${longest.file}`);
|
|
169
178
|
}
|
|
170
179
|
if (empty.length > 0) {
|
|
@@ -185,8 +194,8 @@ function checkTestTimes({ bounds, files, tests, wallMs, stopped = [], lingered =
|
|
|
185
194
|
}
|
|
186
195
|
|
|
187
196
|
/**
|
|
188
|
-
* Reads what the runs' reporters wrote, which files file-stop.mjs stopped and how long after its last test
|
|
189
|
-
* other file's process ended, and records each finished file's time for the next command (a stopped file, one that
|
|
197
|
+
* Reads what the runs' reporters wrote, which files file-stop.mjs stopped and how long after its last test and after
|
|
198
|
+
* hooks each other file's process ended, and records each finished file's time for the next command (a stopped file, one that
|
|
190
199
|
* skipped a test, and every file of a run filtered to some of its tests keep the time they last finished all their
|
|
191
200
|
* tests in, since the next stop is reckoned from it). A run whose reporters were replaced (inside another node --test
|
|
192
201
|
* run) wrote nothing, and has no times unless a file was stopped.
|
|
@@ -195,7 +204,8 @@ function checkTestTimes({ bounds, files, tests, wallMs, stopped = [], lingered =
|
|
|
195
204
|
* ran only the tests a name pattern or `only` picked, so a file whose tests it left out declares none it ran
|
|
196
205
|
* @returns {{ files: Record<string, number>, tests: Array<{ file: string, name: string, ms: number }>,
|
|
197
206
|
* stopped: Array<{ file: string, ms: number, reason: string }>,
|
|
198
|
-
* lingered: Array<{ file: string, ms: number, resources: string[]
|
|
207
|
+
* lingered: Array<{ file: string, ms: number, resources: string[], afterHooks?: boolean }>,
|
|
208
|
+
* exited: Array<{ file: string, ms: number }>,
|
|
199
209
|
* empty: string[] } | null} `empty`: the files that passed declaring no test
|
|
200
210
|
*/
|
|
201
211
|
function recordTestTimes({ cwd, collected, directory, filtered = false }) {
|