Skip to content
PixnopPublic

About

Integration-test harness for Vintage Story mods: boots a real headless server inside dotnet test and drives it from xUnit.

Topics

Resources

Contributing

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

Atlas logo: a kneeling titan carrying a cube of layered earth

Atlas

Atlas is an in-process integration-test harness for Vintage Story mods. It boots a real, headless Vintage Story server inside your dotnet test process, drives it tick by tick, and lets you write deterministic scenarios in plain C# with xUnit. No client, no window, no manual server setup: dotnet test boots the world, runs your scenarios against the live game API, and tears it down. Client-side assertions sit next to the server ones: what the server sends a test player (block highlights, particles, mod-channel packets, chat, the entities it was sent, player data, player groups) is captured and decoded as a real client would decode it. Nothing renders and no client process runs, so a mod's own client code (renderers, dialogs, hotkeys) stays out of reach.

Atlas is generic: any Vintage Story mod is testable. It has no dependency on any particular mod.

CI NuGet Quality Gate License: MIT

What scenarios can do

  • Query and mutate the live world: blocks, block entities, entities, commands (with results a scenario can assert on), all on the game thread, deterministically.

  • Advance and measure time deterministically: await World.Ticks(n) steps the embedded server on its game thread, and IWorldSession.EntitySimulationTicks, a monotonic counter of the server's real entity-simulation ticks, lets entity-tick-frequency probes assert exact counts instead of ratios.

  • Measure what a window of ticks costs the server: await World.MeasureTicks(count) runs the same wait as Ticks(n) while watching the game thread, and returns a TickMeasurement with per-pass busy time (min/median/p95/max, mean and total, excluding the engine's own pacing sleep), wall time and game-thread allocations. It cannot attribute cost to a specific mod, method or line, only to the window:

    TickMeasurement measured = await World.MeasureTicks(100);
    Assert.True(measured.BusyTime.MedianMs < 5, $"median pass grew to {measured.BusyTime.MedianMs}ms");
  • Join headless test players: real, world-present players, several per world, each with its own connection and inventory. Joined players complete the engine's own join sequence and count as Playing for server systems, so anything that filters or counts Playing players (proximity queries, playing-count broadcasts, natural spawning) sees them exactly like real clients. ITestPlayer.IsConnected reports when the server dropped one (kick, ban), so mods that kick players are testable end to end. A test player also acts: WalkTo(pos) walks it through the server's own collision pass, so Block.OnEntityCollide fires for the block in its way (a teleport never fires it) and the walk stops there, LookAt(pos) sets the block it looks at, and Mount(entity) and Dismount() seat it on a boat or a mount.

  • Assert the client side of a mod with no client process: ITestPlayer.Client captures what the server sent that player, decoded as a real client would decode it. Highlights(slot) (block highlight positions and colors, the slot's current state), Particles() (every spawn received: position, velocity, quantity, color), Packets<T>("mychannel") (mod network channel messages, decoded through the server's own channel registry) and Chat() (every chat line with its EnumChatType and group id; ChatLines() stays as a plain projection onto the message text); color-carrying records expose the raw packed Color plus a decoded Rgba in the byte order each effect actually renders with. EntityArrivals() and HasReceivedEntity(id) say which entities the server sent that player, EntityDepartures() and KnowsEntity(id) which ones it told the player are gone and which ones the client still holds, PlayerData(), GroupListings() and GroupUpdates() the player-data and player-group packets, each with the tick it arrived at (World.CurrentTick is its unit), so "an observer never receives a hidden player" and "an observer stops seeing a player hidden in the middle of a session" are assertable. UnreadPackets and UnreadBytes say how much a player that nobody reads is holding. ITestPlayer.Say(message) speaks through the real client chat packet path, so a command's reply lands in ChatLines() the way it would for a real player, readable right after the call returns. Field-validated by a real mod's thermal overlay: 54 highlighted blocks, packets, particles and command replies, asserted with zero client. Details and the usage rules on the wiki's Client-Side Testing page.

  • Assert which chunks the server streamed to a player: ITestPlayer.ChunkSends is the server's own record of the chunks and map chunks it sent that player and has not unloaded for it since. WasSentChunk(cx, cy, cz) and WasSentMapChunk(cx, cz) read it, so "this chunk went out" and "this one was unloaded again" are assertable with no client process. It is server bookkeeping, not a view of what a client holds, which is what ITestPlayer.Client is for. Details on the wiki's Client-Side Testing page.

  • Check that a mod booted clean: World.BootDiagnostics is a read-only list of every engine log entry at Warning level or above since the boot started (a malformed asset, an unresolved recipe ingredient, a mod's own startup warning), the record that used to reach only server-main.log. [AtlasWorld(StrictBootDiagnostics = true)] fails the whole class's boot instead, naming every offending entry:

    [AtlasScenario]
    public Task Mod_Should_LoadWithNoErrors()
    {
        Assert.DoesNotContain(World.BootDiagnostics, e => e.Level is EnumLogType.Error or EnumLogType.Fatal);
        return Task.CompletedTask;
    }
  • Seed data files before boot: [AtlasDataFiles] copies config fixtures into the embedded server's data path before it launches, so mods that read their config once in StartServerSide boot configured. A port the mod listens on goes in the fixture as {{atlas:port:NAME}}, which Atlas replaces with a free port per host, and World.DataFilePort("NAME") hands it to the scenario.

  • Boot against a prebuilt world save: [AtlasWorld(SaveFile = "fixtures/myworld.vcdbs")] loads a fixture world instead of generating one; every test class gets its own pristine copy, the fixture is never written to. The atlas fixture command builds the .vcdbs from an ordinary builder scenario, and IWorldSession.PlaceSchematic stamps a single prebuilt structure (a worldedit .json export) into the running world in one line.

  • Pick the world isolation each scenario needs, per scenario: FreshWorld = true recycles the host for a brand-new world (strongest isolation, one full boot); RollbackWorld = true restores the same world in place without a reboot, roughly 25x faster than a recycle, and the rollback is universal: blocks, entities, savegame data, joined test players (position, inventories, stats, per-player moddata) and every mini-dimension all return to the captured baseline, with the atlas:rollback:captured / atlas:rollback:restored event-bus hooks keeping mods' own SaveGame-keyed in-memory state in sync (VintagestoryAPI types only); RestartWorld = true restarts the server for real and carries the world over, so scenarios can assert on what survives a genuine save/load round trip (SaveGame moddata, manifests, whatever a mod writes for reload). Isolation is observable: a rollback that degrades to a full recycle reports the classified reason and cost in the scenario's own test output, a restart reports its measured cost the same way (it is paid outside the scenario's own duration), every class prints an isolation summary with the accumulated costs (also aggregated by atlas run --parallel and attached to its TRX), and StrictIsolation = true turns a silent degrade into a failure.

  • Parameterize a scenario: [AtlasTheory] with [InlineData]/[MemberData] runs one scenario per data row, xUnit-style: same settings as [AtlasScenario], applied per row, with the row's arguments in the test's display name. Contributed by Seggr, the project's first external contribution.

Quickstart

Requirements: a Vintage Story install at 1.21.0 or newer (1.20.x works best-effort, see Compatibility), the VINTAGE_STORY environment variable pointing at the Vintage Story install directory (the one holding VintagestoryLib.dll next to VintagestoryAPI.dll), and .NET 10.

  1. Create a test project with the stock xUnit template, in its own folder next to your mod's project, never inside it: Atlas goes in a separate test project, not the mod's own csproj. Always pass -n; without it dotnet new names the project after the current folder, so running it bare inside a folder called Xunit produces exactly that name. It needs xUnit v2 2.9.3 or newer, which the template gives you by default; a template from an older SDK can pin xunit lower and fail restore with NU1107 once Atlas is added. xUnit v3 (the xunit3 template, the xunit.v3.* packages) is not supported at all, and a project that pulls it in fails the build with a clear Atlas error instead of a confusing compiler one, once it targets net10.0; the xunit3 template defaults to net8.0, where a different error shows up first (see the wiki's Troubleshooting page). Name the project anything except the exact id of a package it references, case ignored (Xunit, xunit, Pixnop.Atlas, Pixnop.Atlas.XUnit...): a project's identity to NuGet is its own name, so a project named after a package it also depends on collides with itself and restore fails with NU1108: Cycle detected.
dotnet new xunit -n MyMod.Tests
cd MyMod.Tests
dotnet add package Pixnop.Atlas.XUnit

Then add the VintagestoryAPI reference by hand; nothing scaffolds it. The result targets net10.0 regardless of what your mod itself targets (net8.0 for Vintage Story 1.21): Atlas ships for net10.0 only.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="coverlet.collector" Version="6.0.4" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
    <PackageReference Include="xunit" Version="2.9.3" />
    <PackageReference Include="xunit.runner.visualstudio" Version="3.1.4" />
    <PackageReference Include="Pixnop.Atlas.XUnit" Version="0.16.1" />
  </ItemGroup>

  <ItemGroup>
    <Using Include="Xunit" />
  </ItemGroup>

  <ItemGroup>
    <!-- VintagestoryAPI is needed to compile game types (BlockPos) used in scenario bodies. -->
    <Reference Include="VintagestoryAPI">
      <HintPath>$(VINTAGE_STORY)\VintagestoryAPI.dll</HintPath>
    </Reference>
  </ItemGroup>

</Project>

The Newtonsoft.Json shadowing fix and the xUnit v3 build guard (see the wiki's Troubleshooting page) both ship inside the package as a buildTransitive target, so they apply automatically. No <Import> needed. Building Atlas itself from source instead of the NuGet package is a separate path, covered in CONTRIBUTING.md.

  1. Add the assembly-level declarations, one required and one optional:
using Atlas.XUnit;
using Xunit;

// Required: Atlas runs one embedded server per test class, so xUnit must not run classes
// in parallel.
[assembly: CollectionBehavior(DisableTestParallelization = true)]

// Optional until you have a mod to stage; a path that does not resolve fails the boot.
// Resolved relative to the test assembly's OUTPUT directory, not the source tree: see
// https://github.com/Pixnop/Atlas/wiki/Mod-Staging, and step 5 below for the
// ProjectReference-based alternative that writes this path for you.
// [assembly: AtlasMods("relative/path/to/your/mod")]
  1. Write a scenario. This one uses a vanilla block, so no mod is required to try Atlas out:
using Atlas.Api;
using Atlas.XUnit;
using System.Threading.Tasks;
using Vintagestory.API.MathTools;
using Xunit;

public class MarkerScenarios : AtlasScenarioBase
{
    [AtlasScenario]
    public async Task Chest_Should_BePlaceable_When_WorldIsReady()
    {
        BlockPos pos = World.Spawn.Offset(1, 1, 0);
        World.SetBlock("game:chest-east", pos);
        await World.Ticks(5);
        Assert.Equal("game:chest-east", World.BlockAt(pos).Code.ToString());
    }
}

Same scenario, several inputs? [AtlasTheory] is the theory-style counterpart: each data row runs as its own scenario, with the row's values in its display name and rows passing or failing independently:

[AtlasTheory]
[InlineData("game:chest-east")]
[InlineData("game:chest-west")]
public async Task Chest_Should_BePlaceable_When_WorldIsReady(string chestCode)
{
    BlockPos pos = World.Spawn.Offset(1, 1, 0);
    World.SetBlock(chestCode, pos);
    await World.Ticks(5);
    Assert.Equal(chestCode, World.BlockAt(pos).Code.ToString());
}
  1. Run it:
dotnet test

Atlas boots a fresh headless server per test class (superflat world, creative playstyle, fixed seed by default), pumps it on a dedicated game thread, runs your scenario on that thread, then tears it down.

Each embedded server works in its own scratch data directory (world save, server logs, staged mods) under the system temp path. A class that ends green has its server released when the class ends and its scratch deleted when the next class boots or the process exits; any failure, crash or abnormal exit keeps it, because the server's own server-main.log in there is the post-mortem trail Atlas's failure messages point at. A failed scenario's own output names that file and lists the Error and Fatal entries the engine logged since the boot, so a failure caused by something a mod logged at boot says so. Set ATLAS_KEEP_SCRATCH=1 to keep every scratch directory, green ones included, when debugging.

From 0.17.0 a green dotnet test run leaves no scratch directory behind, with nothing to set. The test host deletes the last class's directory as it exits, though, and dotnet test can return before that process is gone: a script that counts the directories right after it returns can still see some for a few seconds (one to three, in one consumer's suite), so it should wait for the test host process to exit, or retry the count, before it takes one for a leak. Up to 0.16.x the server of the last class was only released when the test process exited, and vstest kills the test host 100 ms after the last test while that release takes about a second, so a megabyte or more stayed in the temp folder after every run. If you are on one of those versions, set VSTEST_TESTHOST_SHUTDOWN_TIMEOUT=30000 (milliseconds) in the environment of dotnet test, in your shell profile or the CI job, so vstest waits for the host to exit, at a cost of about 0.5 to 0.9 s per test project. It has to be an environment variable (VSTEST_TESTHOST_SHUTDOWN_TIMEOUT=30000 dotnet test, or an export): vstest reads it in its own process, so a .runsettings EnvironmentVariables entry, which only reaches the test host, does not work. A test process that is killed before it exits can still leave the directory of the class it was running, on any version. atlas run, atlas run --parallel and atlas fixture are not affected.

Since 0.17.0 each scratch directory holds an atlas-run.json file that says which run made it: a run id, the id of the process that hosts the server, the test assembly and the time the process started. The folder name stays the 32 hex characters it always was, so a script that looks for <temp>/atlas/<32 hex> keeps working, and grep -l <run id> <temp>/atlas/*/atlas-run.json finds the folders of one run. The run id is generated once per test process; set ATLAS_RUN_ID to a value of your own (a CI job number, say) and every process that inherits it writes that value instead, which gives the folders of several test projects, or of the workers of atlas run --parallel, one id.

  1. Testing your own mod: reference its project from the test project, never the other way around. A mod project that references its own test project fails restore with a circular dependency (MSB4006), an MSBuild target graph cycle from the two-way ProjectReference. This is a different error from step 1's NU1108, an unrelated NuGet package graph cycle that only renaming the project fixes: keep the reference one-way regardless.
<ItemGroup>
  <ProjectReference Include="../MyMod/MyMod.csproj">
    <AtlasMod>true</AtlasMod>
  </ProjectReference>
</ItemGroup>

<AtlasMod>true</AtlasMod> stages the built mod automatically (as a folder or a dll, detected from whether a modinfo.json sits in the build output or next to the project file), so the assembly-level AtlasMods path from step 2 is not needed. A folder mod is staged under its own name, atlas-mods/<assembly name>, with the project's assets/ folder copied over its build output, so two mod projects never collide and assets/ can stay at the project root. A project that generates its modinfo.json at build is a folder mod too, as long as the file is in its build output when the build ends. Full staging reference on the wiki's Mod Staging page.

The atlas CLI

For fast local iteration without VSTest, the atlas dotnet tool (package Pixnop.Atlas.Cli) runs a compiled scenario assembly directly:

atlas run bin/Debug/net10.0/MyMod.Scenarios.dll            # run everything
atlas run bin/Debug/net10.0/MyMod.Scenarios.dll --filter Chest
atlas run bin/Debug/net10.0/MyMod.Scenarios.dll --list     # discover only, no server boot
atlas run bin/Debug/net10.0/MyMod.Scenarios.dll --parallel # one worker process per class
atlas fixture bin/Debug/net10.0/MyMod.Scenarios.dll \
      --scenario BuildsCastleWorld --out fixtures/castle.vcdbs   # author a world fixture
atlas diff vanilla.trx fork.trx                            # compare two runs, no server boot
atlas --version                                            # print the tool version, no boot

Install it with dotnet tool install -g Pixnop.Atlas.Cli. dotnet tool update -g Pixnop.Atlas.Cli --version <stable> refuses to go down from a release candidate ("lower than existing"); to go back, run dotnet tool uninstall -g Pixnop.Atlas.Cli and install again.

dotnet tool install -g puts atlas in ~/.dotnet/tools, which is not on the PATH of non-interactive shells (a CI step, a script): add the folder or call the tool by its full path.

Scenarios execute in-process and sequentially, exactly like dotnet test would (same embedded server, same VINTAGE_STORY requirement), with per-scenario PASS/FAIL lines, durations, a summary, and a non-zero exit code on any failure.

--parallel [N] distributes the scenario classes over N worker subprocesses (default: half the cores, capped at the class count), streams results live, reports the measured speedup, and can write one aggregated TRX report with --trx <path>; a crashed or wedged worker fails its class, never shortens the test list. --worker is the machine-facing counterpart: the same sequential run, reported as line-delimited JSON events on stdout for the orchestrator or any other tool.

atlas fixture authors the prebuilt world save that [AtlasWorld(SaveFile = "fixtures/castle.vcdbs")] boots against: it runs exactly one builder scenario (an ordinary [AtlasScenario] whose side effect is building the world), selected by the --scenario display-name substring, and after the scenario passes and the host shuts down gracefully it copies the persisted world save to --out (refusing to overwrite an existing file without --force). A failing builder writes nothing and exits non-zero.

atlas diff makes differential testing first class: it compares two TRX reports (the ones --parallel --trx or plain dotnet test --logger trx write) by test name and reports new failures, fixed, vanished and new tests, still-failing ones, and notable duration shifts (at least 2x and 500 ms apart), as a compact console listing or a versioned JSON document with --json; add --json-tests (implies --json) for a per-test tests array carrying each merged test's outcome, duration and candidate stdout, for pipelines that want the full listing instead of just the diff categories. Exit codes gate CI directly: 0 no regressions, 1 regressions (a new failure or a vanished test), 2 unreadable input, so atlas diff vanilla.trx fork.trx IS the parity gate. Contract in docs/specs/2026-07-14-diff-command.md.

Full flag reference on the wiki's CLI page; protocol contract in docs/specs/2026-07-06-worker-protocol.md.

Compatibility

Empirical results from the version compatibility sweep (compat.yml), which builds Atlas against each game version's own dlls and runs the full E2E suite on a real embedded server:

Version Status Notes
1.22.7 Compatible All E2E scenarios green, tested on every push (latest stable)
1.22.4-1.22.6 Compatible Build verified (the 1.22.4 nullable-inventory annotation is handled); swept weekly, not tested per push
1.22.3 Compatible All E2E scenarios green; swept weekly, not tested per push
1.22.2 Compatible All E2E scenarios green; swept weekly, not tested per push
1.22.1 Compatible All E2E scenarios green; swept weekly, not tested per push
1.22.0 Compatible All E2E scenarios green; swept weekly, not tested per push
1.21.7 Compatible All E2E scenarios green through the runtime EngineCompat shim (exit lifecycle, version constants, client-state value), tested on every push
1.20.12 Compatible All E2E scenarios green through the same shim (verified live 2026-07-13); swept weekly, not tested per push
1.19.8 Incompatible The boot API itself changes shape (ServerMain.PreLaunch, ServerProgramArgs); Atlas refuses to boot with a clear setup error citing the floor
1.18.15 Incompatible Same as 1.19.8, plus Vintagestory.API.Common.Func collides with System.Func at build time

Each row is the latest patch of its minor available on the stable CDN; 1.18.0 through 1.18.7 predate the game's .NET migration and ship under a different server archive entirely. The supported floor is Vintage Story 1.21.0, with 1.20.x compatible best-effort (same measured surface, one weekly sweep lane instead of a per-push one). Two versions run on every push, the floor 1.21.7 and the latest stable 1.22.7, each splitting the engine E2E suite into three whole-class shards in ci.yml; every other row, 1.22.0 through 1.22.6 included, is covered by the weekly sweep, which fails its run when a version at or above the floor comes back as anything other than compatible. The pre-1.22 rows reflect the live verification of 2026-07-13 (full engine E2E suite plus samples on 1.21.7 and 1.20.12, measured in docs/specs/2026-07-12-pre-122-compat.md); the sweep re-runs weekly and can be triggered manually with gh workflow run compat.yml or from the Actions tab.

Multi-install runs: no rebuild needed

Repointing VINTAGE_STORY at a different install (another game version, or a server fork like Stratum) does not require rebuilding the test project. The test output's own VintagestoryAPI.dll copy would win assembly probing and mix with the target install's VintagestoryLib (the issue #49 trap: a cryptic MissingFieldException on same-version forks, a raw TypeLoadException killing the test process across versions), so Atlas auto-stages at launch: a module initializer, running at xUnit discovery before anything can bind the copy, rewrites the test-output dll+pdb pair from the target install (atomically, with a one-line stderr notice). When staging is genuinely impossible: the stale copy already bound because engine types were JITted before any Atlas code ran, a read-only test output, an install without its pdb: the boot fails fast with an AtlasSetupException naming both file identities and the remedies (an already-bound copy is still re-staged on disk, so a plain re-run recovers without a rebuild). The per-push prebuilt-cross-install CI lane proves the path from one build: samples built once against 1.22.3 run unmodified (--no-build) on 1.21.7, again on 1.21.7 (idempotence), and back on 1.22.3, with byte-identity asserts on the staged copy.

The first boot of a process also writes one line to stderr, next to the [Atlas] staged mod lines, naming the game version and install the server runs on and the version the scenarios were compiled against ([Atlas] game 1.22.3 from '/opt/vs/1.22.3' (scenarios compiled against 1.22.7)). That line is information, and the opt-in attribute described next is the guard. It goes to stderr, which a plain dotnet test console run and atlas run --parallel do not show. In a dotnet test run, read it in the TRX output or in the console with --logger "console;verbosity=normal"; atlas run prints it without --parallel. The compiled version is stamped into the scenario assembly by the build, since the assembly reference does not carry the game version below 1.22. Nothing fails on a difference by default, since running a build on another install is what this section is about; a suite that wants the failure declares [assembly: AtlasRequireCompiledGameVersion], and the boot then throws AtlasSetupException before the server starts, naming both versions and the install. The line names a version, not a build: a fork rebuilt at the same version cannot be told from vanilla this way. See the wiki's Compatibility page.

One-shot scripts that run each install exactly once (a differential-CI consumer's differential run-parity.sh, for example) cannot absorb that documented fail-then-rerun: the FIRST run on a newly repointed install still fails, even though it re-stages the copy for a rerun the script never makes. atlas stage (issue #95) runs the identical decision explicitly, up front, before anything can bind the copy:

atlas stage out/ && VINTAGE_STORY=/path/to/other-install dotnet test out/ --no-build

atlas stage <path/to/test-output-or-assembly.dll> stages against the CURRENT VINTAGE_STORY, prints one line per file (staged, already identical, or nothing to stage), and exits 0; the actual boot right after then finds the copy already correct and never needs the rerun.

Direction matters, because of the second file the game provides: the test output's Newtonsoft.Json.dll is the BUILD-time install's game build (13.0.4 on 1.22.x, 13.0.3 on 1.21.x/1.20.x, same 13.0.0.0 assembly identity), and the VSTest host binds it at process start for its own protocol, before any staging trigger can possibly run. Build against the NEWEST engine you target and run everywhere older: the newer build is a superset and the whole matrix runs green (measured: the full engine E2E suite built on 1.22.3 passes 105/105 on 1.21.7 and 1.20.12, plus the samples, without a rebuild). Running a floor-built output on a NEWER engine is refused up front: the newer engine binds members its own Newtonsoft build added (JToken.WriteTo(JsonWriter) on 1.22.3, which killed every boot in measurement), so the boot preflight fails fast with both file versions and the remedies named, and still re-stages the copy on disk, so a plain re-run (or a rebuild) recovers.

Community

  • Mod DB page: follow releases and leave feedback.
  • CONTRIBUTING.md: build environment, the three test commands, branch and commit conventions, what a pull request is expected to carry.
  • Badge kit: a "Tested with Atlas" badge for a mod's own README, Mod DB page or forum post.

Documentation

The full documentation lives on the project wiki:

  • Getting Started: the quickstart above, expanded, plus troubleshooting.
  • Writing Scenarios: attribute reference, time model, the world-isolation trilogy (fresh, rollback, restart), world fixtures and schematics, data file seeding, dimensions, test players, command results, the Api escape hatch.
  • Client-Side Testing: asserting what the server sends a test player (highlights, particles, mod-channel packets, chat, entity arrivals, player data, player groups) with no client process, Say and its wait guarantee, what a mod must expose, where the headless-client work stands.
  • Mod Staging: folder/zip/dll staging, AtlasMods, the MSBuild AtlasMod sugar.
  • CLI: the atlas run reference, filtering and listing, worker mode and the JSONL protocol, multi-process --parallel execution, authoring world fixtures with atlas fixture, differential TRX comparison with atlas diff, pre-staging a test output for one-shot scripts with atlas stage.
  • Architecture: host, adapter and bridge layers, the game-thread pump.
  • CI Recipes: GitHub Actions recipe, version matrix, TRX output, parallel execution.
  • Compatibility: supported Vintage Story versions, multi-install auto-staging (build newest, run older), the weekly sweep.
  • Troubleshooting: common exceptions and how to resolve them.
  • Roadmap: open issues and what's next.

Runnable counterparts to all of the above live in samples/: two mods under test and a scenario project with one file per feature, run with VINTAGE_STORY=/path/to/install dotnet test samples/Sample.Scenarios.

For engineering rationale rather than usage docs, see the in-repo design spec and feasibility spike.

Known limitations (v1)

  • Vintage Story (confirmed on 1.22.2 and 1.22.3) occasionally throws a NullReferenceException from ServerSystemMonitor.Dispose() during shutdown. Atlas swallows it and logs the stack to stderr; it is an upstream engine bug (VintageStory-Issues#9798), not a symptom of a broken test run. See the wiki's Troubleshooting page for details.
  • World rollback covers every dimension since 0.8.0 (mini-dimension chunk columns round-trip through the snapshot, boot-time pregenerated ones included), but neither mod in-memory state nor in-memory map chunk state (height maps, map moddata) is rolled back on its own: mods whose state is keyed to SaveGame data resync it by subscribing to the atlas:rollback:restored event-bus hook (payload-versioned, VintagestoryAPI types only; fired after the SaveGame restore, before any chunk column reloads), mods that follow chunk/entity lifecycle events need nothing, and scenarios over mods with neither use FreshWorld. When a rollback cannot be trusted (a throwing hook handler included), Atlas falls back to the full host recycle and reports the degrade in the scenario's test output (or fails the scenario, with StrictIsolation = true). Joined test players ARE rolled back since 0.8.0 (position, inventories, watched attributes, per-player moddata; players joined after the snapshot are removed and their names freed for a rejoin). See the wiki's Writing Scenarios page for the honest boundary list.
  • Parallelism is per scenario class and multi-process (atlas run --parallel): scenarios within a class still run sequentially, and dotnet test itself remains sequential (DisableTestParallelization stays required).
  • Pre-1.22 engines (1.21.x, and 1.20.x best-effort) run through the runtime EngineCompat shim over the server exit lifecycle, validated at boot: an engine whose layout drifted fails fast with the game version and the missing symbol named, and 1.19.x or older is refused up front with a setup error citing the supported floor. The prebuilt-binary path (a test assembly and its NuGet Atlas.dll compiled against 1.22 running on a 1.21 install, or the reverse) is carried by the same shim plus the engine-assembly auto-staging preflight, and is verified per push by the prebuilt-cross-install CI lane; note that the samples it runs stick to the API surface both versions share, which is also the contract for your own cross-version scenarios (a scenario body calling a 1.22-only API member still fails on 1.21 with a MissingMethodException, staging cannot invent engine surface; enum VALUES are compile-time constants, so a scenario comparing against a member whose position shifted across versions, like EnumClientState.Playing, reads the wrong value on the other line, which is why Atlas's own join lifecycle resolves it from the loaded engine at run time; and members that changed between field and property, like Entity.Pos/ServerPos which became properties in 1.22, bind to one shape only, so scenario code should read spawned entities' positions through SidedPos, a property on every supported version, as Atlas itself does).

License

MIT. See LICENSE.

About

Integration-test harness for Vintage Story mods: boots a real headless server inside dotnet test and drives it from xUnit.

Topics

Resources

Contributing

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages