@thymian/plugin-sampler 0.3.0-canary.20261007-a803130 → 0.3.0-canary.20261007-cdbe1d3
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/dist/cli/check-result.d.ts +88 -0
- package/dist/cli/check-result.d.ts.map +1 -0
- package/dist/cli/check-result.js +160 -0
- package/dist/cli/check-result.js.map +1 -0
- package/dist/cli/commands/sampler/check.d.ts +32 -4
- package/dist/cli/commands/sampler/check.d.ts.map +1 -1
- package/dist/cli/commands/sampler/check.js +126 -88
- package/dist/cli/commands/sampler/check.js.map +1 -1
- package/dist/cli/commands/sampler/init.d.ts +4 -6
- package/dist/cli/commands/sampler/init.d.ts.map +1 -1
- package/dist/cli/commands/sampler/init.js +33 -49
- package/dist/cli/commands/sampler/init.js.map +1 -1
- package/dist/cli/commands/sampler/show.d.ts +11 -0
- package/dist/cli/commands/sampler/show.d.ts.map +1 -0
- package/dist/cli/commands/sampler/show.js +36 -0
- package/dist/cli/commands/sampler/show.js.map +1 -0
- package/dist/cli/commands/sampler/sync.d.ts +11 -0
- package/dist/cli/commands/sampler/sync.d.ts.map +1 -0
- package/dist/cli/commands/sampler/sync.js +65 -0
- package/dist/cli/commands/sampler/sync.js.map +1 -0
- package/dist/cli/commands/sampler/validate.d.ts +3 -10
- package/dist/cli/commands/sampler/validate.d.ts.map +1 -1
- package/dist/cli/commands/sampler/validate.js +57 -126
- package/dist/cli/commands/sampler/validate.js.map +1 -1
- package/dist/generation/closed-schema.d.ts +22 -0
- package/dist/generation/closed-schema.d.ts.map +1 -0
- package/dist/generation/closed-schema.js +45 -0
- package/dist/generation/closed-schema.js.map +1 -0
- package/dist/generation/content-type-strategies/json.content-type-strategy.d.ts.map +1 -1
- package/dist/generation/content-type-strategies/json.content-type-strategy.js +3 -1
- package/dist/generation/content-type-strategies/json.content-type-strategy.js.map +1 -1
- package/dist/generation/content-type-strategies/xml.content-type-strategy.d.ts.map +1 -1
- package/dist/generation/content-type-strategies/xml.content-type-strategy.js +3 -1
- package/dist/generation/content-type-strategies/xml.content-type-strategy.js.map +1 -1
- package/dist/generation/generate-request-sample.d.ts +12 -0
- package/dist/generation/generate-request-sample.d.ts.map +1 -0
- package/dist/generation/{generate-samples.js → generate-request-sample.js} +11 -4
- package/dist/generation/generate-request-sample.js.map +1 -0
- package/dist/generation/request-generators/default-request-generator.d.ts +14 -0
- package/dist/generation/request-generators/default-request-generator.d.ts.map +1 -1
- package/dist/generation/request-generators/default-request-generator.js +18 -1
- package/dist/generation/request-generators/default-request-generator.js.map +1 -1
- package/dist/generation/types/declaration-set.d.ts +124 -0
- package/dist/generation/types/declaration-set.d.ts.map +1 -0
- package/dist/generation/types/declaration-set.js +389 -0
- package/dist/generation/types/declaration-set.js.map +1 -0
- package/dist/generation/types/example-reflection.d.ts +21 -0
- package/dist/generation/types/example-reflection.d.ts.map +1 -0
- package/dist/generation/types/example-reflection.js +135 -0
- package/dist/generation/types/example-reflection.js.map +1 -0
- package/dist/generation/types/generate-type-surface.d.ts +23 -0
- package/dist/generation/types/generate-type-surface.d.ts.map +1 -0
- package/dist/generation/types/generate-type-surface.js +671 -0
- package/dist/generation/types/generate-type-surface.js.map +1 -0
- package/dist/generation/types/schema-type.d.ts +20 -0
- package/dist/generation/types/schema-type.d.ts.map +1 -0
- package/dist/generation/types/schema-type.js +203 -0
- package/dist/generation/types/schema-type.js.map +1 -0
- package/dist/generation/types/self-check-surface.d.ts +32 -0
- package/dist/generation/types/self-check-surface.d.ts.map +1 -0
- package/dist/generation/types/self-check-surface.js +92 -0
- package/dist/generation/types/self-check-surface.js.map +1 -0
- package/dist/generation/types/type-names.d.ts +135 -0
- package/dist/generation/types/type-names.d.ts.map +1 -0
- package/dist/generation/types/type-names.js +213 -0
- package/dist/generation/types/type-names.js.map +1 -0
- package/dist/generation/types/write-type-surface.d.ts +58 -0
- package/dist/generation/types/write-type-surface.d.ts.map +1 -0
- package/dist/generation/types/write-type-surface.js +119 -0
- package/dist/generation/types/write-type-surface.js.map +1 -0
- package/dist/hooks/create-hook-utils.d.ts +22 -6
- package/dist/hooks/create-hook-utils.d.ts.map +1 -1
- package/dist/hooks/create-hook-utils.js +74 -96
- package/dist/hooks/create-hook-utils.js.map +1 -1
- package/dist/hooks/hook-api.d.ts +49 -0
- package/dist/hooks/hook-api.d.ts.map +1 -0
- package/dist/hooks/hook-api.js +105 -0
- package/dist/hooks/hook-api.js.map +1 -0
- package/dist/hooks/hook-diagnostics.d.ts +45 -0
- package/dist/hooks/hook-diagnostics.d.ts.map +1 -0
- package/dist/hooks/hook-diagnostics.js +80 -0
- package/dist/hooks/hook-diagnostics.js.map +1 -0
- package/dist/hooks/hook-errors.d.ts +33 -0
- package/dist/hooks/hook-errors.d.ts.map +1 -1
- package/dist/hooks/hook-errors.js +46 -0
- package/dist/hooks/hook-errors.js.map +1 -1
- package/dist/hooks/hook-registration.d.ts +108 -0
- package/dist/hooks/hook-registration.d.ts.map +1 -0
- package/dist/hooks/hook-registration.js +69 -0
- package/dist/hooks/hook-registration.js.map +1 -0
- package/dist/hooks/hook-runner.d.ts +111 -11
- package/dist/hooks/hook-runner.d.ts.map +1 -1
- package/dist/hooks/hook-runner.js +309 -142
- package/dist/hooks/hook-runner.js.map +1 -1
- package/dist/hooks/hook-utils-factory.d.ts +19 -0
- package/dist/hooks/hook-utils-factory.d.ts.map +1 -0
- package/dist/hooks/hook-utils-factory.js +2 -0
- package/dist/hooks/hook-utils-factory.js.map +1 -0
- package/dist/hooks/hook-utils.d.ts +80 -12
- package/dist/hooks/hook-utils.d.ts.map +1 -1
- package/dist/hooks/invoke-hook.d.ts +71 -0
- package/dist/hooks/invoke-hook.d.ts.map +1 -0
- package/dist/hooks/invoke-hook.js +161 -0
- package/dist/hooks/invoke-hook.js.map +1 -0
- package/dist/hooks/load-user-hooks.d.ts +96 -0
- package/dist/hooks/load-user-hooks.d.ts.map +1 -0
- package/dist/hooks/load-user-hooks.js +432 -0
- package/dist/hooks/load-user-hooks.js.map +1 -0
- package/dist/hooks/nested-request.d.ts +21 -0
- package/dist/hooks/nested-request.d.ts.map +1 -0
- package/dist/hooks/nested-request.js +24 -0
- package/dist/hooks/nested-request.js.map +1 -0
- package/dist/hooks/overlay-args.d.ts +40 -0
- package/dist/hooks/overlay-args.d.ts.map +1 -0
- package/dist/hooks/overlay-args.js +84 -0
- package/dist/hooks/overlay-args.js.map +1 -0
- package/dist/hooks/resolve-targeting.d.ts +16 -0
- package/dist/hooks/resolve-targeting.d.ts.map +1 -0
- package/dist/hooks/resolve-targeting.js +168 -0
- package/dist/hooks/resolve-targeting.js.map +1 -0
- package/dist/hooks/run-scoped-hooks.d.ts +83 -0
- package/dist/hooks/run-scoped-hooks.d.ts.map +1 -0
- package/dist/hooks/run-scoped-hooks.js +153 -0
- package/dist/hooks/run-scoped-hooks.js.map +1 -0
- package/dist/index.d.ts +42 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +152 -165
- package/dist/index.js.map +1 -1
- package/dist/request-sampler.d.ts +40 -11
- package/dist/request-sampler.d.ts.map +1 -1
- package/dist/request-sampler.js +51 -76
- package/dist/request-sampler.js.map +1 -1
- package/dist/sampler-paths.d.ts +19 -0
- package/dist/sampler-paths.d.ts.map +1 -0
- package/dist/sampler-paths.js +22 -0
- package/dist/sampler-paths.js.map +1 -0
- package/dist/selectors/nearest-paths.d.ts +14 -0
- package/dist/selectors/nearest-paths.d.ts.map +1 -0
- package/dist/selectors/nearest-paths.js +32 -0
- package/dist/selectors/nearest-paths.js.map +1 -0
- package/dist/selectors/path-glob.d.ts +94 -0
- package/dist/selectors/path-glob.d.ts.map +1 -0
- package/dist/selectors/path-glob.js +136 -0
- package/dist/selectors/path-glob.js.map +1 -0
- package/dist/selectors/selector-errors.d.ts +17 -0
- package/dist/selectors/selector-errors.d.ts.map +1 -0
- package/dist/selectors/selector-errors.js +139 -0
- package/dist/selectors/selector-errors.js.map +1 -0
- package/dist/selectors/selector.d.ts +55 -0
- package/dist/selectors/selector.d.ts.map +1 -0
- package/dist/selectors/selector.js +305 -0
- package/dist/selectors/selector.js.map +1 -0
- package/dist/selectors/transaction-catalog.d.ts +96 -0
- package/dist/selectors/transaction-catalog.d.ts.map +1 -0
- package/dist/selectors/transaction-catalog.js +193 -0
- package/dist/selectors/transaction-catalog.js.map +1 -0
- package/dist/selectors/transaction-filter.d.ts +119 -0
- package/dist/selectors/transaction-filter.d.ts.map +1 -0
- package/dist/selectors/transaction-filter.js +191 -0
- package/dist/selectors/transaction-filter.js.map +1 -0
- package/dist/ts-path.d.ts +36 -0
- package/dist/ts-path.d.ts.map +1 -0
- package/dist/ts-path.js +46 -0
- package/dist/ts-path.js.map +1 -0
- package/dist/utils.d.ts +1 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -20
- package/dist/utils.js.map +1 -1
- package/dist/validation/canonicalize.d.ts +17 -0
- package/dist/validation/canonicalize.d.ts.map +1 -0
- package/dist/validation/canonicalize.js +29 -0
- package/dist/validation/canonicalize.js.map +1 -0
- package/dist/validation/shared-compiler-host.d.ts +17 -0
- package/dist/validation/shared-compiler-host.d.ts.map +1 -0
- package/dist/validation/shared-compiler-host.js +58 -0
- package/dist/validation/shared-compiler-host.js.map +1 -0
- package/dist/validation/typecheck-hooks.d.ts +37 -0
- package/dist/validation/typecheck-hooks.d.ts.map +1 -0
- package/dist/validation/typecheck-hooks.js +169 -0
- package/dist/validation/typecheck-hooks.js.map +1 -0
- package/dist/validation/validate-sampler.d.ts +79 -0
- package/dist/validation/validate-sampler.d.ts.map +1 -0
- package/dist/validation/validate-sampler.js +89 -0
- package/dist/validation/validate-sampler.js.map +1 -0
- package/package.json +7 -11
- package/dist/cli/commands/sampler/generate/hook.d.ts +0 -10
- package/dist/cli/commands/sampler/generate/hook.d.ts.map +0 -1
- package/dist/cli/commands/sampler/generate/hook.js +0 -19
- package/dist/cli/commands/sampler/generate/hook.js.map +0 -1
- package/dist/cli/generate-hook.d.ts +0 -4
- package/dist/cli/generate-hook.d.ts.map +0 -1
- package/dist/cli/generate-hook.js +0 -96
- package/dist/cli/generate-hook.js.map +0 -1
- package/dist/cli/templates.d.ts +0 -4
- package/dist/cli/templates.d.ts.map +0 -1
- package/dist/cli/templates.js +0 -28
- package/dist/cli/templates.js.map +0 -1
- package/dist/constants.d.ts +0 -12
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -16
- package/dist/constants.js.map +0 -1
- package/dist/generation/generate-samples-for-thymian-format.d.ts +0 -4
- package/dist/generation/generate-samples-for-thymian-format.d.ts.map +0 -1
- package/dist/generation/generate-samples-for-thymian-format.js +0 -18
- package/dist/generation/generate-samples-for-thymian-format.js.map +0 -1
- package/dist/generation/generate-samples.d.ts +0 -4
- package/dist/generation/generate-samples.d.ts.map +0 -1
- package/dist/generation/generate-samples.js.map +0 -1
- package/dist/hooks/generate-request-types.d.ts +0 -34
- package/dist/hooks/generate-request-types.d.ts.map +0 -1
- package/dist/hooks/generate-request-types.js +0 -458
- package/dist/hooks/generate-request-types.js.map +0 -1
- package/dist/hooks/hook-types.d.ts +0 -7
- package/dist/hooks/hook-types.d.ts.map +0 -1
- package/dist/hooks/hook-types.js +0 -2
- package/dist/hooks/hook-types.js.map +0 -1
- package/dist/hooks/load-hooks-from-samples.d.ts +0 -3
- package/dist/hooks/load-hooks-from-samples.d.ts.map +0 -1
- package/dist/hooks/load-hooks-from-samples.js +0 -22
- package/dist/hooks/load-hooks-from-samples.js.map +0 -1
- package/dist/hooks/ts-config.d.ts +0 -10
- package/dist/hooks/ts-config.d.ts.map +0 -1
- package/dist/hooks/ts-config.js +0 -10
- package/dist/hooks/ts-config.js.map +0 -1
- package/dist/samples-structure/file-request-sample.d.ts +0 -20
- package/dist/samples-structure/file-request-sample.d.ts.map +0 -1
- package/dist/samples-structure/file-request-sample.js +0 -5
- package/dist/samples-structure/file-request-sample.js.map +0 -1
- package/dist/samples-structure/get-path-transaction-id.d.ts +0 -3
- package/dist/samples-structure/get-path-transaction-id.d.ts.map +0 -1
- package/dist/samples-structure/get-path-transaction-id.js +0 -22
- package/dist/samples-structure/get-path-transaction-id.js.map +0 -1
- package/dist/samples-structure/merge-tree.d.ts +0 -5
- package/dist/samples-structure/merge-tree.d.ts.map +0 -1
- package/dist/samples-structure/merge-tree.js +0 -118
- package/dist/samples-structure/merge-tree.js.map +0 -1
- package/dist/samples-structure/read-samples-from-dir.d.ts +0 -13
- package/dist/samples-structure/read-samples-from-dir.d.ts.map +0 -1
- package/dist/samples-structure/read-samples-from-dir.js +0 -205
- package/dist/samples-structure/read-samples-from-dir.js.map +0 -1
- package/dist/samples-structure/samples-from-transactions.d.ts +0 -5
- package/dist/samples-structure/samples-from-transactions.d.ts.map +0 -1
- package/dist/samples-structure/samples-from-transactions.js +0 -120
- package/dist/samples-structure/samples-from-transactions.js.map +0 -1
- package/dist/samples-structure/samples-tree-structure.d.ts +0 -106
- package/dist/samples-structure/samples-tree-structure.d.ts.map +0 -1
- package/dist/samples-structure/samples-tree-structure.js +0 -26
- package/dist/samples-structure/samples-tree-structure.js.map +0 -1
- package/dist/samples-structure/structure-meta-on-disc.d.ts +0 -11
- package/dist/samples-structure/structure-meta-on-disc.d.ts.map +0 -1
- package/dist/samples-structure/structure-meta-on-disc.js +0 -2
- package/dist/samples-structure/structure-meta-on-disc.js.map +0 -1
- package/dist/samples-structure/traverse.d.ts +0 -4
- package/dist/samples-structure/traverse.d.ts.map +0 -1
- package/dist/samples-structure/traverse.js +0 -13
- package/dist/samples-structure/traverse.js.map +0 -1
- package/dist/samples-structure/write-samples-to-dir.d.ts +0 -37
- package/dist/samples-structure/write-samples-to-dir.d.ts.map +0 -1
- package/dist/samples-structure/write-samples-to-dir.js +0 -183
- package/dist/samples-structure/write-samples-to-dir.js.map +0 -1
- package/dist/validation/validate-sampler-output.d.ts +0 -38
- package/dist/validation/validate-sampler-output.d.ts.map +0 -1
- package/dist/validation/validate-sampler-output.js +0 -288
- package/dist/validation/validate-sampler-output.js.map +0 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type HttpTestCase, type ThymianHttpTransaction } from '@thymian/core';
|
|
2
|
+
import type { Selector } from '../selectors/selector.js';
|
|
3
|
+
/**
|
|
4
|
+
* The record `sampler check` renders and `--json` emits.
|
|
5
|
+
*
|
|
6
|
+
* Beside the commands rather than among them: everything under
|
|
7
|
+
* `cli/commands/` is scanned by oclif as a command, and a module that is not
|
|
8
|
+
* one is reported as a missing command on every single run.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* What one Transaction earned. Exactly one, always — a run that ends leaves no
|
|
12
|
+
* Transaction unaccounted for.
|
|
13
|
+
*
|
|
14
|
+
* - `passed` — executed, and answered as described.
|
|
15
|
+
* - `failed` — executed, and the response was invalid.
|
|
16
|
+
* - `skipped` — could not be executed *as described*: its Seed was answered
|
|
17
|
+
* differently, or the description does not supply a value the request needs.
|
|
18
|
+
* - `errored` — the attempt itself broke.
|
|
19
|
+
*
|
|
20
|
+
* The line between `skipped` and `failed` is the one worth holding. A
|
|
21
|
+
* transaction whose precondition never happened has told us nothing about the
|
|
22
|
+
* API, and rendering it as a failure is what turned one upstream problem into a
|
|
23
|
+
* wall of unrelated red.
|
|
24
|
+
*/
|
|
25
|
+
export type Outcome = 'passed' | 'failed' | 'skipped' | 'errored';
|
|
26
|
+
/** One Transaction's result — and the documented shape `--json` emits. */
|
|
27
|
+
export type CheckedTransaction = {
|
|
28
|
+
selector: Selector;
|
|
29
|
+
outcome: Outcome;
|
|
30
|
+
expectedStatus: number;
|
|
31
|
+
actualStatus?: number;
|
|
32
|
+
/** Why it is not `passed`. Printed once, under the header. */
|
|
33
|
+
reason?: string;
|
|
34
|
+
/** The Seed whose own answer explains this outcome, when there is one. */
|
|
35
|
+
causedBy?: Selector;
|
|
36
|
+
/** Remediation, as whoever raised the problem wrote it. */
|
|
37
|
+
details: string[];
|
|
38
|
+
};
|
|
39
|
+
export type CheckSummary = {
|
|
40
|
+
passed: number;
|
|
41
|
+
failed: number;
|
|
42
|
+
skipped: number;
|
|
43
|
+
errored: number;
|
|
44
|
+
total: number;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* What `sampler check --json` prints: one document, the whole run.
|
|
48
|
+
*
|
|
49
|
+
* The stable machine contract. `details` is deliberately not part of it — it is
|
|
50
|
+
* remediation prose for a reader, and `reason` already names the cause an agent
|
|
51
|
+
* has to act on.
|
|
52
|
+
*/
|
|
53
|
+
export type CheckReport = {
|
|
54
|
+
summary: CheckSummary;
|
|
55
|
+
transactions: Array<Omit<CheckedTransaction, 'details'>>;
|
|
56
|
+
};
|
|
57
|
+
export declare function reportOf(checked: readonly CheckedTransaction[]): CheckReport;
|
|
58
|
+
/**
|
|
59
|
+
* The outcome of a Transaction whose pipeline ran to a conclusion.
|
|
60
|
+
*
|
|
61
|
+
* `passed` is the pipeline's own verdict. Everything else is re-read here,
|
|
62
|
+
* because the pipeline has one axis (did the test case fail?) and this has two:
|
|
63
|
+
* whether the transaction ran, and whether something upstream is why it did
|
|
64
|
+
* not.
|
|
65
|
+
*/
|
|
66
|
+
export declare function checkedFromTestCase(testCase: HttpTestCase, transaction: ThymianHttpTransaction): CheckedTransaction;
|
|
67
|
+
/**
|
|
68
|
+
* The outcome of a Transaction whose attempt threw.
|
|
69
|
+
*
|
|
70
|
+
* A request that could not be built from the description is a Transaction that
|
|
71
|
+
* cannot be executed *as described* — a skip. Anything else that throws broke
|
|
72
|
+
* the attempt itself, which is what `errored` is for: a hook defect, a refused
|
|
73
|
+
* connection, a body that will not serialize.
|
|
74
|
+
*/
|
|
75
|
+
export declare function checkedFromError(error: unknown, transaction: ThymianHttpTransaction): CheckedTransaction;
|
|
76
|
+
/**
|
|
77
|
+
* The outcome of a declared Transaction `sampler check` never attempts.
|
|
78
|
+
*
|
|
79
|
+
* A 3xx or 5xx response is declared but not executable as a check: there is
|
|
80
|
+
* nothing to assert against a redirect target the description does not name,
|
|
81
|
+
* and a 5xx is the server's own failure mode, not a claim about the API. Both
|
|
82
|
+
* are still declared Transactions, so they earn an Outcome of their own —
|
|
83
|
+
* `skipped`, with a reason, rather than disappearing from the report and
|
|
84
|
+
* leaving the totals silently short of what the description promises.
|
|
85
|
+
*/
|
|
86
|
+
export declare function checkedAsUncheckable(transaction: ThymianHttpTransaction): CheckedTransaction;
|
|
87
|
+
export declare function summaryOf(checked: readonly CheckedTransaction[]): CheckSummary;
|
|
88
|
+
//# sourceMappingURL=check-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-result.d.ts","sourceRoot":"","sources":["../../src/cli/check-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EAGjB,KAAK,sBAAsB,EAE5B,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;;;;GAMG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAElE,0EAA0E;AAC1E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,YAAY,CAAC;IACtB,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC,CAAC;CAC1D,CAAC;AAEF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,WAAW,CAW5E;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,sBAAsB,GAClC,kBAAkB,CAmCpB;AAUD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,sBAAsB,GAClC,kBAAkB,CAQpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,sBAAsB,GAClC,kBAAkB,CAQpB;AAED,wBAAgB,SAAS,CACvB,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,YAAY,CAWd"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { errorSuggestions, isRequestSerializationError, thymianHttpTransactionToString, } from '@thymian/core';
|
|
2
|
+
export function reportOf(checked) {
|
|
3
|
+
return {
|
|
4
|
+
summary: summaryOf(checked),
|
|
5
|
+
transactions: checked.map((result) => {
|
|
6
|
+
const document = { ...result };
|
|
7
|
+
delete document.details;
|
|
8
|
+
return document;
|
|
9
|
+
}),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The outcome of a Transaction whose pipeline ran to a conclusion.
|
|
14
|
+
*
|
|
15
|
+
* `passed` is the pipeline's own verdict. Everything else is re-read here,
|
|
16
|
+
* because the pipeline has one axis (did the test case fail?) and this has two:
|
|
17
|
+
* whether the transaction ran, and whether something upstream is why it did
|
|
18
|
+
* not.
|
|
19
|
+
*/
|
|
20
|
+
export function checkedFromTestCase(testCase, transaction) {
|
|
21
|
+
const actualStatus = testCase.steps[0]?.transactions[0]?.response?.statusCode;
|
|
22
|
+
const seed = seedAnomaly(testCase, transaction);
|
|
23
|
+
const outcome = testCase.status === 'passed'
|
|
24
|
+
? 'passed'
|
|
25
|
+
: // `failed` means the transaction executed and its own response was
|
|
26
|
+
// invalid — explicitly, per `utils.fail(...)`, or because the
|
|
27
|
+
// pipeline's own validation rejected it (#48). That verdict is never
|
|
28
|
+
// second-guessed: a seed anomaly recorded earlier in the same case
|
|
29
|
+
// does not explain *this* transaction's response, so it must not
|
|
30
|
+
// downgrade an explicit failure into a skip. Only when the pipeline
|
|
31
|
+
// did *not* call it failed does a seed anomaly get to say why —
|
|
32
|
+
// a transaction whose precondition never happened was not executed
|
|
33
|
+
// as described.
|
|
34
|
+
testCase.status === 'failed'
|
|
35
|
+
? 'failed'
|
|
36
|
+
: 'skipped';
|
|
37
|
+
const details = detailsOf(testCase);
|
|
38
|
+
return {
|
|
39
|
+
selector: selectorOf(transaction),
|
|
40
|
+
expectedStatus: transaction.thymianRes.statusCode,
|
|
41
|
+
...(actualStatus === undefined ? {} : { actualStatus }),
|
|
42
|
+
outcome,
|
|
43
|
+
// Anything that is not `passed` says why, always: the documented `--json`
|
|
44
|
+
// contract promises a `reason` for it, and a consumer should never have to
|
|
45
|
+
// handle a failure that came with no sentence. A case that failed without
|
|
46
|
+
// one hands over its first detail rather than repeating it below.
|
|
47
|
+
...(outcome === 'passed'
|
|
48
|
+
? {}
|
|
49
|
+
: { reason: testCase.reason || details.shift() || FALLBACK[outcome] }),
|
|
50
|
+
...(seed ? { causedBy: seed } : {}),
|
|
51
|
+
details,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** Last resort, for a pipeline verdict that arrived with nothing said. */
|
|
55
|
+
const FALLBACK = {
|
|
56
|
+
passed: '',
|
|
57
|
+
failed: 'The response did not match the description.',
|
|
58
|
+
skipped: 'This transaction could not be executed as described.',
|
|
59
|
+
errored: 'The attempt broke.',
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The outcome of a Transaction whose attempt threw.
|
|
63
|
+
*
|
|
64
|
+
* A request that could not be built from the description is a Transaction that
|
|
65
|
+
* cannot be executed *as described* — a skip. Anything else that throws broke
|
|
66
|
+
* the attempt itself, which is what `errored` is for: a hook defect, a refused
|
|
67
|
+
* connection, a body that will not serialize.
|
|
68
|
+
*/
|
|
69
|
+
export function checkedFromError(error, transaction) {
|
|
70
|
+
return {
|
|
71
|
+
selector: selectorOf(transaction),
|
|
72
|
+
expectedStatus: transaction.thymianRes.statusCode,
|
|
73
|
+
outcome: isRequestSerializationError(error) ? 'skipped' : 'errored',
|
|
74
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
75
|
+
details: errorSuggestions(error),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The outcome of a declared Transaction `sampler check` never attempts.
|
|
80
|
+
*
|
|
81
|
+
* A 3xx or 5xx response is declared but not executable as a check: there is
|
|
82
|
+
* nothing to assert against a redirect target the description does not name,
|
|
83
|
+
* and a 5xx is the server's own failure mode, not a claim about the API. Both
|
|
84
|
+
* are still declared Transactions, so they earn an Outcome of their own —
|
|
85
|
+
* `skipped`, with a reason, rather than disappearing from the report and
|
|
86
|
+
* leaving the totals silently short of what the description promises.
|
|
87
|
+
*/
|
|
88
|
+
export function checkedAsUncheckable(transaction) {
|
|
89
|
+
return {
|
|
90
|
+
selector: selectorOf(transaction),
|
|
91
|
+
expectedStatus: transaction.thymianRes.statusCode,
|
|
92
|
+
outcome: 'skipped',
|
|
93
|
+
reason: 'only 2xx and 4xx responses are checkable',
|
|
94
|
+
details: [],
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export function summaryOf(checked) {
|
|
98
|
+
const count = (outcome) => checked.filter((result) => result.outcome === outcome).length;
|
|
99
|
+
return {
|
|
100
|
+
passed: count('passed'),
|
|
101
|
+
failed: count('failed'),
|
|
102
|
+
skipped: count('skipped'),
|
|
103
|
+
errored: count('errored'),
|
|
104
|
+
total: checked.length,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function selectorOf(transaction) {
|
|
108
|
+
return thymianHttpTransactionToString(transaction.thymianReq, transaction.thymianRes);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The Seed that explains this outcome: an `invalid-transaction` result carrying
|
|
112
|
+
* a transaction other than the one being checked.
|
|
113
|
+
*
|
|
114
|
+
* Recorded by the hook runner when a `utils.request` call is answered with
|
|
115
|
+
* something other than what its Selector named — the only place that knows a
|
|
116
|
+
* nested request happened at all.
|
|
117
|
+
*/
|
|
118
|
+
function seedAnomaly(testCase, checked) {
|
|
119
|
+
for (const result of testCase.results) {
|
|
120
|
+
if (result.type !== 'invalid-transaction' || !result.transaction) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (result.transaction.transactionId === checked.transactionId) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
return selectorOf(result.transaction);
|
|
127
|
+
}
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Everything worth printing under the header, each sentence once.
|
|
132
|
+
*
|
|
133
|
+
* The case's `reason` is printed by the caller, and every result that merely
|
|
134
|
+
* repeats it is dropped: a status mismatch arrives twice — once as the reason
|
|
135
|
+
* and once as the `invalid-transaction` result it was derived from — which is
|
|
136
|
+
* how one sentence ended up on two consecutive lines.
|
|
137
|
+
*/
|
|
138
|
+
function detailsOf(testCase) {
|
|
139
|
+
const seen = new Set([testCase.reason ?? '']);
|
|
140
|
+
const details = [];
|
|
141
|
+
for (const result of testCase.results) {
|
|
142
|
+
for (const line of linesOf(result)) {
|
|
143
|
+
if (line && !seen.has(line)) {
|
|
144
|
+
seen.add(line);
|
|
145
|
+
details.push(line);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return details;
|
|
150
|
+
}
|
|
151
|
+
function linesOf(result) {
|
|
152
|
+
if (result.type === 'assertion-failure') {
|
|
153
|
+
return [result.message];
|
|
154
|
+
}
|
|
155
|
+
if (result.type === 'invalid-transaction') {
|
|
156
|
+
return [result.message, result.details ?? ''];
|
|
157
|
+
}
|
|
158
|
+
return [];
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=check-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-result.js","sourceRoot":"","sources":["../../src/cli/check-result.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAGhB,2BAA2B,EAE3B,8BAA8B,GAC/B,MAAM,eAAe,CAAC;AA+DvB,MAAM,UAAU,QAAQ,CAAC,OAAsC;IAC7D,OAAO;QACL,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC;QAC3B,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACnC,MAAM,QAAQ,GAAG,EAAE,GAAG,MAAM,EAAiC,CAAC;YAE9D,OAAO,QAAQ,CAAC,OAAO,CAAC;YAExB,OAAO,QAA+C,CAAC;QACzD,CAAC,CAAC;KACH,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAsB,EACtB,WAAmC;IAEnC,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC;IAC9E,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAChD,MAAM,OAAO,GACX,QAAQ,CAAC,MAAM,KAAK,QAAQ;QAC1B,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,mEAAmE;YACnE,8DAA8D;YAC9D,qEAAqE;YACrE,mEAAmE;YACnE,iEAAiE;YACjE,oEAAoE;YACpE,gEAAgE;YAChE,mEAAmE;YACnE,gBAAgB;YAChB,QAAQ,CAAC,MAAM,KAAK,QAAQ;gBAC5B,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,SAAS,CA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AAC,WAAW,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,SAAS,CAAC,QAAsB;IACvC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAS,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;IACtD,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtC,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACnC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,OAAO,CAAC,MAA0B;IACzC,IAAI,MAAM,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACxC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,qBAAqB,EAAE,CAAC;QAC1C,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -1,16 +1,44 @@
|
|
|
1
1
|
import { BaseCliRunCommand, oclif } from '@thymian/common-cli';
|
|
2
|
+
import { type CheckReport } from '../../check-result.js';
|
|
2
3
|
export default class Check extends BaseCliRunCommand<typeof Check> {
|
|
4
|
+
static enableJsonFlag: boolean;
|
|
3
5
|
static description: string;
|
|
4
6
|
static examples: string[];
|
|
5
7
|
static flags: {
|
|
6
8
|
incremental: oclif.Interfaces.BooleanFlag<boolean>;
|
|
7
9
|
"target-url": oclif.Interfaces.OptionFlag<string | undefined, oclif.Interfaces.CustomOptions>;
|
|
8
10
|
};
|
|
9
|
-
run(): Promise<
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
run(): Promise<CheckReport>;
|
|
12
|
+
/**
|
|
13
|
+
* Run one Transaction and say what it earned.
|
|
14
|
+
*
|
|
15
|
+
* The `try` is the whole point of the outcome model. A hook defect, a request
|
|
16
|
+
* that cannot be serialized or a refused connection used to reject the
|
|
17
|
+
* pipeline's observable and abort the command, so one broken transaction hid
|
|
18
|
+
* every transaction after it. Here it ends that transaction and nothing else.
|
|
19
|
+
*/
|
|
20
|
+
private checkTransaction;
|
|
21
|
+
/** One line per transaction, then its reason once, then its remediation. */
|
|
22
|
+
private report;
|
|
23
|
+
/** The tally. */
|
|
24
|
+
private summarize;
|
|
25
|
+
/**
|
|
26
|
+
* Non-zero iff any Transaction is not `passed`.
|
|
27
|
+
*
|
|
28
|
+
* `process.exitCode` rather than `this.exit()`: an early exit throws past the
|
|
29
|
+
* run's teardown, and teardown is where the user's `afterAll` cleanups live.
|
|
30
|
+
* The command finishes, and then the shell learns how it went.
|
|
31
|
+
*/
|
|
32
|
+
private setExitCode;
|
|
33
|
+
/**
|
|
34
|
+
* Whether a declared Transaction is one `sampler check` can actually run.
|
|
35
|
+
*
|
|
36
|
+
* A 3xx or 5xx Transaction is still declared and still counted — it earns
|
|
37
|
+
* `checkedAsUncheckable`'s `skipped` Outcome instead of a real attempt — so
|
|
38
|
+
* every declared Transaction is accounted for, per the check-outcomes
|
|
39
|
+
* contract, without sending a request nothing can assert against.
|
|
40
|
+
*/
|
|
12
41
|
private isCheckableTransaction;
|
|
13
42
|
private runTransaction;
|
|
14
|
-
private logFailureDetails;
|
|
15
43
|
}
|
|
16
44
|
//# sourceMappingURL=check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/sampler/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/sampler/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAe/D,OAAO,EAKL,KAAK,WAAW,EAIjB,MAAM,uBAAuB,CAAC;AAc/B,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,iBAAiB,CAAC,OAAO,KAAK,CAAC;IAChE,OAAgB,cAAc,UAAQ;IAEtC,OAAgB,WAAW,SACoD;IAE/E,OAAgB,QAAQ,WAKtB;IAEF,OAAgB,KAAK;;;MAWnB;IAEa,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;IAoE1C;;;;;;;OAOG;YACW,gBAAgB;IA+B9B,4EAA4E;IAC5E,OAAO,CAAC,MAAM;IAyBd,iBAAiB;IACjB,OAAO,CAAC,SAAS;IA2BjB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAMnB;;;;;;;OAOG;IACH,OAAO,CAAC,sBAAsB;YAahB,cAAc;CA0B7B"}
|
|
@@ -1,136 +1,174 @@
|
|
|
1
|
-
import { BaseCliRunCommand, oclif
|
|
1
|
+
import { BaseCliRunCommand, oclif } from '@thymian/common-cli';
|
|
2
2
|
import { Flags } from '@thymian/common-cli/oclif';
|
|
3
|
-
import { filterHttpTransactions, generateRequests, httpTest,
|
|
3
|
+
import { filterHttpTransactions, generateRequests, httpTest, mapToTestCase, runRequests, thymianHttpTransactionToString, } from '@thymian/core';
|
|
4
|
+
import { selectorForTransaction } from '../../../selectors/selector.js';
|
|
5
|
+
import { checkedAsUncheckable, checkedFromError, checkedFromTestCase, reportOf, summaryOf, } from '../../check-result.js';
|
|
4
6
|
import { createContext } from '../../create-context.js';
|
|
7
|
+
/** One glyph per Outcome, so four states read as four states. */
|
|
8
|
+
const MARKS = {
|
|
9
|
+
passed: { mark: '✔', color: 'green' },
|
|
10
|
+
failed: { mark: '✖', color: 'red' },
|
|
11
|
+
skipped: { mark: '↷', color: 'yellow' },
|
|
12
|
+
errored: { mark: '!', color: 'red' },
|
|
13
|
+
};
|
|
5
14
|
export default class Check extends BaseCliRunCommand {
|
|
15
|
+
static enableJsonFlag = true;
|
|
6
16
|
static description = 'Verify that all sampled transactions can be executed against the live API.';
|
|
7
17
|
static examples = [
|
|
8
18
|
'<%= config.bin %> <%= command.id %>',
|
|
9
19
|
'<%= config.bin %> <%= command.id %> --target-url http://localhost:8080',
|
|
10
20
|
'<%= config.bin %> <%= command.id %> --incremental',
|
|
21
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
11
22
|
];
|
|
12
23
|
static flags = {
|
|
13
24
|
incremental: Flags.boolean({
|
|
14
25
|
allowNo: true,
|
|
15
26
|
default: false,
|
|
16
|
-
description: '
|
|
27
|
+
description: 'After each transaction that is not passed, print how to shape it with a hook.',
|
|
17
28
|
}),
|
|
18
29
|
['target-url']: Flags.string({
|
|
19
30
|
description: 'Override the target URL for all check requests. When set, all requests are sent to this origin instead of the servers defined in the specification.',
|
|
20
31
|
}),
|
|
21
32
|
};
|
|
22
33
|
async run() {
|
|
23
|
-
await this.thymian.run(async (emitter) => {
|
|
34
|
+
return await this.thymian.run(async (emitter) => {
|
|
24
35
|
const specifications = this.thymianConfig.specifications ?? [];
|
|
25
36
|
const format = await this.thymian.loadFormat({
|
|
26
37
|
inputs: specifications,
|
|
27
38
|
validateSpecs: this.flags['validate-specs'],
|
|
28
39
|
});
|
|
29
|
-
const transactions = format.getThymianHttpTransactions();
|
|
30
40
|
const targetUrl = this.flags['target-url'] ?? this.thymianConfig.targetUrl;
|
|
31
41
|
const context = createContext(format, this.logger.child('sampler-check'), emitter);
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
const checked = [];
|
|
43
|
+
/**
|
|
44
|
+
* A diagnostic at `error` severity closes the run out from under this
|
|
45
|
+
* loop, and nothing tells the loop.
|
|
46
|
+
*
|
|
47
|
+
* `Thymian.run` closes and rejects on the first such diagnostic, but the
|
|
48
|
+
* callback it is running keeps going — so the loop sent the rest of its
|
|
49
|
+
* requests against a closed run and printed its summary *above* the
|
|
50
|
+
* error trailer. Per-transaction faults are `warn` and never land here;
|
|
51
|
+
* anything that does is the run itself ending.
|
|
52
|
+
*/
|
|
53
|
+
let runEnded = false;
|
|
54
|
+
const errors = emitter.onError((event) => {
|
|
55
|
+
runEnded ||= event.error.options.severity === 'error';
|
|
56
|
+
});
|
|
57
|
+
try {
|
|
58
|
+
for (const transaction of format.getThymianHttpTransactions()) {
|
|
59
|
+
if (runEnded) {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
const result = this.isCheckableTransaction(transaction)
|
|
63
|
+
? await this.checkTransaction(transaction, context, targetUrl)
|
|
64
|
+
: checkedAsUncheckable(transaction);
|
|
65
|
+
checked.push(result);
|
|
66
|
+
if (!this.jsonEnabled()) {
|
|
67
|
+
this.report(result);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
finally {
|
|
72
|
+
errors.unsubscribe();
|
|
73
|
+
}
|
|
74
|
+
// The exit code is the same contract either way; only the rendering
|
|
75
|
+
// differs, and under `--json` there is none — oclif prints the returned
|
|
76
|
+
// document, and the feedback tip suppresses itself.
|
|
77
|
+
if (this.jsonEnabled()) {
|
|
78
|
+
this.setExitCode(checked);
|
|
34
79
|
}
|
|
35
80
|
else {
|
|
36
|
-
|
|
81
|
+
this.summarize(checked);
|
|
37
82
|
}
|
|
83
|
+
return reportOf(checked);
|
|
38
84
|
});
|
|
39
85
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Run one Transaction and say what it earned.
|
|
88
|
+
*
|
|
89
|
+
* The `try` is the whole point of the outcome model. A hook defect, a request
|
|
90
|
+
* that cannot be serialized or a refused connection used to reject the
|
|
91
|
+
* pipeline's observable and abort the command, so one broken transaction hid
|
|
92
|
+
* every transaction after it. Here it ends that transaction and nothing else.
|
|
93
|
+
*/
|
|
94
|
+
async checkTransaction(transaction, context, targetUrl) {
|
|
95
|
+
this.logger.debug('Checking transaction: ' + selectorForTransaction(transaction));
|
|
96
|
+
try {
|
|
49
97
|
const testResult = await this.runTransaction(transaction, context, targetUrl);
|
|
50
98
|
const testCase = testResult.cases[0];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
this.log(oclif.ux.colorize('red', `✖ ${transactionName}`));
|
|
57
|
-
this.logFailureDetails(testCase);
|
|
58
|
-
this.log();
|
|
59
|
-
failed++;
|
|
60
|
-
}
|
|
99
|
+
return testCase
|
|
100
|
+
? checkedFromTestCase(testCase, transaction)
|
|
101
|
+
: checkedFromError(new Error('The test pipeline produced no result for this transaction.'), transaction);
|
|
61
102
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this.log(`Checked ${successful + failed} transactions. ${oclif.ux.colorize('red', `${failed} failed`)}.`);
|
|
65
|
-
this.exit(1);
|
|
103
|
+
catch (e) {
|
|
104
|
+
return checkedFromError(e, transaction);
|
|
66
105
|
}
|
|
67
|
-
|
|
68
|
-
|
|
106
|
+
}
|
|
107
|
+
/** One line per transaction, then its reason once, then its remediation. */
|
|
108
|
+
report(result) {
|
|
109
|
+
const { mark, color } = MARKS[result.outcome];
|
|
110
|
+
this.log(oclif.ux.colorize(color, `${mark} ${result.selector}`));
|
|
111
|
+
if (result.outcome === 'passed') {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
for (const line of [result.reason, ...result.details].filter(Boolean)) {
|
|
115
|
+
this.log(oclif.ux.colorize('dim', ` ${line}`));
|
|
116
|
+
}
|
|
117
|
+
if (this.flags.incremental) {
|
|
118
|
+
this.log(oclif.ux.colorize('dim', ' Shape this request by anchoring a hook to its selector, printed above.'));
|
|
69
119
|
}
|
|
120
|
+
this.log();
|
|
70
121
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const testResult = await this.runTransaction(transaction, context, targetUrl);
|
|
79
|
-
const testCase = testResult.cases[0];
|
|
80
|
-
if (testCase && testCase.status === 'passed') {
|
|
81
|
-
this.log(oclif.ux.colorize('green', `✔ ${transactionName}`));
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
this.log(oclif.ux.colorize('red', `✖ ${transactionName}`));
|
|
85
|
-
this.logFailureDetails(testCase);
|
|
86
|
-
this.log();
|
|
87
|
-
this.log('You can generate a hook for this transaction with:');
|
|
88
|
-
this.log(` $ thymian sampler generate hook --for-transaction ${transaction.transactionId}`);
|
|
89
|
-
this.log();
|
|
90
|
-
if (!this.config.findCommand('sampler generate hook')) {
|
|
91
|
-
this.debug('Command sampler generate hook is not available. Skipping hook generation prompt.');
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
const answer = await prompts.confirm({
|
|
95
|
-
message: 'Do you want to generate a hook to fix this transaction?',
|
|
96
|
-
default: false,
|
|
97
|
-
});
|
|
98
|
-
if (answer) {
|
|
99
|
-
await this.config.runCommand('sampler generate hook', [
|
|
100
|
-
'--for-transaction',
|
|
101
|
-
transaction.transactionId,
|
|
102
|
-
'--cwd',
|
|
103
|
-
this.flags.cwd,
|
|
104
|
-
...(this.flags.config ? ['-c', this.flags.config] : []),
|
|
105
|
-
]);
|
|
106
|
-
}
|
|
122
|
+
/** The tally. */
|
|
123
|
+
summarize(checked) {
|
|
124
|
+
const summary = summaryOf(checked);
|
|
125
|
+
this.log();
|
|
126
|
+
if (summary.passed === summary.total) {
|
|
127
|
+
this.log(oclif.ux.colorize('green', `Checked ${summary.total} transactions. All passed.`));
|
|
128
|
+
return;
|
|
107
129
|
}
|
|
130
|
+
const tally = ['failed', 'skipped', 'errored']
|
|
131
|
+
.filter((outcome) => summary[outcome] > 0)
|
|
132
|
+
.map((outcome) => `${summary[outcome]} ${outcome}`);
|
|
133
|
+
this.log(`Checked ${summary.total} transactions: ${summary.passed} passed, ${tally.join(', ')}.`);
|
|
134
|
+
this.setExitCode(checked);
|
|
108
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Non-zero iff any Transaction is not `passed`.
|
|
138
|
+
*
|
|
139
|
+
* `process.exitCode` rather than `this.exit()`: an early exit throws past the
|
|
140
|
+
* run's teardown, and teardown is where the user's `afterAll` cleanups live.
|
|
141
|
+
* The command finishes, and then the shell learns how it went.
|
|
142
|
+
*/
|
|
143
|
+
setExitCode(checked) {
|
|
144
|
+
if (checked.some((result) => result.outcome !== 'passed')) {
|
|
145
|
+
process.exitCode = 1;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Whether a declared Transaction is one `sampler check` can actually run.
|
|
150
|
+
*
|
|
151
|
+
* A 3xx or 5xx Transaction is still declared and still counted — it earns
|
|
152
|
+
* `checkedAsUncheckable`'s `skipped` Outcome instead of a real attempt — so
|
|
153
|
+
* every declared Transaction is accounted for, per the check-outcomes
|
|
154
|
+
* contract, without sending a request nothing can assert against.
|
|
155
|
+
*/
|
|
109
156
|
isCheckableTransaction(transaction) {
|
|
110
|
-
|
|
111
|
-
|
|
157
|
+
// By first digit, not by the registered-code lists.
|
|
158
|
+
//
|
|
159
|
+
// A description may declare a status IANA never registered — `499` is the
|
|
160
|
+
// common one — and the lists answer "no" for it, so the transaction was
|
|
161
|
+
// reported `skipped` as uncheckable although it is a 4xx. What decides
|
|
162
|
+
// checkability is whether a response can be asserted against at all,
|
|
163
|
+
// which is a property of the class.
|
|
164
|
+
const status = transaction.thymianRes.statusCode;
|
|
165
|
+
return (status >= 200 && status < 300) || (status >= 400 && status < 500);
|
|
112
166
|
}
|
|
113
167
|
async runTransaction(transaction, context, targetUrl) {
|
|
114
|
-
const transactionName = thymianHttpTransactionToString(transaction.thymianReq, transaction.thymianRes);
|
|
115
168
|
const reqFilter = (_req, reqId) => reqId === transaction.thymianReqId;
|
|
116
169
|
const resFilter = (_res, resId) => resId === transaction.thymianResId;
|
|
117
|
-
const test = httpTest(
|
|
170
|
+
const test = httpTest(thymianHttpTransactionToString(transaction.thymianReq, transaction.thymianRes), (transactions) => transactions.pipe(filterHttpTransactions(reqFilter, resFilter), mapToTestCase(), generateRequests(), runRequests({ checkResponse: false, origin: targetUrl })));
|
|
118
171
|
return test(context);
|
|
119
172
|
}
|
|
120
|
-
logFailureDetails(testCase) {
|
|
121
|
-
if (!testCase) {
|
|
122
|
-
this.log(oclif.ux.colorize('dim', ' Reason: No test result.'));
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
if (testCase.reason) {
|
|
126
|
-
this.log(oclif.ux.colorize('dim', ` Reason: ${testCase.reason}`));
|
|
127
|
-
}
|
|
128
|
-
for (const result of testCase.results) {
|
|
129
|
-
if (result.type === 'assertion-failure' ||
|
|
130
|
-
result.type === 'invalid-transaction') {
|
|
131
|
-
this.log(oclif.ux.colorize('dim', ` ${result.message}`));
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
173
|
}
|
|
136
174
|
//# sourceMappingURL=check.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../../src/cli/commands/sampler/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../../src/cli/commands/sampler/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,QAAQ,EACR,aAAa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AE,SAAS,CAAC,EAC5C,aAAa,EAAE,EACf,gBAAgB,EAAE,EAClB,WAAW,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CACzD,CACJ,CAAC;QAEF,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { BaseCliRunCommand
|
|
1
|
+
import { BaseCliRunCommand } from '@thymian/common-cli';
|
|
2
2
|
export default class Init extends BaseCliRunCommand<typeof Init> {
|
|
3
|
+
static enableJsonFlag: boolean;
|
|
3
4
|
static description: string;
|
|
4
|
-
static
|
|
5
|
-
|
|
6
|
-
check: oclif.Interfaces.BooleanFlag<boolean>;
|
|
7
|
-
};
|
|
8
|
-
run(): Promise<void>;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
run(): Promise<unknown>;
|
|
9
7
|
}
|
|
10
8
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/sampler/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/sampler/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAS,MAAM,qBAAqB,CAAC;AAI/D,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,iBAAiB,CAAC,OAAO,IAAI,CAAC;IAC9D,OAAgB,cAAc,UAAQ;IAEtC,OAAgB,WAAW,SAC6E;IAExG,OAAgB,QAAQ,WAA2C;IAEpD,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAoDvC"}
|