@sun-asterisk/sungen 3.2.12-beta.3 → 3.2.12-beta.5
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.
|
@@ -85,12 +85,15 @@ This is the core discipline: *common is never enough; when blind, think and ask
|
|
|
85
85
|
## Customizing the catalog — `.overwrite` (survives `sungen update`)
|
|
86
86
|
|
|
87
87
|
The shipped `common/` is a floor. Project rules go in `qa/data-factory/common.overwrite.yaml`,
|
|
88
|
-
deep-merged over the common (**later-wins**, keyed by `type` + data-point `id`)
|
|
89
|
-
new `id` appends,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
`
|
|
93
|
-
|
|
88
|
+
deep-merged over the common (**later-wins**, keyed by `type` + data-point `id`) via three explicit
|
|
89
|
+
operations: **EXTEND** (a new `id` appends), **REPLACE** (same `id` wins; `constraints` merge
|
|
90
|
+
key-by-key), **DISABLE** (list ids under `disable:` to drop shipped cases that don't apply — a stale
|
|
91
|
+
target id warns). You can also override `security:` banks and `techniques:` the same way. `sungen
|
|
92
|
+
update` refreshes `common/` but never touches your overlay; a stale entry **warns you to prune it** —
|
|
93
|
+
it never edits your file. Nothing is silently overwritten: **`sungen data provenance`** (and a
|
|
94
|
+
`⟲ .overwrite →` line at `data gen`) shows exactly what your overlay changed, and each overlaid value
|
|
95
|
+
is tagged `via: .overwrite` in the test-data. Prefer a targeted `errorMap`/`constraints` in the
|
|
96
|
+
field-map for per-screen tweaks; use `.overwrite` only for rules that apply project-wide.
|
|
94
97
|
|
|
95
98
|
## Bulk-import fixtures (CSV)
|
|
96
99
|
|
|
@@ -117,6 +120,14 @@ constraints and every synthesized `invalid` value actually violates them. A boun
|
|
|
117
120
|
a constraint — fix the field-map/constraints and re-run. This is what stops the "structurally right but
|
|
118
121
|
semantically wrong" data (e.g. a "below minimum length" case that is actually long enough to pass).
|
|
119
122
|
|
|
123
|
+
**Applicability & profiles.** The generator only emits cases that apply, and reports the rest (never
|
|
124
|
+
silent). Set **`required: true|false`** correctly — an optional field drops the "empty (required)" case;
|
|
125
|
+
a numeric field with `min ≥ 0` drops the negative example. Security/injection payloads land in their own
|
|
126
|
+
**`adversarial:`** bucket, separate from `invalid:`. Dropped cases show up as `_not_applicable` in the
|
|
127
|
+
output + a `NOT_APPLICABLE` lint info. A `--profile` (`regression` default · `functional` · `smoke` ·
|
|
128
|
+
`security-min`) and `--locale`/`--channel`/`--sink` on `data gen|validate|lint` select a reduced set;
|
|
129
|
+
selection is deterministic. Prefer setting `required` in the field-map over disabling the empty case.
|
|
130
|
+
|
|
120
131
|
## Weaving into scenarios
|
|
121
132
|
|
|
122
133
|
When a `.feature` exists, express invalid/boundary sets as data-driven `Scenario Outline` + `Examples`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sun-asterisk/sungen",
|
|
3
|
-
"version": "3.2.12-beta.
|
|
3
|
+
"version": "3.2.12-beta.5",
|
|
4
4
|
"description": "Deterministic E2E Test Compiler - Gherkin + Selectors → Playwright tests",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@babel/types": "^7.28.5",
|
|
40
40
|
"@cucumber/gherkin": "^37.0.0",
|
|
41
41
|
"@cucumber/messages": "^31.0.0",
|
|
42
|
-
"@sungen/driver-data-factory": "3.2.12-beta.
|
|
43
|
-
"@sungen/driver-ui": "3.2.12-beta.
|
|
42
|
+
"@sungen/driver-data-factory": "3.2.12-beta.5",
|
|
43
|
+
"@sungen/driver-ui": "3.2.12-beta.5",
|
|
44
44
|
"chalk": "^5.6.2",
|
|
45
45
|
"commander": "^14.0.2",
|
|
46
46
|
"dotenv": "^17.2.3",
|
|
@@ -85,12 +85,15 @@ This is the core discipline: *common is never enough; when blind, think and ask
|
|
|
85
85
|
## Customizing the catalog — `.overwrite` (survives `sungen update`)
|
|
86
86
|
|
|
87
87
|
The shipped `common/` is a floor. Project rules go in `qa/data-factory/common.overwrite.yaml`,
|
|
88
|
-
deep-merged over the common (**later-wins**, keyed by `type` + data-point `id`)
|
|
89
|
-
new `id` appends,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
`
|
|
93
|
-
|
|
88
|
+
deep-merged over the common (**later-wins**, keyed by `type` + data-point `id`) via three explicit
|
|
89
|
+
operations: **EXTEND** (a new `id` appends), **REPLACE** (same `id` wins; `constraints` merge
|
|
90
|
+
key-by-key), **DISABLE** (list ids under `disable:` to drop shipped cases that don't apply — a stale
|
|
91
|
+
target id warns). You can also override `security:` banks and `techniques:` the same way. `sungen
|
|
92
|
+
update` refreshes `common/` but never touches your overlay; a stale entry **warns you to prune it** —
|
|
93
|
+
it never edits your file. Nothing is silently overwritten: **`sungen data provenance`** (and a
|
|
94
|
+
`⟲ .overwrite →` line at `data gen`) shows exactly what your overlay changed, and each overlaid value
|
|
95
|
+
is tagged `via: .overwrite` in the test-data. Prefer a targeted `errorMap`/`constraints` in the
|
|
96
|
+
field-map for per-screen tweaks; use `.overwrite` only for rules that apply project-wide.
|
|
94
97
|
|
|
95
98
|
## Bulk-import fixtures (CSV)
|
|
96
99
|
|
|
@@ -117,6 +120,14 @@ constraints and every synthesized `invalid` value actually violates them. A boun
|
|
|
117
120
|
a constraint — fix the field-map/constraints and re-run. This is what stops the "structurally right but
|
|
118
121
|
semantically wrong" data (e.g. a "below minimum length" case that is actually long enough to pass).
|
|
119
122
|
|
|
123
|
+
**Applicability & profiles.** The generator only emits cases that apply, and reports the rest (never
|
|
124
|
+
silent). Set **`required: true|false`** correctly — an optional field drops the "empty (required)" case;
|
|
125
|
+
a numeric field with `min ≥ 0` drops the negative example. Security/injection payloads land in their own
|
|
126
|
+
**`adversarial:`** bucket, separate from `invalid:`. Dropped cases show up as `_not_applicable` in the
|
|
127
|
+
output + a `NOT_APPLICABLE` lint info. A `--profile` (`regression` default · `functional` · `smoke` ·
|
|
128
|
+
`security-min`) and `--locale`/`--channel`/`--sink` on `data gen|validate|lint` select a reduced set;
|
|
129
|
+
selection is deterministic. Prefer setting `required` in the field-map over disabling the empty case.
|
|
130
|
+
|
|
120
131
|
## Weaving into scenarios
|
|
121
132
|
|
|
122
133
|
When a `.feature` exists, express invalid/boundary sets as data-driven `Scenario Outline` + `Examples`
|