Skip to content

Commit 4525ea2

Browse files
authored
Merge branch 'main' into links
2 parents 6a5e6a7 + 326987f commit 4525ea2

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/pull_request_template.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!--
2-
Thanks for contributing to Testcontainers. Please review the following notes before
3-
submitting a pull request.
2+
Thanks for contributing to Testcontainers. Before submitting a pull request, please
3+
review our contributing guidelines at https://java.testcontainers.org/contributing/
4+
5+
Please also review the following notes before submitting a pull request.
46
57
New Modules:
68

docs/modules/k6.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,23 @@ Testcontainers module for [k6](https://registry.hub.docker.com/r/grafana/k6).
1111

1212
## Basic script execution
1313

14-
Execute a simple k6 test script, `test.js`, with commandline options and injected script variable.
14+
You can start a K6 container instance from any Java application by using:
15+
16+
<!--codeinclude-->
17+
[Setup the container](../../modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java) inside_block:standard_k6
18+
<!--/codeinclude-->
19+
20+
The test above uses a simple k6 script, `test.js`, with command line options and an injected script variable.
21+
22+
Once the container is started, you can wait for the test results to be collected:
23+
24+
<!--codeinclude-->
25+
[Wait for test results](../../modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java) inside_block:wait
26+
<!--/codeinclude-->
1527

1628
Create a simple k6 test script to be executed as part of your tests:
1729

1830
<!--codeinclude-->
19-
[Setup the container](../../modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java) inside_block:standard_k6
2031
[Content of `scripts/test.js`](../../modules/k6/src/test/resources/scripts/test.js) inside_block:access_script_vars
2132
<!--/codeinclude-->
2233

modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ void k6StandardTest() throws Exception {
2323
) {
2424
container.start();
2525

26+
// wait {
2627
WaitingConsumer consumer = new WaitingConsumer();
2728
container.followOutput(consumer);
2829

@@ -34,6 +35,7 @@ void k6StandardTest() throws Exception {
3435
3,
3536
TimeUnit.SECONDS
3637
);
38+
// }
3739

3840
assertThat(container.getLogs()).contains("k6 tests are cool!");
3941
}

0 commit comments

Comments
 (0)