LabTesting 0.2.0

dotnet add package LabTesting --version 0.2.0
                    
NuGet\Install-Package LabTesting -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LabTesting" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LabTesting" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="LabTesting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LabTesting --version 0.2.0
                    
#r "nuget: LabTesting, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LabTesting@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LabTesting&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=LabTesting&version=0.2.0
                    
Install as a Cake Tool

LabTesting

One package to test a LabAPI plugin inside a real SCP:SL server, on Windows and Linux. It carries the net48 harness, Harmony 2.3.6, the portable .NET 10 runner and the MSBuild targets. Install the .NET 10 SDK and the SteamCMD dedicated server 996560 separately: tools/server/install-server.sh <server> <steamcmd> and tools/server/install-server.ps1 -Server <dir> -SteamCmd <dir> inside the package do that, including the SteamCMD warm-up and the retry CI needs.

Harmony is a NuGet dependency pinned to [2.3.6]: LabAPI refuses a plugin built against another version, so a mismatch now fails the restore instead of the run.

In the net48 test project:

<PackageReference Include="LabTesting" Version="0.2.0" PrivateAssets="all" />

Pin the published version you chose. The NuGet restore installs the whole framework and keeps harness and runner at the same version. No EXE to copy, no dotnet-tools.json to maintain.

Put labtesting.json at the repository root, or next to the test project:

{
  "server": ".server",
  "plugins": ["src/MyPlugin/bin/Release/net48/MyPlugin.dll"],
  "dependencies": [],
  "reports": "TestResults",
  "work": ".labtest-work",
  "port": 7799
}

The package supplies the harness, Harmony and the test project's own assembly. Do not redeclare them in the JSON. Required plugins and their other dependencies stay explicit. JSON paths are relative to the JSON file.

dotnet build tests/MyPlugin.Tests -c Release
dotnet build tests/MyPlugin.Tests -c Release -t:LabTestingList
dotnet build tests/MyPlugin.Tests -c Release -t:LabTesting

A plain build restores and compiles; the server tests only start on demand. To run them after every build, add <LabTestingRunOnBuild>true</LabTestingRunOnBuild> to the test project.

Optional properties: LabTestingConfig (relative to the project), LabTestingServer, LabTestingReports, LabTestingWork, LabTestingPort, LabTestingTimeout. LabTestingFailOnSkipped defaults to true. CLI and MSBuild path parameters are relative to the test project; prefer absolute paths in CI.

Assertions and attributes live in the LabTesting namespace. Fixtures may implement IAsyncLifetime to restore their static state. The JSONL, JUnit and Markdown reports and the logs stay available after a failure. An empty suite or an incomplete verdict fails the build.

The package includes no game, Unity or LabAPI assembly. Add the plugin and server references matching the types your tests use. PrivateAssets="all" keeps this test framework from flowing into your own packages.

lib/net48 also carries LabTesting.pdb with SourceLink data, so a stack trace inside the harness resolves to file and line on GitHub.

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 6 9/15/2026
0.1.0 34 9/15/2026