31 lines
1.4 KiB
Markdown
31 lines
1.4 KiB
Markdown
|
|
# EVOLV cross-node test harness
|
||
|
|
|
||
|
|
This folder hosts end-to-end tests that wire **multiple** EVOLV domain
|
||
|
|
classes together the same way Node-RED would, but in pure Node.js so the
|
||
|
|
simulation runs deterministically and every internal value is inspectable.
|
||
|
|
|
||
|
|
**Scope rule.** Tests that exercise a single node's behaviour live in that
|
||
|
|
node's submodule under `nodes/<name>/test/`. Tests here cross node
|
||
|
|
boundaries — they instantiate `pumpingStation` + `machineGroupControl` +
|
||
|
|
multiple `rotatingMachine`s together and drive the wired graph.
|
||
|
|
|
||
|
|
Examples of what belongs where:
|
||
|
|
|
||
|
|
| Concern | Lives in |
|
||
|
|
|---|---|
|
||
|
|
| MGC optimizer combination choice for a given demand | `nodes/machineGroupControl/test/integration/optimizer-combination-choice.integration.test.js` |
|
||
|
|
| Pump curve interpolation across head values | `nodes/rotatingMachine/test/integration/...` |
|
||
|
|
| PS hysteresis logic with mocked groups | `nodes/pumpingStation/test/integration/shifted-ramp-end-to-end.test.js` |
|
||
|
|
| **Whole plant**: PS basin level + MGC dispatch + 3 pumps + physics simulator | `test/end-to-end-pumpingstation.test.js` (this folder) |
|
||
|
|
|
||
|
|
Run:
|
||
|
|
|
||
|
|
```
|
||
|
|
node --test test/end-to-end-pumpingstation.test.js
|
||
|
|
```
|
||
|
|
|
||
|
|
The harness in `lib/wiring.js` builds the parent-child relationships
|
||
|
|
Node-RED would build via `registerChild`, lets you advance a controllable
|
||
|
|
clock, and `lib/recorder.js` records every measurement / state / demand
|
||
|
|
event into a flat trace.
|