allure 3.15.0 → 3.16.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.
Files changed (39) hide show
  1. package/README.md +16 -7
  2. package/dist/commands/agent-run.d.ts +1 -0
  3. package/dist/commands/agent-run.js +11 -6
  4. package/dist/commands/agent.d.ts +1 -0
  5. package/dist/commands/agent.js +19 -8
  6. package/dist/commands/allure2.js +9 -9
  7. package/dist/commands/awesome.js +9 -9
  8. package/dist/commands/check.js +1 -1
  9. package/dist/commands/classic.js +9 -9
  10. package/dist/commands/commons/generate.d.ts +1 -1
  11. package/dist/commands/commons/generate.js +7 -3
  12. package/dist/commands/commons/resultsDiscovery.d.ts +5 -0
  13. package/dist/commands/commons/resultsDiscovery.js +17 -0
  14. package/dist/commands/commons/run.d.ts +2 -0
  15. package/dist/commands/commons/run.js +37 -22
  16. package/dist/commands/csv.js +9 -9
  17. package/dist/commands/dashboard.js +9 -9
  18. package/dist/commands/generate.js +2 -2
  19. package/dist/commands/history.js +6 -4
  20. package/dist/commands/jira/clear.js +1 -1
  21. package/dist/commands/log.js +9 -9
  22. package/dist/commands/open.js +9 -5
  23. package/dist/commands/qualityGate.js +4 -4
  24. package/dist/commands/results/pack.d.ts +1 -0
  25. package/dist/commands/results/pack.js +12 -14
  26. package/dist/commands/run.d.ts +1 -0
  27. package/dist/commands/run.js +19 -7
  28. package/dist/commands/slack.js +9 -9
  29. package/dist/commands/testplan.js +7 -5
  30. package/dist/commands/watch.d.ts +1 -0
  31. package/dist/commands/watch.js +71 -25
  32. package/dist/utils/index.d.ts +2 -0
  33. package/dist/utils/index.js +2 -0
  34. package/dist/utils/process.js +1 -0
  35. package/dist/utils/resultsPatterns.d.ts +12 -0
  36. package/dist/utils/resultsPatterns.js +37 -0
  37. package/dist/utils/signals.d.ts +18 -0
  38. package/dist/utils/signals.js +52 -0
  39. package/package.json +21 -21
