Skip to content

test: render-safety test for the Python pandas sample's Explorer area#469

Open
rbuergi wants to merge 1 commit into
mainfrom
test/pandas-sample
Open

test: render-safety test for the Python pandas sample's Explorer area#469
rbuergi wants to merge 1 commit into
mainfrom
test/pandas-sample

Conversation

@rbuergi

@rbuergi rbuergi commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What

Adds a render/behavior test for the Python pandas sample's C# frontend — the live-compiled Doc/DataMesh/PythonPandasNode/PandasExplorer NodeType and its Explorer layout area (PandasExplorerLayoutAreas).

New file: test/MeshWeaver.Hosting.Monolith.Test/PandasExplorerLayoutAreaTest.cs

Why

The Explorer area drives a Python py/pandas mesh participant. In prod and CI no such participant is attached, and the contract is that the reactive grid then degrades to a "No Python pandas node attached" notice within the backend timeout — it must never hang and never show a raw error. There was no C# test guarding this render-safety behavior.

How it's tested

The test renders the REAL embedded Source, not a test double. The Pandas NodeType, its two Source/*.cs files, and the LiveFrame instance all ship as embedded resources under MeshWeaver.Documentation.Data, so AddDocumentation() registers the whole Doc partition and the mesh compiles the actual production frontend live with Roslyn — mirroring the sibling CessionLayoutAreaTest.

With no py/pandas participant attached, the single test asserts:

  1. Explorer renders a StackControl composing title + intro + toolbar + grid sub-areas.
  2. The toolbar resolves to a horizontal StackControl whose named sub-areas are the real ButtonControls (load, append, groupby, rolling, describe, refresh, reset) — genuine framework controls, not an HTML string.
  3. The point: the reactive grid sub-area degrades to the "No Python pandas node attached" markdown notice. Every assertion runs under a hard wall-clock budget (Within(...)), so a genuine hang trips the bound and fails the test rather than blocking CI — the exact production hazard being guarded.

Python participant

The Python participant (clients/python/meshweaver/examples/pandas_node.py) is already covered by clients/python/tests/test_pandas_node.py (15 tests: load/append/reset/render/groupby/rolling/describe, the CSV-from-content path, the code surface, and the end-to-end demo) — all green — so no new Python test is added.

Test run

Passed MeshWeaver.Hosting.Monolith.Test.PandasExplorerLayoutAreaTest.Explorer_NoPythonNode_RendersToolbarAndDegradesGridWithoutHanging [3 s]
 Explorer root control: StackControl
 Explorer sub-areas: title, intro, toolbar, grid
 Toolbar sub-areas: load, append, groupby, groupByColumn, rolling, describe, refresh, reset
 Grid degraded to: **No Python pandas node attached.**
Passed!  - Failed: 0, Passed: 1, Skipped: 0, Total: 1

🤖 Generated with Claude Code

Adds PandasExplorerLayoutAreaTest to MeshWeaver.Hosting.Monolith.Test. It
renders the REAL live-compiled Doc/DataMesh/PythonPandasNode/PandasExplorer
NodeType (Source ships as embedded resources served by AddDocumentation, so
the mesh compiles the actual production frontend with Roslyn) and its
LiveFrame instance's Explorer area, mirroring CessionLayoutAreaTest.

Verifies the production render-safety contract when NO py/pandas participant
is attached (the default in prod/CI):
  1. Explorer renders a StackControl composing title + intro + toolbar + grid.
  2. The toolbar resolves to a Stack of real ButtonControls (load, append,
     groupby, rolling, describe, refresh, reset).
  3. THE POINT: the reactive grid DEGRADES to the "No Python pandas node
     attached" notice within the backend timeout — it never hangs and never
     shows a raw error. Every assertion runs under a hard wall-clock budget,
     so a genuine hang trips the bound and fails the test instead of blocking
     CI (the exact production hazard guarded).

The Python participant (clients/python/.../pandas_node.py) is already covered
by clients/python/tests/test_pandas_node.py (15 tests: load/append/reset/
render/groupby/rolling/describe, the CSV-from-content path, the code surface,
and the end-to-end demo), so no new Python test is added.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Test Results (shard 3)

 12 files  ±0   12 suites  ±0   4m 12s ⏱️ +6s
873 tests ±0  873 ✅ ±0  0 💤 ±0  0 ❌ ±0 
921 runs  ±0  921 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 4c53df7. ± Comparison against base commit d01fdcc.

@github-actions

Copy link
Copy Markdown

Test Results (shard 0)

889 tests  ±0   880 ✅ +1   4m 14s ⏱️ -39s
  4 suites ±0     9 💤 ±0 
  4 files   ±0     0 ❌  - 1 

Results for commit 4c53df7. ± Comparison against base commit d01fdcc.

@github-actions

Copy link
Copy Markdown

Test Results (shard 1)

496 tests  ±0   310 ✅ ±0   1m 28s ⏱️ -4s
  9 suites ±0   186 💤 ±0 
  9 files   ±0     0 ❌ ±0 

Results for commit 4c53df7. ± Comparison against base commit d01fdcc.

@github-actions

Copy link
Copy Markdown

Test Results (shard 2)

1 248 tests  ±0   1 145 ✅ ±0   4m 58s ⏱️ +13s
   11 suites ±0     103 💤 ±0 
   11 files   ±0       0 ❌ ±0 

Results for commit 4c53df7. ± Comparison against base commit d01fdcc.

@github-actions

Copy link
Copy Markdown

Test Results (shard 5)

1 252 tests  ±0   1 251 ✅ ±0   4m 53s ⏱️ -25s
   13 suites ±0       1 💤 ±0 
   13 files   ±0       0 ❌ ±0 

Results for commit 4c53df7. ± Comparison against base commit d01fdcc.

@github-actions

Copy link
Copy Markdown

Test Results (shard 4)

1 649 tests  ±0   1 647 ✅ ±0   5m 46s ⏱️ +23s
   12 suites ±0       2 💤 ±0 
   12 files   ±0       0 ❌ ±0 

Results for commit 4c53df7. ± Comparison against base commit d01fdcc.

@github-actions

Copy link
Copy Markdown

Test Results

   61 files  ±0     61 suites  ±0   25m 33s ⏱️ -27s
6 407 tests ±0  6 106 ✅ +1  301 💤 ±0  0 ❌  - 1 
6 455 runs  ±0  6 154 ✅ +1  301 💤 ±0  0 ❌  - 1 

Results for commit 4c53df7. ± Comparison against base commit d01fdcc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant