Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithScript

Method
📦 CommunityToolkit.Aspire.Hosting.k6 v13.6.1
func (K6Resource) WithScript(
scriptPath string,
options ...*WithScriptOptions,
) K6Resource

Signature

methodWithScriptbuilder
Runs a k6 JS script when starting the Grafana k6 container resource.
WithScript(
scriptPath string,
options ...*WithScriptOptions,
) K6Resource
scriptPathstringThe path to the JS script to run.
options...*WithScriptOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithScriptOptions argument.

VirtualUsers*float64The number of virtual users for the test..
Duration*stringThe duration of the test, e.g. 30s.
SummaryMode*K6SummaryModeThe summary mode of the test execution.
K6Resource

The IResourceBuilder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: