TestRift.Server
0.6.0
dotnet add package TestRift.Server --version 0.6.0
NuGet\Install-Package TestRift.Server -Version 0.6.0
<PackageReference Include="TestRift.Server" Version="0.6.0" />
<PackageVersion Include="TestRift.Server" Version="0.6.0" />
<PackageReference Include="TestRift.Server" />
paket add TestRift.Server --version 0.6.0
#r "nuget: TestRift.Server, 0.6.0"
#:package TestRift.Server@0.6.0
#addin nuget:?package=TestRift.Server&version=0.6.0
#tool nuget:?package=TestRift.Server&version=0.6.0
TestRift.Server NuGet Package
Python server for TestRift real-time test runs: live log streaming, result storage, and a web UI for browsing and analysis.
Designed for use with TestRift.NUnit - provides automatic server startup and configuration for NUnit test projects.
Experimental
TestRift is currently in an experimental phase. APIs, configuration, and data formats may change at any time without notice.
What's Included
This NuGet package contains:
- TestRift Server Python source code
- Platform-specific launcher scripts (
testrift-server.bat,testrift-server.sh) - Automatic Python virtual environment management
- All required Python dependencies (aiohttp, aiofiles, PyYAML, jinja2, aiosqlite)
Installation
Add the package reference to your test project:
<PackageReference Include="TestRift.Server" Version="*" />
The package will be automatically extracted to your NuGet cache during restore.
Note: This package is typically installed alongside TestRift.NUnit, which provides the integration for NUnit test projects.
Usage
Automatic Server Start with TestRift.NUnit (Recommended)
When using TestRift.NUnit, the server starts automatically when tests run with autoStartServer configured.
1. Configure TestRift.NUnit to auto-start the server
TestRiftNUnit.yaml:
serverUrl: http://localhost:8080
autoStartServer:
enabled: true
serverYaml: TestRiftServer.yaml
restartOnConfigChange: true
2. Create server configuration file
TestRiftServer.yaml:
server:
port: 8080
localhost_only: true
The TestRift.NUnit plugin will:
- Locate the TestRift.Server package in your NuGet cache
- Run the launcher script with the configuration from
serverYaml - Wait for the server to become healthy
- Run your tests
- Keep the server running until tests complete
This is the recommended approach - server configuration is separated into its own file referenced by the serverYaml property.
Manual Server Start
You can also run the server manually from the NuGet package location:
Windows:
%USERPROFILE%\.nuget\packages\testrift.server\<version>\tools\testrift-server.bat
Linux/macOS:
~/.nuget/packages/testrift.server/<version>/tools/testrift-server.sh
Virtual Environment Management
The launcher scripts automatically manage a Python virtual environment:
- First run: Creates
.venvin the package tools directory - Dependency installation: Installs required packages from
requirements.txt - Smart updates: Only reinstalls dependencies when
requirements.txtchanges - Isolated environment: Each package version has its own venv
No manual pip installation or Python environment setup required!
Configuration
Recommended: Using TestRift.NUnit's serverYaml
The recommended approach is to configure the server using a separate YAML file referenced in your TestRift.NUnit configuration:
TestRiftNUnit.yaml:
serverUrl: http://localhost:8080
autoStartServer:
enabled: true
serverYaml: TestRiftServer.yaml # Server config file
TestRiftServer.yaml:
server:
port: 8080
localhost_only: true
logging:
level: INFO
This keeps server configuration separate from test configuration and allows the TestRift.NUnit plugin to manage the server's lifecycle automatically.
Alternative: Environment Variable
When running the server manually, you can specify configuration via environment variable:
- Set
TESTRIFT_SERVER_YAMLto an absolute path to a YAML config file - The server will fail to start if the file doesn't exist
Configuration File Search
If no configuration is specified, the server looks for testrift_server.yaml in the current working directory.
For the full configuration reference, see the server_config.md documentation.
Requirements
- Python 3.8+ must be available on PATH
- Windows:
pythonorpython3command - Unix:
python3command
- Windows:
- No pip installation required - dependencies are managed automatically
Package Structure
~/.nuget/packages/testrift.server/<version>/
├── tools/
│ ├── testrift-server.bat # Windows launcher
│ ├── testrift-server.sh # Unix launcher
│ ├── server/
│ │ ├── requirements.txt # Python dependencies
│ │ └── testrift_server/ # Server source code
│ └── .venv/ # Auto-created virtual environment
│ ├── Scripts/ # (Windows) Python executables
│ ├── bin/ # (Unix) Python executables
│ └── Lib/ # Installed Python packages
└── LICENSE
Troubleshooting
Server won't start
Check Python is available:
python --version # or python3 --version
Check logs: When auto-started, error messages appear in test output diagnostics.
Dependencies not installing
The launcher scripts automatically run pip install -r requirements.txt on first use. If this fails:
- Ensure you have internet connectivity
- Check Python has pip installed:
python -m pip --version - Manually delete
.venvfolder to force recreation
Port conflicts
If port 8080 is in use, configure a different port:
# TestRiftServer.yaml
server:
port: 19999
Update your test configuration to match:
# TestRiftNUnit.yaml
server:
url: http://localhost:19999
Links
License
Apache-2.0
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.