Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vaadin-testbench-loadtest/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ When creating a new feature:

## Testing

- The `demo-web-app` and `demo-web-app-loadtest` modules are only included when `-DrunLoadTests` is passed (e.g., `mvn verify -DrunLoadTests`). They are excluded by default to avoid failures in CI snapshot builds.
- k6 tests are located in `src/test/k6`
- k6 tests can be run with `k6 run src/test/k6/...`
- https://github.com/johannest/k6-demo/blob/main/book-store.js is a good example of a k6 test
Expand Down
11 changes: 9 additions & 2 deletions vaadin-testbench-loadtest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,21 @@ mvn install

Builds both the tooling and a simple demo web app with two Vaadin TestBench E2E tests.

> **Note:** The `demo-web-app` and `demo-web-app-loadtest` modules are **not** included
> in the default build. To include them, pass `-DrunLoadTests`:
>
> ```bash
> mvn install -DrunLoadTests
> ```

### Run the Demo (Local)

*Note, you should not do this for anything else but to test the setup without external server*

```bash

# Run the complete workflow (start app, record, run load test)
mvn verify -pl demo-web-app-loadtest
mvn verify -pl demo-web-app-loadtest -DrunLoadTests
```

### Option 3: Remote Load Testing
Expand All @@ -49,7 +56,7 @@ First deploy the test app to a remote server. The next snippet assumes the remot

```bash
# Test against a staging server
mvn verify -pl demo-web-app-loadtest -Premote \
mvn verify -pl demo-web-app-loadtest -DrunLoadTests -Premote \
-Dk6.appHost=staging.example.com \
-Dk6.appPort=8080 \
-Dk6.vus=100 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ This module provides k6 load testing capabilities for the demo application in th

## Quick Start

> **Note:** This module is only included in the build when `-DrunLoadTests` is passed.
> It is excluded by default to avoid failures in CI snapshot builds.

### Local Development Workflow

Record scenarios and run quick load tests locally:

```bash
# Build and run the full workflow (start server, record, run test)
mvn verify
mvn verify -DrunLoadTests
```

### Remote Load Testing
Expand All @@ -22,10 +25,10 @@ Run pre-recorded tests against a remote server:

```bash
# Test against a staging server
mvn verify -Premote -Dk6.appHost=staging.example.com -Dk6.appPort=8080
mvn verify -DrunLoadTests -Premote -Dk6.appHost=staging.example.com -Dk6.appPort=8080

# High-load test against production
mvn verify -Premote -Dk6.appHost=10.0.1.50 -Dk6.vus=100 -Dk6.duration=5m
mvn verify -DrunLoadTests -Premote -Dk6.appHost=10.0.1.50 -Dk6.vus=100 -Dk6.duration=5m
```

## Maven Profiles
Expand All @@ -40,9 +43,9 @@ The default profile for development and CI. It:
4. Stops the application

```bash
mvn verify # Full workflow
mvn verify -Dk6.skipRun=true # Only record, don't run load test
mvn verify -Dk6.skipRecord=true # Only run test, don't re-record
mvn verify -DrunLoadTests # Full workflow
mvn verify -DrunLoadTests -Dk6.skipRun=true # Only record, don't run load test
mvn verify -DrunLoadTests -Dk6.skipRecord=true # Only run test, don't re-record
```

### `remote`
Expand All @@ -56,10 +59,10 @@ For production load testing against a server running on another machine. This pr

```bash
# Basic usage
mvn verify -Premote -Dk6.appHost=staging.example.com
mvn verify -DrunLoadTests -Premote -Dk6.appHost=staging.example.com

# Full configuration
mvn verify -Premote \
mvn verify -DrunLoadTests -Premote \
-Dk6.appHost=192.168.1.100 \
-Dk6.appPort=8080 \
-Dk6.vus=50 \
Expand All @@ -71,7 +74,7 @@ mvn verify -Premote \
Records scenarios without running load tests. Useful for preparing tests that will be executed later on dedicated infrastructure.

```bash
mvn verify -Precord-only
mvn verify -DrunLoadTests -Precord-only
```

## Included Scenarios
Expand Down
12 changes: 6 additions & 6 deletions vaadin-testbench-loadtest/load-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@

<profiles>
<profile>
<id>it-test-modules</id>
<activation>
<property>
<name>!skipTests</name>
</property>
</activation>
<id>load-tests</id>
<activation>
<property>
<name>runLoadTests</name>
</property>
</activation>
<modules>
<module>demo-web-app</module>
<module>demo-web-app-loadtest</module>
Expand Down
Loading