Skip to content

k6 Module

Note

This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See our contributing guidelines for more information on our incubating modules policy.

Testcontainers module for k6. k6 is an extensible reliability testing tool built for developer happiness.

Usage

Here is a basic example of how to create and start a K6 container:

```java try ( // k6_container { K6Container container = new K6Container(DockerImageName.parse("grafana/k6:0.49.0")) .withTestScript("scripts/test.js") .withScriptVar("MY_VAR", "hello") // } ) { container.start(); // Perform assertions based on logs or container state }