CSS.K6.Hosting.Aspire 0.1.1-beta1

This is a prerelease version of CSS.K6.Hosting.Aspire.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CSS.K6.Hosting.Aspire --version 0.1.1-beta1
                    
NuGet\Install-Package CSS.K6.Hosting.Aspire -Version 0.1.1-beta1
                    
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="CSS.K6.Hosting.Aspire" Version="0.1.1-beta1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CSS.K6.Hosting.Aspire" Version="0.1.1-beta1" />
                    
Directory.Packages.props
<PackageReference Include="CSS.K6.Hosting.Aspire" />
                    
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 CSS.K6.Hosting.Aspire --version 0.1.1-beta1
                    
#r "nuget: CSS.K6.Hosting.Aspire, 0.1.1-beta1"
                    
#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.
#addin nuget:?package=CSS.K6.Hosting.Aspire&version=0.1.1-beta1&prerelease
                    
Install CSS.K6.Hosting.Aspire as a Cake Addin
#tool nuget:?package=CSS.K6.Hosting.Aspire&version=0.1.1-beta1&prerelease
                    
Install CSS.K6.Hosting.Aspire as a Cake Tool

CSS.K6.Hosting.Aspire

Integration for running Grafana k6 load tests within .NET Aspire applications.

Overview

This package enables seamless integration of k6 load testing into your .NET Aspire applications. It provides extension methods for the Aspire IDistributedApplicationBuilder that make it easy to add and configure k6 resources.

Features

  • Add k6 load testing containers to your Aspire application
  • Reference API projects for testing
  • Configure k6 test scripts
  • Extensible output system through additional packages

Installation

dotnet add package CSS.K6.Hosting.Aspire

Requirements

  • .NET 8.0 or .NET 9.0
  • .NET Aspire
  • Docker (for running the k6 container)

Usage

Basic usage to add k6 load testing to an Aspire application:

var builder = DistributedApplication.CreateBuilder(args);

// Add your API project
var apiProject = builder.AddProject<Projects.MyApi>("api");

// Add k6 for load testing
builder.AddK6("load-testing", options => 
{
    options.ScriptDirectory = "scripts";
    options.ScriptFileName = "loadtest.js";
})
.WithApiEndpoint(apiProject);

// The application builder and services configuration continues...

Options

  • ScriptDirectory: Directory containing k6 test scripts
  • ScriptFileName: The main k6 script file to execute
  • ImageRegistry: (Optional) Container registry for the k6 image
  • ImageName: (Optional) Name of the k6 container image
  • ImageTag: (Optional) Tag of the k6 container image
  • CSS.K6.Hosting.Outputs.Grafana: For visualizing k6 test results in Grafana
  • CSS.K6.Hosting.Outputs.InfluxDB: For storing k6 test metrics in InfluxDB

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows 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.1.2-beta 164 3/5/2025
0.1.1-beta1 64 2/26/2025