From 4b7793528ad55f97464e367cc6717f62334f8846 Mon Sep 17 00:00:00 2001 From: Tomi Virtanen Date: Wed, 1 Apr 2026 16:01:35 +0300 Subject: [PATCH] chore: add runLoadTests profile for load tests --- vaadin-testbench-loadtest/CLAUDE.md | 1 + vaadin-testbench-loadtest/README.md | 11 ++++++++-- .../demo-web-app-loadtest/README.md | 21 +++++++++++-------- vaadin-testbench-loadtest/load-tests/pom.xml | 12 +++++------ 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/vaadin-testbench-loadtest/CLAUDE.md b/vaadin-testbench-loadtest/CLAUDE.md index 0862a59b6..ad397b890 100644 --- a/vaadin-testbench-loadtest/CLAUDE.md +++ b/vaadin-testbench-loadtest/CLAUDE.md @@ -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 diff --git a/vaadin-testbench-loadtest/README.md b/vaadin-testbench-loadtest/README.md index 3a4189c66..b7113bb4a 100644 --- a/vaadin-testbench-loadtest/README.md +++ b/vaadin-testbench-loadtest/README.md @@ -31,6 +31,13 @@ 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* @@ -38,7 +45,7 @@ Builds both the tooling and a simple demo web app with two Vaadin TestBench E2E ```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 @@ -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 \ diff --git a/vaadin-testbench-loadtest/load-tests/demo-web-app-loadtest/README.md b/vaadin-testbench-loadtest/load-tests/demo-web-app-loadtest/README.md index 14ee137a6..0b5f63446 100644 --- a/vaadin-testbench-loadtest/load-tests/demo-web-app-loadtest/README.md +++ b/vaadin-testbench-loadtest/load-tests/demo-web-app-loadtest/README.md @@ -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 @@ -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 @@ -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` @@ -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 \ @@ -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 diff --git a/vaadin-testbench-loadtest/load-tests/pom.xml b/vaadin-testbench-loadtest/load-tests/pom.xml index 73194ee1b..08a5ce259 100644 --- a/vaadin-testbench-loadtest/load-tests/pom.xml +++ b/vaadin-testbench-loadtest/load-tests/pom.xml @@ -28,12 +28,12 @@ - it-test-modules - - - !skipTests - - + load-tests + + + runLoadTests + + demo-web-app demo-web-app-loadtest