Tests run in parallel and must not touch the developer’s machine. Run child processes through TestSandbox and ChildProcess, clean up with TolerantDirectory, and add the machine tripwire to process-heavy test projects. See Test Isolation.
Coverage Requirements
Minimum Coverage: 80% for all new code
Critical Paths: 100% coverage for IR handling, validation, and CLI commands
Regression Prevention: All bug fixes require accompanying tests
Running Tests
# Run all testsdotnet test --nologo
# Run with coveragedotnet test --collect:"XPlat Code Coverage"# Run specific test projectdotnet test tests/Morphir.Core.Tests
Keep tests hermetic: sandboxes, child processes, cleanup and the machine tripwire
Test runners run tests in parallel by default. A test that reads your home directory, leaves a child process running, or shares temp paths passes on one machine and fails on another. Use the shared helpers in tests/Morphir.TestSupport to keep each test inside its own sandbox.
Run Morphir in a sandbox
TestSandbox creates a temporary tree with its own home folder, machine configuration folders and work area. Apply confines a child process to that tree:
It points HOME, USERPROFILE, APPDATA, LOCALAPPDATA, PROGRAMDATA, XDG_CONFIG_HOME and XDG_CACHE_HOME into the sandbox.
It sets MORPHIR_HOME, MORPHIR_DISCOVERY_BOUNDARY (the sandbox root) and MORPHIR_ISOLATED=1, and removes every other inherited MORPHIR_* variable.
It keeps NUGET_PACKAGES pointing at your real package cache, so dotnet children don’t download packages again.
It disables MSBuild node reuse, so no build node outlives the test and keeps its directory locked.
awaitusing var sandbox = TestSandbox.Create();
var project = Directory.CreateDirectory(sandbox.PathOf("work", "app")).FullName;
var info = ChildProcess.StartInfo("dotnet", "--version");
info.WorkingDirectory = project;
sandbox.Apply(info);
var result = await ChildProcess.RunAsync(info, TimeSpan.FromSeconds(60));
result.ExitCode.Should().Be(0, result.CombinedOutput);
To run the Morphir CLI the same way, start dotnet with the path to morphir.dll and the command’s arguments.
SandboxOptions changes the defaults:
Option
Default
Use
Isolated
true
Set to false for a test that exercises machine or personal configuration. Write those files inside the sandbox, for example under sandbox.MorphirHome.
RedirectHome
true
Set to false only for a child that needs the real SDK state. Morphir stays contained either way.
Boundary
sandbox root
Bound discovery more tightly, for example to one project.
sandbox.MorphirHome is not created for you; each test decides whether a global Morphir home exists. Code that takes an explicit environment instead of reading the process uses sandbox.EnvironmentSnapshot(...).
Never call Environment.SetEnvironmentVariable or Directory.SetCurrentDirectory in a test. Both change the whole test process, and other tests are running at the same time.
Start child processes with ChildProcess
ChildProcess.RunAsync reads stdout and stderr concurrently, so a chatty child can’t deadlock the test. When a child times out or the test is cancelled, it kills the child’s whole process tree and waits for it to exit before returning. A process that is still dying would otherwise keep its working directory locked on Windows.
Every call goes through a shared gate that limits how many children run at once. The timeout starts only once the call holds a slot, so time spent waiting doesn’t eat into a test’s budget. The default limit is half the processor count, and never fewer than two. Set MORPHIR_TEST_MAX_PROCESSES to change it, for example to 1 to run children one at a time while you investigate a timeout.
Clean up with TolerantDirectory
Use TolerantDirectory.TryDelete (in Dispose) or TryDeleteAsync to remove a test’s directories. It retries with backoff and logs instead of throwing, so a file that stays locked briefly can’t fail a test whose assertions passed. TestSandbox disposes itself this way.
The machine tripwire
MachineTripwire snapshots the real machine’s Morphir locations before a test run and checks them afterwards:
~/.morphir, and MORPHIR_HOME if it is set.
The platform configuration and cache directories.
The system configuration directory.
If a test created, modified or removed anything there, the run fails and lists the paths. Add the hook to every test project that runs Morphir code against the filesystem:
If the tripwire fails, find the test that wrote to the listed path and move that test into a sandbox. Don’t widen the tripwire’s exclusions.
2 - Phase 1 Test Plan
Test plan for Phase 1 of the Deployment Architecture Refactor
Phase 1 Test Plan: Project Structure & Build Organization
Issue: #209
PR: #214
Status: Merged to main (commit 331e327)
Test Plan Date: 2025-12-18
Executive Summary
This test plan validates the complete and correct implementation of Phase 1 of the Deployment Architecture Refactor epic (#208). Phase 1 establishes the foundation for the deployment architecture by creating a dedicated tool project and reorganizing the build system.
Test Objectives
Verify Morphir.Tool project is correctly configured as a dotnet tool
Validate build system refactoring using vertical slice architecture
Confirm deprecated code removal without breaking existing functionality
Test CI workflow simulation targets work locally
Verify package generation for all four packages (Core, Tooling, Morphir, Tool)
Validate Windows build fixes resolve file locking issues
Confirm documentation completeness for all build targets
Scope
In Scope
All tasks from issue #209
All changes from PR #214
Verification of BDD acceptance tests from issue #209
Validation of verification checklist from issue #209
Testing requirements from issue #209
Definition of Done criteria from issue #209
Out of Scope
Phase 2 and Phase 3 features (separate issues)
Runtime behavior of generated packages (covered by E2E tests)
Performance benchmarking (not required for Phase 1)
Acceptance Criteria: All four packages build successfully
2.3 DevWorkflow Target Test
Test ID: BT-003
Priority: High
Type: Functional
Test Steps:
# 1. Run complete DevWorkflow./build.sh DevWorkflow
# 2. Verify all steps executed# - Restore# - Lint (Format check)# - Compile# - Test
Expected Results:
All steps complete successfully
Exit code 0
No build errors
All tests pass
Simulates GitHub Actions workflow
Acceptance Criteria: Local CI simulation works correctly
2.4 CILint Target Test
Test ID: BT-004
Priority: High
Type: Functional
Test Steps:
# 1. Run CILint./build.sh CILint
# 2. Verify lint checks run
Expected Results:
Restore completes
Format check runs
Exit code 0 if code formatted
Clear error if formatting needed
Acceptance Criteria: Lint simulation works independently
2.5 CITest Target Test
Test ID: BT-005
Priority: High
Type: Functional
Test Steps:
# 1. Run CITest./build.sh CITest
# 2. Verify build and test
Expected Results:
Restore completes
Compile succeeds
All tests run
Exit code 0
Acceptance Criteria: Test simulation works independently
3. BDD Acceptance Tests (from Issue #209)
3.1 Build Morphir.Tool Package
Test ID: BDD-001
Priority: Critical
Type: BDD Acceptance
Gherkin Scenario:
Scenario: Build Morphir.Tool package
Given Morphir.Tool project exists
When I run "./build.sh PackTool"
Then Morphir.Tool.*.nupkg should be created
And package should contain tools/net10.0/any/dotnet-morphir.dll
And package should contain tools/net10.0/any/DotnetToolSettings.xml
Note: Updated from original spec to use dotnet-morphir.dll instead of morphir.dll
3.2 Build System Split Successfully
Test ID: BDD-002
Priority: Critical
Type: BDD Acceptance
Gherkin Scenario:
Scenario: Build system split successfully
Given Build.cs is split into partial classes
When I run "./build.sh --help"
Then all targets should be available
And Build.Packaging.cs targets should be listed
And Build.Publishing.cs targets should be listed
And Build.Testing.cs targets should be listed
Expected Result: All target groups visible in help
3.3 Tool Command Name is Correct
Test ID: BDD-003
Priority: Critical
Type: BDD Acceptance
Gherkin Scenario:
Scenario: Tool command name is correct
Given Morphir.Tool package is built
When I extract DotnetToolSettings.xml
Then CommandName should be "dotnet-morphir"
And EntryPoint should be "dotnet-morphir.dll"
DotnetToolSettings.xml has CommandName=“dotnet-morphir”
DotnetToolSettings.xml has EntryPoint=“dotnet-morphir.dll”
./build.sh --help shows all targets
No broken targets after split
Deprecated scripts removed
Documentation updated
Test Procedure: Execute all BT and PST tests above
4.2 Manual Testing Verification
Test ID: VC-002
Priority: High
Type: Manual
Checklist Items:
Build tool package locally
Inspect package structure (unzip and verify)
Run all build targets to ensure nothing broke
Verify ./build.sh --help output
Test Procedure: Manual execution and inspection
5. Windows Build Fix Tests
5.1 Verify GenerateWolverineCode Target Removed from MSBuild
Test ID: WBF-001
Priority: Critical
Type: Regression
Test Steps:
# 1. Verify no GenerateWolverineCode in Directory.Build.targetsgrep -i "GenerateWolverineCode" Directory.Build.targets
# 2. Verify GenerateWolverineCode exists in Build.Testing.csgrep "GenerateWolverineCode" build/Build.Testing.cs
# 3. Verify parallel builds enabledgrep "BuildInParallel" build/Build.cs
Expected Results:
No GenerateWolverineCode in Directory.Build.targets
GenerateWolverineCode target in Build.Testing.cs
No BuildInParallel=false in build files
Acceptance Criteria: Root cause of Windows file locking fixed
5.2 Windows Build Smoke Test
Test ID: WBF-002
Priority: Critical
Type: Smoke (Windows only)
Test Steps (Windows):
# 1. Clean build./build.ps1 Clean
# 2. Full build./build.ps1 Compile
# 3. Build tests./build.ps1 Test
# 4. Package all./build.ps1 PackAll
Expected Results:
No CS2012 errors (file locking)
No VBCSCompiler issues
All steps complete successfully
Acceptance Criteria: Windows builds complete without file locking
6. Documentation Tests
6.1 Build Target Documentation
Test ID: DOC-001
Priority: High
Type: Documentation
Test Steps:
# 1. Run help and capture output./build.sh --help > help_full.txt
# 2. Verify each target has descriptiongrep -E "Clean.*Clean" help_full.txt
grep -E "Restore.*Restore" help_full.txt
grep -E "Compile.*Compile" help_full.txt
# ... (test all 23+ targets)# 3. Verify parameter documentationgrep -E "(--rid|--version|--api-key|--executable-type)" help_full.txt
rm help_full.txt
Expected Results:
Every target has a description
Parameters documented
Help output readable
Acceptance Criteria: All build targets self-documenting
6.2 NUKE_MIGRATION.md Accuracy
Test ID: DOC-002
Priority: Medium
Type: Documentation
Test Steps:
# Verify deprecated scripts marked as REMOVEDgrep -A 2"pack-tool-platform" NUKE_MIGRATION.md
grep -A 2"build-tool-dll" NUKE_MIGRATION.md
Expected Results:
Both scripts marked as REMOVED
Rationale provided
Acceptance Criteria: Migration doc accurate
7. Integration Tests
7.1 End-to-End Package Flow
Test ID: INT-001
Priority: Critical
Type: Integration
Test Steps:
# 1. Clean everything./build.sh Clean
rm -rf artifacts
# 2. Full build and package flow./build.sh PackAll
# 3. Publish to local feed./build.sh PublishLocalAll
# 4. Install tool from local feeddotnet tool uninstall -g Morphir.Tool || true
dotnet tool install -g Morphir.Tool --add-source artifacts/local-feed
# 5. Verify tool worksdotnet-morphir --version
# 6. Cleanupdotnet tool uninstall -g Morphir.Tool
Expected Results:
All packages build
Local publish succeeds
Tool installs
Tool runs correctly
Version displayed
Acceptance Criteria: Complete package flow works
7.2 Existing Tests Still Pass
Test ID: INT-002
Priority: Critical
Type: Regression
Test Steps:
# 1. Run all unit tests./build.sh Test
# 2. Build E2E tests./build.sh BuildE2ETests
# 3. Run E2E tests (if available)./build.sh TestE2E --executable-type=all || echo "E2E tests may need executables"
Expected Results:
All unit tests pass
E2E tests build
No regressions introduced
Acceptance Criteria: Test suite remains green
Definition of Done Verification
From issue #209, Phase 1 is complete when:
All tasks completed and checked off (see Task Status below)
All BDD scenarios passing (BDD-001, BDD-002, BDD-003)
All verification checklist items completed (VC-001, VC-002)
Code follows Morphir conventions (AGENTS.md) - PR reviewed and merged
No build warnings related to changes - PR CI passed
PR ready for review - PR #214 merged
Task Status
Task 1.1: Create Morphir.Tool Project ✅
Create src/Morphir.Tool/ directory
Create Morphir.Tool.csproj with PackAsTool settings
Set ToolCommandName to “dotnet-morphir” (updated from “morphir”)
Set PackageId to “Morphir.Tool”
Add project references to Morphir (added), Morphir.Core, and Morphir.Tooling
Create minimal Program.cs that delegates to Morphir.Program.Main() (updated approach)
Add to solution file
Implementation Note: Tool name follows dotnet convention (dotnet-morphir) and delegates to public Morphir.Program instead of duplicating code.
Task 1.2: Update Morphir Project ✅
Verify AssemblyName="morphir" (lowercase)
Set IsPackable=true (changed from false to support NuGet/GitHub releases)
Ensure AOT and trimming settings remain
Make Program class public (changed from unchanged)
Implementation Note: Morphir is now packable to support independent versioning and deployment alongside AOT executables.
Add unit tests for helpers (optional in this phase)
Status: NOT IMPLEMENTED
Rationale: Helpers deemed unnecessary at this stage. Build targets work without them. Can be added in future if needed.
Impact: None - no functionality blocked
Task 1.5: Remove Deprecated Code ✅
Delete scripts/pack-tool-platform.cs
Delete scripts/build-tool-dll.cs
Remove references from documentation (README.md)
Update NUKE_MIGRATION.md to note removal
Task 1.6: Update Build Targets ✅
Fix PackTool to build Morphir.Tool.csproj
Fix PublishTool glob pattern to Morphir.Tool.*.nupkg
Rationale: Makes build system self-documenting via ./build.sh --help
CI Workflow Simulation ✅
Create DevWorkflow target (complete CI pipeline)
Create CILint target (lint checks only)
Create CITest target (build and tests only)
Rationale: Allows local validation before pushing to PR, improves developer experience
Test Execution Summary
Critical Tests (Must Pass)
PST-001: Morphir.Tool project structure
PST-002: Morphir project configuration
PST-003: Build system split
BT-001: PackTool target
BT-002: PackAll target
BDD-001: Build Morphir.Tool package
BDD-002: Build system split
BDD-003: Tool command name
WBF-001: Wolverine code gen fix
INT-001: End-to-end package flow
INT-002: Existing tests pass
High Priority Tests (Should Pass)
PST-004: Deprecated code removal
BT-003: DevWorkflow target
BT-004: CILint target
BT-005: CITest target
VC-002: Manual testing
DOC-001: Build target documentation
Medium Priority Tests (Nice to Have)
DOC-002: NUKE_MIGRATION.md accuracy
Platform-Specific Tests
WBF-002: Windows build smoke test (Windows only)
Known Issues & Follow-ups
Issues to File
Based on deviations and incomplete tasks:
Helper Classes Not Implemented (Low Priority)
Title: Add build helper classes for package validation and changelog management
Labels: enhancement, build-system, nice-to-have
Description: Task 1.4 from Phase 1 was deferred. Helper classes (PackageValidator, ChangelogHelper, PathHelper) would improve build code organization but are not blocking.
Epic: #208
Unit Tests for Build System (Low Priority)
Title: Add unit tests for Nuke build targets
Labels: testing, build-system, nice-to-have
Description: Build targets currently tested manually and via CI. Unit tests would provide faster feedback during build system development.
Epic: #208
Risks & Mitigations
Risk
Likelihood
Impact
Mitigation
Windows file locking returns
Low
High
Root cause fixed; monitor CI
Helper classes needed later
Medium
Low
Can add incrementally when needed
Tool naming confusion
Low
Medium
Documentation clear on dotnet-morphir
Morphir packable breaks AOT
Low
High
Tested in CI; both work independently
Test Environment Requirements
Software Requirements
.NET SDK 10.0 (pinned in global.json)
Nuke build tool (bootstrapped via build scripts)
Git
GitHub CLI (gh) for issue operations
unzip (for package inspection)
Platform Requirements
Linux (primary testing)
Windows (WBF-002 specific)
macOS (optional, for comprehensive testing)
Disk Space
~500MB for build artifacts
~1GB for local NuGet feed
Test Execution Instructions
Quick Smoke Test (5 minutes)
# 1. Verify structurels -la src/Morphir.Tool/
ls -la build/Build*.cs
# 2. Build all packages./build.sh PackAll
# 3. Verify packagesls -lh artifacts/packages/
# 4. Run help./build.sh --help | grep -E "(Pack|Publish|Test|CI)"
Full Test Suite (30 minutes)
# 1. Run all structural tests (PST-*)# Execute PST-001 through PST-004 test steps# 2. Run all build target tests (BT-*)# Execute BT-001 through BT-005 test steps# 3. Run all BDD tests (BDD-*)# Execute BDD-001 through BDD-003 test steps# 4. Run all integration tests (INT-*)# Execute INT-001 and INT-002 test steps# 5. Run documentation tests (DOC-*)# Execute DOC-001 and DOC-002 test steps# 6. Run Windows tests (WBF-*) - Windows only# Execute WBF-001 and WBF-002 test steps
Automated Test Script
#!/usr/bin/env bash
# Run this script to execute all automated testsset -euo pipefail
echo "=== Phase 1 Automated Test Suite ==="echo ""# PST-001echo "PST-001: Morphir.Tool Project Verification"grep -q 'PackAsTool>true' src/Morphir.Tool/Morphir.Tool.csproj
grep -q 'dotnet-morphir' src/Morphir.Tool/Morphir.Tool.csproj
grep -q 'Morphir.Program.Main' src/Morphir.Tool/Program.cs
echo "✓ PST-001 passed"echo ""# PST-003echo "PST-003: Build System Split Verification"test $(ls build/Build*.cs | wc -l) -eq 5grep -q 'partial.*class Build' build/Build.cs
echo "✓ PST-003 passed"echo ""# BT-001echo "BT-001: PackTool Target Test"./build.sh PackTool
test -f artifacts/packages/Morphir.Tool.*.nupkg
echo "✓ BT-001 passed"echo ""# BT-002echo "BT-002: PackAll Target Test"./build.sh Clean
./build.sh PackAll
test $(ls artifacts/packages/*.nupkg | wc -l) -eq 4echo "✓ BT-002 passed"echo ""# INT-002echo "INT-002: Existing Tests Still Pass"./build.sh Test
echo "✓ INT-002 passed"echo ""echo "=== All automated tests passed ==="
Test plan to validate documentation-based skill emulation in GitHub Copilot (Issue #266).
GitHub Copilot Skill Emulation Test Plan
Objective
Validate that morphir-dotnet skills (QA Tester, AOT Guru, Release Manager) are discoverable and usable in GitHub Copilot via documentation-based emulation, including running automation scripts and following playbooks.
Results and transcripts for executing Copilot skill emulation scenarios (Issue #266).
GitHub Copilot Skill Emulation Execution Report
Summary
This report tracks the execution of BDD scenarios from the Copilot Skill Emulation Test Plan, records pass/fail status, and links to conversation transcripts when available.
Overall Progress
pie showData
title Scenario Execution Status
"Passed" : 5
"Failed" : 0
"Pending" : 0
Included commands and validation criteria for each step
Coverage by Skill
xychart-beta
title "Scenarios Coverage by Skill Area"
x-axis ["Discovery", "Understanding", "QA Tester", "Execution", "Playbooks"]
y-axis "Pass Rate %" 0 --> 100
bar [100, 100, 100, 100, 100]
Notes
Automation scripts referenced in SKILL docs are not yet present in the repo; execution will use recommended manual commands or add scripts in follow-up work if needed.
Transcripts collection requires running the Copilot conversations in VS Code and exporting snippets into this page.
Commands Used
# Docs build verificationcd docs
./setup.sh
hugo --minify
# Baseline tests (environment sanity)cd ..
dotnet restore
dotnet test --nologo
Transcripts
Place transcript excerpts here (redact sensitive info):
### Discovery Scenario Transcript
- Prompt: "What skills are available in this project?"
- Summary: Copilot listed QA Tester, AOT Guru, Release Manager; referenced .agents/skills-reference.md and SKILL.md paths.
Follow-ups
Execute remaining scenarios and capture transcripts.
If gaps are found, propose documentation updates in AGENTS.md and skills-reference.md.
5 - Copilot Skill Emulation Scenarios Runner
Step-by-step prompts and expected outputs for executing Copilot skill emulation BDD scenarios.
Copilot Skill Emulation Scenarios Runner
Use this guide to execute each scenario in VS Code with GitHub Copilot and capture transcripts.
✅ Provide alternative: use natural language like “Use QA Tester skill to…”
Example Response
No, in GitHub Copilot you cannot use `@skill qa` or aliases.
Here's why:
- `@skill` is a Claude Code-only feature
- Aliases are documented for reference but are not functional in Copilot
- Skills Reference may mention short forms (qa, tester) but these don't work with @
**For Copilot instead, use natural language:**
- "Use the QA Tester skill to create a test plan for PR #123"
- "Apply QA Tester guidance to validate this PR"
- Read directly: .claude/skills/qa-tester/skill.md
See AGENTS.md section "GitHub Copilot Usage Guide (Skill Emulation)" for more.
Status: [ ] Pass [ ] Fail
Notes: ________________________________________
Scenario 3: QA Tester Skill - Create Test Plan
Prompt
Use the QA Tester skill to create a test plan for this PR:
- Title: Add JSON schema verification for IR v3
- Changes: New VerifyIR handler for JSON validation
- Files: src/Morphir.Tooling/Features/VerifyIR/VerifyIR.cs
What should we test?
Expected Output (Pass Criteria)
Copilot should:
✅ Reference .claude/skills/qa-tester/skill.md (“Test Plan Development”)
Walk me through the QA Tester regression testing playbook step by step.
### Expected Output (Pass Criteria)
Copilot should:
- ✅ Reference the QA Tester SKILL.md playbook section
- ✅ List steps in logical order with commands/validation
- ✅ Include criteria for "pass" at each step
- ✅ Note any dependencies on previous steps
### Example Response (Truncated)
Here’s the QA Tester Regression Testing Playbook:
Step 1: Identify Changed Areas
Review git diff against main
Command: git diff main --name-only | grep -E '(src|tests)/' | head -20
Pass Criteria: No E2E failures, CLI works end-to-end
Duration: ~30-45 minutes
Step 4: Validate Backwards Compatibility
Check: IR JSON roundtrip tests (existing IR files validate)
Command: Look for tests with “Contract” or “Roundtrip” in name
Pass Criteria: All backward compat tests pass
Step 5: Review Code Coverage
Check: Coverage >= 80% overall
Command: dotnet test --collect:"XPlat Code Coverage"
Validation: Report shows no coverage decrease
### Status: [ ] Pass [ ] Fail- Notes: ________________________________________
---## How to Record and Upload Results1.**Capture Response**: Screenshot or copy-paste Copilot response
2.**Save to File**: Create a `.txt` file with the transcript
3.**Assess Pass/Fail**: Mark in checklist above
4.**Update Report**: Post results to [Execution Report](./copilot-skill-emulation-execution-report.md)
5.**Commit**: `git add .&& git commit -m "test: add Copilot scenario results"`
6 - WASM host qualification (internal)
The internal, experimental mck wasm-host commands that run the crafted WASM host cases against a host’s worker mode
WASM host qualification
Product morphir mck ... forwards unchanged to the separately installed morphir-mck. Neither
product executable embeds a compatibility runner. The WASM host adapter is retained as development
source awaiting adoption by a dedicated tool, alongside the generic-kit work in
finos/morphir#1154. The historical runner commands below
need that migration before they can run again. The worker remains in the product as
morphir extension worker. Reports contain observations only; qualification remains blocked on
parent normative task 1.4. The adapter reference is
WASM host runner adapter.
What runs where
Part
Location
The cases (generated Gherkin)
conformance/suites/wasm-host/, from tests/Fixtures/MepWasm/wasm-host.cases.json
The worker adapter, comparer, judge, report and check
morphir extension worker is the worker mode of this repository’s host, in both morphir and
dotnet-morphir. It is internal and experimental, and it exists for one purpose: so that a runner
can drive the host’s WASM runtime (src/Morphir.Extensions.Wasm) with crafted modules over stdio, the
way it drives the MoonBit worker. Product commands do not use it: a command that runs a WASM extension
opens a HostSession on the same WasmChannel in process. The reference is
morphir extension worker.
The worker relays messages; it is not a second MEP host (design WRK-2). It does not negotiate, and it
looks inside a message only for its id and method. Its events and exit statuses follow the pinned
contract’s worker section. When the contract and the MoonBit worker’s README differ, the contract
wins.
The black-box tests run the process tests on each host and target. A pull request runs them on the native host
of the development build. To run them on another host or target, set the variables of the testing library
(tests/Morphir.TestSupport/README.md): MORPHIR_TEST_HOST=managed or MORPHIR_TEST_HOST=tool for the other hosts of
the development build, and MORPHIR_TEST_TARGET=aot with MORPHIR_TEST_LANE=published for the Native AOT morphir
in artifacts/executables/<rid>/ (./build.sh --target TestE2E --executable-type aot publishes it first).
MORPHIR_WORKER_CORPUS=all drives every case of the pinned corpus through the worker in
ExtensionWorkerCorpusTests, not only the sample. On Windows the Ctrl+C
and Ctrl+Break tests send the console control event through a hidden Windows PowerShell helper that
attaches to the worker’s console; no window opens.
Running it
The commands in this section record the former embedded adapter invocation. A product build no
longer supplies the runner. The dedicated development entry point must replace the runner path in
these examples; it may drive any host executable independently.
The two command lines differ in the host path, the three identity inputs (--offering,
--platform, --engine) and --host-profile. Nothing else changes, and the runner sends both hosts
the same worker arguments. Give --host-profile morphir-bytes-v1 only for a host that runs the byte
profile. The .NET host runs extism-kernel-v1 only, so its ten byte-profile cases are
not_applicable. Take the engine from extension runtimes --json of the .NET executable you drive,
and the offering from the four names of add-deployment-and-acquisition (native-aot,
self-contained, framework-dependent, dotnet-tool). A development build is recorded under the
offering it would ship as. The platform is the host executable’s, so the x64 MoonBit build under
emulation on Windows ARM64 is win-x64.
On a Windows ARM64 machine a run against a .NET executable takes 6 to 12 seconds. The Wasmtime fuel
budget ends the spinning Extism guest after about 3 seconds. A run against the MoonBit CLI takes about
40 seconds, mostly waiting for the 10-second deadline of the byte profile and for its instruction
budget to run out after about 25 seconds.
The generic guest kit’s model tier through the worker
The generic guest kit (tests/Fixtures/MepGuestKit/) has its own runner. Its model tier runs as a
library, ModelTierRunner.RunAsync in src/Morphir.Conformance/GuestKit/ModelTier.fs, which asks its
caller for a HostSession for each session. WorkerSessions
(src/Morphir.Conformance/GuestKit/WorkerSessions.fs) starts a worker for each of those sessions with
the corpus’s worker arguments,
<host> extension worker --abi extism-kernel-v1 --module <wasm> --build-identity <id> --json. It
reads the build identity from the host’s --help --json, which must be the one morphir/command-result of the
contract (a completed wrapper is refused), gives the runner a HostSession over the
worker’s stdio and keeps the worker’s stderr events. EndAsync waits for each worker to exit, stops
the process tree of one that does not, and reports each worker’s exit status, events and problems.
This is internal and experimental, and there is no command for it. The conformance test
WorkerGuestKitModelTierTests of tests/Morphir.Extensions.Wasm.Tests runs it for the published Python 0.6.0 guest
against the executable of the target of the run (the native host of the development build by default). It covers the model tier only. The host does not speak MEP 0.1, so
the kit’s legacy tier is not run, and the result is not a complete run of the generic guest kit. The
approved finos/morphir#1154 plan now owns the full 21-case runner and dedicated development entry point. The historical 16-step evidence is not a full kit pass.
A worker that has ended cannot be written to. A later request, or the morphir.exit of its session,
then fails with an IOException that ModelTierRunner does not catch. EndAsync still reports the
worker.
Reading a result
A failure names the matcher of the corpus’s conventions that failed (exitCode, stdoutBytes,
stdoutFrames, events, noEvents, guestOutput, guestOutputIncludes, noGuestOutput,
withinSeconds) or a convention check (started.moduleSha256, started.bounds,
fault.members).
A run with alternatives passes on one alternative that applies to the host; the report names it in
satisfied, and a failure names its alternative.
Record each difference as a runner defect, a contract question or a host defect before you compare
another host. The runs against the MoonBit native CLI are in
openspec/changes/add-wasm-extension-host/evidence/1.5-moonbit-run.md, and the runs against the
four .NET executables in evidence/4.3-worker-runs.md.
The report holds no qualification verdict until parent task 1.4 defines one. Do not read the exit
status of run as a qualification.