@@ -0,0 +1,18 @@
1
+ export declare const SIGNAL_EXIT_CODES: Partial<Record<NodeJS.Signals, number>>;
2
+ export declare const GRACEFUL_SHUTDOWN_TIMEOUT_MS = 60000;
3
+ export declare const COMMAND_TERMINATION_GRACE_MS = 5000;
4
+ export type SignalInfo = {
5
+ signal: NodeJS.Signals;
6
+ code: number;
7
+ receivedAt: number;
8
+ deadline: number;
9
+ };
10
+ export type SignalNotifier = {
11
+ signal: AbortSignal;
12
+ info: () => SignalInfo | undefined;
13
+ dispose: () => void;
14
+ };
15
+ export declare const notifySignals: (signals?: NodeJS.Signals[], onRepeat?: (signal: NodeJS.Signals) => void) => SignalNotifier;
16
+ export declare const gracefulShutdownRemaining: (info: SignalInfo | undefined) => number | undefined;
17
+ export declare const boundedTerminationSignal: (info: SignalInfo | undefined, graceMs?: number) => AbortSignal;
18
+ export declare const waitForAbort: (signal: AbortSignal) => Promise<void>;
@@ -0,0 +1,52 @@
1
+ import process from "node:process";
2
+ export const SIGNAL_EXIT_CODES = {
3
+ SIGINT: 130,
4
+ SIGTERM: 143,
5
+ };
6
+ export const GRACEFUL_SHUTDOWN_TIMEOUT_MS = 60000;
7
+ export const COMMAND_TERMINATION_GRACE_MS = 5000;
8
+ const exitCodeForSignal = (signal) => SIGNAL_EXIT_CODES[signal] ?? 1;
9
+ export const notifySignals = (signals = ["SIGINT", "SIGTERM"], onRepeat) => {
10
+ const controller = new AbortController();
11
+ let info;
12
+ const handler = (signal) => {
13
+ if (info) {
14
+ onRepeat?.(signal);
15
+ return;
16
+ }
17
+ const receivedAt = Date.now();
18
+ info = {
19
+ signal,
20
+ code: exitCodeForSignal(signal),
21
+ receivedAt,
22
+ deadline: receivedAt + GRACEFUL_SHUTDOWN_TIMEOUT_MS,
23
+ };
24
+ controller.abort();
25
+ };
26
+ for (const signal of signals) {
27
+ process.on(signal, handler);
28
+ }
29
+ return {
30
+ signal: controller.signal,
31
+ info: () => info,
32
+ dispose: () => {
33
+ for (const signal of signals) {
34
+ process.off(signal, handler);
35
+ }
36
+ },
37
+ };
38
+ };
39
+ export const gracefulShutdownRemaining = (info) => {
40
+ if (!info) {
41
+ return undefined;
42
+ }
43
+ return Math.max(0, info.deadline - Date.now());
44
+ };
45
+ export const boundedTerminationSignal = (info, graceMs = COMMAND_TERMINATION_GRACE_MS) => {
46
+ const remaining = gracefulShutdownRemaining(info);
47
+ const timeoutMs = remaining === undefined ? graceMs : Math.min(remaining, graceMs);
48
+ return AbortSignal.timeout(timeoutMs);
49
+ };
50
+ export const waitForAbort = (signal) => signal.aborted
51
+ ? Promise.resolve()
52
+ : new Promise((resolve) => signal.addEventListener("abort", () => resolve(), { once: true }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allure",
3
- "version": "3.15.0",
3
+ "version": "3.16.0",
4
4
  "description": "Allure Commandline Tool",
5
5
  "keywords": [
6
6
  "allure",
@@ -32,26 +32,26 @@
32
32
  "lint:fix": "oxlint --import-plugin --fix src test features stories"
33
33
  },
34
34
  "dependencies": {
35
- "@allurereport/charts-api": "3.15.0",
36
- "@allurereport/ci": "3.15.0",
37
- "@allurereport/core": "3.15.0",
38
- "@allurereport/core-api": "3.15.0",
39
- "@allurereport/directory-watcher": "3.15.0",
40
- "@allurereport/plugin-agent": "3.15.0",
41
- "@allurereport/plugin-allure2": "3.15.0",
42
- "@allurereport/plugin-api": "3.15.0",
43
- "@allurereport/plugin-awesome": "3.15.0",
44
- "@allurereport/plugin-classic": "3.15.0",
45
- "@allurereport/plugin-csv": "3.15.0",
46
- "@allurereport/plugin-dashboard": "3.15.0",
47
- "@allurereport/plugin-jira": "3.15.0",
48
- "@allurereport/plugin-log": "3.15.0",
49
- "@allurereport/plugin-progress": "3.15.0",
50
- "@allurereport/plugin-server-reload": "3.15.0",
51
- "@allurereport/plugin-slack": "3.15.0",
52
- "@allurereport/reader-api": "3.15.0",
53
- "@allurereport/service": "3.15.0",
54
- "@allurereport/static-server": "3.15.0",
35
+ "@allurereport/charts-api": "3.16.0",
36
+ "@allurereport/ci": "3.16.0",
37
+ "@allurereport/core": "3.16.0",
38
+ "@allurereport/core-api": "3.16.0",
39
+ "@allurereport/directory-watcher": "3.16.0",
40
+ "@allurereport/plugin-agent": "3.16.0",
41
+ "@allurereport/plugin-allure2": "3.16.0",
42
+ "@allurereport/plugin-api": "3.16.0",
43
+ "@allurereport/plugin-awesome": "3.16.0",
44
+ "@allurereport/plugin-classic": "3.16.0",
45
+ "@allurereport/plugin-csv": "3.16.0",
46
+ "@allurereport/plugin-dashboard": "3.16.0",
47
+ "@allurereport/plugin-jira": "3.16.0",
48
+ "@allurereport/plugin-log": "3.16.0",
49
+ "@allurereport/plugin-progress": "3.16.0",
50
+ "@allurereport/plugin-server-reload": "3.16.0",
51
+ "@allurereport/plugin-slack": "3.16.0",
52
+ "@allurereport/reader-api": "3.16.0",
53
+ "@allurereport/service": "3.16.0",
54
+ "@allurereport/static-server": "3.16.0",
55
55
  "adm-zip": "^0.6.0",
56
56
  "clipanion": "^4.0.0-rc.4",
57
57
  "glob": "^13.0.6",