Skip to content

Commit c4e4ebe

Browse files
committed
docs: add §19 ELK diagram test cases to nanoflow test plan
1 parent badf908 commit c4e4ebe

1 file changed

Lines changed: 62 additions & 1 deletion

File tree

docs/15-testing/nanoflow-test-cases.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Nanoflow Test Cases — Manual Testing
22

3-
**Updated:** 2026-04-24
3+
**Updated:** 2026-04-28
44
**PR:** [retran/mxcli#10](https://github.com/retran/mxcli/pull/10)
55

66
## Test Projects
@@ -942,6 +942,65 @@ CREATE single nanoflow with one instance of each allowed action type (where gram
942942
943943
---
944944

945+
## 19. ELK DIAGRAM OUTPUT (CLI `--format elk`)
946+
947+
ELK (Eclipse Layout Kernel) JSON output is used by the VS Code extension to render interactive SVG diagrams for nanoflows.
948+
949+
### 19.1 Simple nanoflow — ELK JSON structure
950+
```bash
951+
mxcli describe nanoflow -p <mpr> --format elk <Module.SimpleNanoflow>
952+
```
953+
**Expected:** Valid JSON with keys: `format` (`"elk"`), `type` (`"nanoflow"`), `name`, `parameters`, `returnType`, `nodes`, `edges`, `mdlSource`, `sourceMap`. At least one start node and one end node.
954+
955+
### 19.2 Complex nanoflow — nodes and edges
956+
```bash
957+
mxcli describe nanoflow -p <mpr> --format elk <Module.ComplexNanoflow>
958+
```
959+
Use a nanoflow with 5+ activities (if/else, retrieve, call, log, etc.).
960+
**Expected:** One node per activity. Edges connect activities in correct order. Decision nodes have multiple outgoing edges. `mdlSource` contains full MDL text. `sourceMap` maps node IDs to `{startLine, endLine}`.
961+
962+
### 19.3 Empty nanoflow — minimal ELK
963+
```bash
964+
echo 'create nanoflow M.Empty () begin end;' > /tmp/elk-test.mdl
965+
mxcli exec /tmp/elk-test.mdl -p <mpr>
966+
mxcli describe nanoflow -p <mpr> --format elk M.Empty
967+
```
968+
**Expected:** Valid JSON with start node and end node only. Zero intermediate nodes. `mdlSource` shows `CREATE NANOFLOW M.Empty()`.
969+
970+
### 19.4 Nanoflow with parameters and return type
971+
```bash
972+
mxcli describe nanoflow -p <mpr> --format elk <Module.NanoflowWithParams>
973+
```
974+
**Expected:** `parameters` array in JSON lists all parameters with names and types. `returnType` populated. These fields match DESCRIBE output.
975+
976+
### 19.5 Cross-project ELK — verify on all test projects
977+
Run `--format elk` on one complex nanoflow from each test project:
978+
- EnquiriesManagement
979+
- Evora-FactoryManagement
980+
- LatoProductInventory
981+
982+
**Expected:** All produce valid JSON. Entity names in `mdlSource` resolve correctly (qualified `Module.Entity` format).
983+
984+
### 19.6 Non-existent nanoflow — error
985+
```bash
986+
mxcli describe nanoflow -p <mpr> --format elk M.DoesNotExist
987+
```
988+
**Expected:** Error message: `nanoflow not found: M.DoesNotExist`
989+
990+
### 19.7 Microflow ELK still works (no regression)
991+
```bash
992+
mxcli describe microflow -p <mpr> --format elk <Module.SomeMicroflow>
993+
```
994+
**Expected:** Valid ELK JSON, same structure as before. Confirms `buildEntityNames` refactoring did not break microflow path.
995+
996+
### 19.8 ELK source map correctness
997+
For a nanoflow with 3+ activities, verify `sourceMap` entries:
998+
- Each node ID in `nodes` has a corresponding `sourceMap` entry
999+
- `startLine` < `endLine` for multi-line activities
1000+
- Line numbers correspond to actual lines in `mdlSource`
1001+
1002+
---
1003+
9451004
## Test Project Coverage Matrix
9461005

9471006
| Category | Enquiries (79) | Evora Factory (93) | Lato Inventory (51) |
@@ -957,6 +1016,7 @@ CREATE single nanoflow with one instance of each allowed action type (where gram
9571016
| BSON data integrity (§16.5) | 10+ complex nanoflows | Same | Same |
9581017
| Security cascades (§17) | Project roles | Same | Same |
9591018
| 100+ listing (§18.8) | N/A (79) | CREATE extras to reach 100+ | N/A (51) |
1019+
| ELK diagram (§19) | Sample complex | Sample complex | Sample complex |
9601020

9611021
---
9621022

@@ -979,6 +1039,7 @@ CREATE single nanoflow with one instance of each allowed action type (where gram
9791039
| BSON parser | 5 roundtrip | Covered |
9801040
| BSON writer | 5 roundtrip | Covered |
9811041
| Diff output | None | **Gap** |
1042+
| ELK diagram | None | **Manual only** |
9821043
| Roundtrip (integration) | 3 integration | Covered |
9831044
| Multi-step workflows (§15) | None | **Manual only** |
9841045
| Failure modes (§16) | Partial | **Mostly manual** |

0 commit comments

Comments
 (0)