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
16 changes: 13 additions & 3 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# 5.5 is the minimum supported JMeter version, 5.6.3 the latest; both are exercised
# end-to-end (unit + HTTP parity regression tests) since ApacheJMeter_* are provided-scope
# and the same compiled plugin must behave correctly against either at runtime.
jmeter_version: ["5.5", "5.6.3"]
steps:
- name: Checkout
uses: actions/checkout@v5
Expand All @@ -21,14 +28,17 @@ jobs:
java-version: "17"
cache: maven

- name: Build and test
run: xvfb-run -a mvn -U --batch-mode clean install
- name: Build and test (JMeter ${{ matrix.jmeter_version }})
run: >-
xvfb-run -a mvn -U --batch-mode
-Djmeter.version=${{ matrix.jmeter_version }}
clean install

- name: Upload build artifacts
if: always()
uses: actions/upload-artifact@v6
with:
name: ci-build-artifacts-${{ github.run_id }}
name: ci-build-artifacts-${{ matrix.jmeter_version }}-${{ github.run_id }}
path: |
target/jmeter-bzm-http2-*.jar
target/jmeter-test
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci-jmeter-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ jobs:
env:
JMETER_PATH_BASE: ${{ github.workspace }}/.jmeter
run: |
JMETER_VERSION=5.6.3 JMETER_PATH=$JMETER_PATH_BASE/5.6.3 sh testJMeter.sh
# Verify the built plugin jar loads and runs against every JMeter version we claim
# to support: 5.5 (minimum) through 5.6.3 (latest), regardless of which version the
# jar itself was compiled against (jmeter.version in pom.xml is provided-scope).
for JMETER_VERSION in 5.5 5.6.3; do
echo "=== Compatibility check against JMeter $JMETER_VERSION ==="
JMETER_VERSION=$JMETER_VERSION JMETER_PATH=$JMETER_PATH_BASE/$JMETER_VERSION sh testJMeter.sh
done

- name: Upload compatibility artifacts on failure
if: failure()
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jmeter.version>5.4.1</jmeter.version>
<jmeter.version>5.5</jmeter.version>
<jetty.version>12.1.11</jetty.version>
<!-- Matches jetty-project ${brotli4j.version} for Jetty 12.1.11 -->
<brotli4j.version>1.23.0</brotli4j.version>
Expand All @@ -50,11 +50,11 @@
<scope>provided</scope>
</dependency>
<!-- Apache HttpClient for compilation (classes used in JettyCacheManager) -->
<!-- Using same version as JMeter 5.4.1 -->
<!-- Using same version as JMeter 5.5 (our minimum supported version) -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.14</version>
<version>4.4.15</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import org.apache.commons.lang3.StringUtils;
import org.apache.jmeter.protocol.http.sampler.HTTPSampleResult;
import org.apache.jmeter.protocol.http.util.HTTPConstants;
import org.junit.After;
Expand Down Expand Up @@ -49,7 +50,15 @@ public void samplesLocalFileWithHardcodedGetMethodAndTextHtmlContentType() throw
assertThat(sampled.isSuccessful()).isTrue();
assertThat(sampled.getResponseCode()).isEqualTo("200");
assertThat(sampled.getHTTPMethod()).isEqualTo(HTTPConstants.GET);
assertThat(sampled.getContentType()).isEqualTo("text/html");
// HTTP2Sampler.getContentEncoding()'s default is JMeter-version-dependent: 5.6.3 added a
// hardcoded UTF-8 schema default (HTTPSamplerBaseSchema), while 5.5 (our minimum supported
// version) leaves it blank until explicitly set. Read the sampler's actual runtime default
// instead of hardcoding the literal so this test passes on both supported versions.
String defaultContentEncoding = new HTTP2Sampler().getContentEncoding();
String expectedContentType = StringUtils.isBlank(defaultContentEncoding)
? "text/html"
: "text/html; charset=" + defaultContentEncoding;
assertThat(sampled.getContentType()).isEqualTo(expectedContentType);
assertThat(sampled.getResponseDataAsString()).isEqualTo(fileContent);
}

Expand Down
Loading