π§ͺ Testing
xunit, inside the mesh.
An in-mesh Test/*.cs is compiled by Roslyn inside a portal, and a portal image ships no xunit.
meshweaver.azurecr.io/memex-portal-ai:mainβ zero files matchingxunit.- The pinned
mw-plugin-testCI image β zero too (5747 entries scanned).
Measured 2026-09-01, with docker export | tar -t | grep -i xunit. So using Xunit; in a NodeType's
test source is CS0246 today β and a NodeType that does not compile parks, taking every hub of
that type with it. That is why the mesh test vocabulary has been hand-rolled throw statements
rather than a choice.
Installing this package fixes that, with no compiler change and no image bloat. The in-mesh compile reference set is already composed as the platform baseline plus this mesh's installed modules, so an installed module's types are referenceable from in-mesh source by construction. A deployment that does not install this pays nothing β no bytes, no boot cost, no surface.
What you may write once it is installed
using Xunit;
public class TariffTests
{
[Fact]
public void ARateIsNeverNegative() => Assert.True(Tariff.Rate("CH") >= 0);
[Theory]
[InlineData("CH")]
[InlineData("DE")]
public void EveryRegionHasARate(string region) => Assert.InRange(Tariff.Rate(region), 0, 1);
}
It also carries MeshWeaver.Testing.TestContext, SkipException and TestLog β the per-case shim
the mw-plugin-test build lane already offers, moved into an assembly a portal has. Its own
README called that move "the prerequisite for using it there".
β± Install, then RESTART β this one is not optional
Every installed module joins the compile reference set at boot, inside
MeshBuilder.InstallAssemblies, which the platform calls "boot-only by construction". Installing
this package on a running portal lands its bytes; they activate at the next boot. Until then
using Xunit; still does not compile, and nothing says why.
So: install β restart β then land the NodeTypes whose tests use xunit. Doing it in one step fails the provisioning compile gate of any package that depends on this one.
Declaring it
A package whose in-mesh tests use xunit must declare it:
"requires": ["Store@^1.0.0", "Testing@^1.0.0"]
A missing dependency does not error β it hangs, for the full 60s SubscribeRequest timeout, and
nothing in the failure says "missing dependency".