Skip to content

Commit

Permalink
Fix conflict with label input property name
Browse files Browse the repository at this point in the history
# User Define Variables is now supported

#Improvement in InputPanelTests
  • Loading branch information
Baraujo25 committed Mar 28, 2019
1 parent 321ebe6 commit ac0dbb3
Show file tree
Hide file tree
Showing 14 changed files with 308 additions and 121 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ As explained previously, the RTE Sampler has 4 types of waiters which work as sy

## Compatibility

The plugin is tested with Jmeter 3.1, 3.2, 3.3, 4.0 and 5.0 in Java 8 and 9. Code base is implemented in Java 1.8, so lower versions of JVM are not supported.
The plugin is tested with Jmeter 3.1, 3.2, 3.3, 4.0 and 5.0 in Java 8 and 11. Code base is implemented in Java 1.8, so lower versions of JVM are not supported.

## Contributing

Expand Down
32 changes: 32 additions & 0 deletions jmeter-plugins-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM maven:3.5

# install tightvnc and execute-on-vnc script to be able to run UI unit tests with assertjswing
ENV USER="root" \
PASSWORD="password"

# we update each time the apt-get to avoid potential issues with cached updates (instead of latest ones) when install is changed https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get
# additionally we keep installs separated to keep related things together and properly identifiable with the root cause for the requirement (in a preluding comment)
RUN apt-get update \
&& apt-get -y install tightvncserver \
&& mkdir /root/.vnc \
&& echo $PASSWORD | vncpasswd -f > /root/.vnc/passwd \
&& chmod 0600 /root/.vnc/passwd

# install jdk9
ENV JAVA_DEBIAN_VERSION="11.0.2+9-3~bpo9+1"
RUN echo 'deb http://ftp.debian.org/debian stretch-backports main' > /etc/apt/sources.list.d/backports.list \
&& apt-get update \
&& apt-get install -y openjdk-11-jdk-headless="$JAVA_DEBIAN_VERSION"

# install taurus for integration tests with blazemeter and different jmeter versions
ENV TAURUS_VERSION=1.13.3
RUN apt-get update \
&& apt-get -y install python default-jre-headless python-tk python-pip python-dev libxml2-dev libxslt-dev zlib1g-dev net-tools \
&& pip install bzt==$TAURUS_VERSION

# install ssh client to be able to release code and use git with ssh
RUN apt-get update \
&& apt-get -y install openssh-client

COPY scripts/* /
RUN chmod +x /*.sh
33 changes: 33 additions & 0 deletions jmeter-plugins-build/scripts/execute-on-vnc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#/bin/bash
# extracted from https://raw.githubusercontent.com/croesch/beefiles/master/src/execute-on-vnc.sh
# but adding proper exit code for the passed command

NEW_DISPLAY=42
DONE="no"

while [ "$DONE" == "no" ]
do
out=$(xdpyinfo -display :${NEW_DISPLAY} 2>&1)
if [[ "$out" == name* ]] || [[ "$out" == Invalid* ]]
then
# command succeeded; or failed with access error; display exists
(( NEW_DISPLAY+=1 ))
else
# display doesn't exist
DONE="yes"
fi
done

echo "Using first available display :${NEW_DISPLAY}"

OLD_DISPLAY=${DISPLAY}
vncserver ":${NEW_DISPLAY}" -localhost -geometry 1600x1200 -depth 16
export DISPLAY=:${NEW_DISPLAY}

eval "$@"
EXIT_CODE=$?

export DISPLAY=${OLD_DISPLAY}
vncserver -kill ":${NEW_DISPLAY}"

exit $EXIT_CODE
24 changes: 24 additions & 0 deletions jmeter-plugins-build/scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#/bin/bash
set -ex

eval $(ssh-agent -s)
/set-git-credentials.sh

# get a new clean copy of master branch
git checkout master && git reset --hard origin/master

# we need this to later on use with nextSnapshot due to https://github.com/mojohaus/versions-maven-plugin/issues/207
ORIGINAL_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)

# get a new clean copy of production branch
git checkout production && git reset --hard origin/production
git merge master
mvn versions:set -DremoveSnapshot
/execute-on-vnc.sh mvn --batch-mode clean verify
mvn --batch-mode scm:checkin -Dmessage="[RELEASE][skip ci] Fix release version \${project.version}" -Dincludes=pom.xml
mvn --batch-mode scm:check-local-modification -DpushChanges=false
mvn --batch-mode scm:tag -Dtag="\${project.version}"

git checkout master && git merge production
mvn --batch-mode versions:set -DnextSnapshot=true
mvn --batch-mode scm:checkin -Dmessage="[RELEASE][skip ci] Increase version to next development version \${project.version}" -Dincludes=pom.xml
11 changes: 11 additions & 0 deletions jmeter-plugins-build/scripts/set-git-credentials.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#/bin/bash
# this has been extracted from https://docs.gitlab.com/ee/ci/ssh_keys/#verifying-the-ssh-host-keys
set -e

echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
git config --global user.email "[email protected]"
git config --global user.name "Gitlab"
13 changes: 11 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.blazemeter.jmeter</groupId>
<artifactId>jmeter-bzm-rte</artifactId>
<packaging>jar</packaging>
<version>1.1</version>
<version>1.1.1</version>
<name>RTEPlugin Sampler as JMeter plugin</name>

<properties>
Expand Down Expand Up @@ -106,13 +106,23 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<!-- avoid issue with jdk 11 -->
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<parallel>both</parallel>
<threadCount>10</threadCount>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -275,7 +285,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<!--suppress MavenModelInspection -->
<argLine>${jacoco.agent.ut.arg}</argLine>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@

public class LabelInputRowGUI extends InputTestElement {

private static final String LABEL = "LabelInputRowGUI.column";
private static final String LABEL = "LabelInputRowGUI.label";

public LabelInputRowGUI() {
}

public String getLabel() {
return getPropertyAsString(LABEL, "");
/*
We keep support for initial incorrect property name to avoid compatibility issues. We should
remove this once the new version gets used by all users (and the probability of someone using
the incorrect property is low)
*/
String val = getPropertyAsString(LABEL, null);
return val == null ? getPropertyAsString("LabelInputRowGUI.column") : val;
}

public void setLabel(String label) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ public abstract class RequestListenerIT<T extends RequestListener<?>> {
protected T listener;

@Before
public void setup() throws Exception {
public void setup() {
result = new SampleResult();
result.sampleStart();
listener = buildRequestListener(result);
}

Expand Down
Loading

0 comments on commit ac0dbb3

Please sign in to comment.