561 lines
21 KiB
YAML
561 lines
21 KiB
YAML
name: JMeter integration tests
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v5.*"
|
|
pull_request:
|
|
branches:
|
|
- "master"
|
|
|
|
jobs:
|
|
build_emqx_for_jmeter_tests:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.build_docker.outputs.version}}
|
|
steps:
|
|
- uses: erlef/setup-beam@v1
|
|
with:
|
|
otp-version: "24.2"
|
|
- name: download jmeter
|
|
timeout-minutes: 3
|
|
env:
|
|
JMETER_VERSION: 5.4.3
|
|
run: |
|
|
wget --no-verbose --no-check-certificate -O /tmp/apache-jmeter.tgz https://downloads.apache.org/jmeter/binaries/apache-jmeter-$JMETER_VERSION.tgz
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: apache-jmeter.tgz
|
|
path: /tmp/apache-jmeter.tgz
|
|
- uses: actions/checkout@v3
|
|
- name: zip emqx docker image
|
|
id: build_docker
|
|
if: endsWith(github.repository, 'emqx')
|
|
run: |
|
|
## TODO: make profile a matrix dimension
|
|
PROFILE='emqx'
|
|
make "${PROFILE}-docker"
|
|
VSN="$(./pkg-vsn.sh $PROFILE)"
|
|
echo "::set-output name=version::${VSN}"
|
|
docker save -o emqx.tar emqx/emqx:${VSN}
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: emqx.tar
|
|
path: ./emqx.tar
|
|
|
|
advanced_feat:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
scripts_type:
|
|
- mqtt_subscription_topic_metrics
|
|
- mqtt_delayed_publish
|
|
- mqtt_topic_rewrite
|
|
# - mqtt_retainer
|
|
|
|
needs: build_emqx_for_jmeter_tests
|
|
steps:
|
|
- uses: erlef/setup-beam@v1
|
|
with:
|
|
otp-version: "24.2"
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: emqx.tar
|
|
path: /tmp
|
|
- name: load docker image
|
|
run: |
|
|
docker load < /tmp/emqx.tar
|
|
- name: docker compose up
|
|
timeout-minutes: 5
|
|
env:
|
|
_EMQX_DOCKER_IMAGE_TAG: emqx/emqx:${{ needs.build_emqx_for_jmeter_tests.outputs.version }}
|
|
run: |
|
|
docker-compose \
|
|
-f .ci/docker-compose-file/docker-compose-emqx-cluster.yaml \
|
|
up -d --build
|
|
- name: wait docker compose up
|
|
timeout-minutes: 5
|
|
run: |
|
|
while [ "$(docker inspect -f '{{ .State.Health.Status}}' node1.emqx.io)" != "healthy" ] || [ "$(docker inspect -f '{{ .State.Health.Status}}' node2.emqx.io)" != "healthy" ]; do
|
|
echo "['$(date -u +"%y-%m-%dt%h:%m:%sz")']:waiting emqx";
|
|
sleep 5;
|
|
done
|
|
while [ $(docker ps -a --filter name=client --filter exited=0 | wc -l) \
|
|
!= $(docker ps -a --filter name=client | wc -l) ]; do
|
|
sleep 1
|
|
done
|
|
docker ps -a
|
|
echo HAPROXY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' haproxy) >> $GITHUB_ENV
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: emqx/emqx-fvt
|
|
ref: broker-autotest
|
|
path: scripts
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '8.0.282' # The JDK version to make available on the path.
|
|
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
|
architecture: x64 # (x64 or x86) - defaults to x64
|
|
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
|
distribution: 'zulu'
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: apache-jmeter.tgz
|
|
path: /tmp
|
|
- name: install jmeter
|
|
timeout-minutes: 10
|
|
env:
|
|
JMETER_VERSION: 5.4.3
|
|
run: |
|
|
cd /tmp && tar -xvf apache-jmeter.tgz
|
|
echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
|
echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
|
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
|
ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
|
|
- name: run jmeter
|
|
run: |
|
|
/opt/jmeter/bin/jmeter.sh \
|
|
-Jjmeter.save.saveservice.output_format=xml -n \
|
|
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
|
|
-Demqx_ip=$HAPROXY_IP \
|
|
-l jmeter_logs/${{ matrix.scripts_type }}.jtl \
|
|
-j jmeter_logs/logs/${{ matrix.scripts_type }}.log
|
|
- name: check logs
|
|
run: |
|
|
if cat jmeter_logs/${{ matrix.scripts_type }}.jtl | grep -e '<failure>true</failure>' > /dev/null 2>&1; then
|
|
echo "check logs filed"
|
|
exit 1
|
|
fi
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: jmeter_logs
|
|
path: ./jmeter_logs
|
|
|
|
pgsql_authn_authz:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
pgsql_tag:
|
|
- 9
|
|
- 10
|
|
- 11
|
|
- 12
|
|
- 13
|
|
scripts_type:
|
|
- pgsql_authn
|
|
- pgsql_authz
|
|
|
|
needs: build_emqx_for_jmeter_tests
|
|
steps:
|
|
- uses: erlef/setup-beam@v1
|
|
with:
|
|
otp-version: "24.2"
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: emqx.tar
|
|
path: /tmp
|
|
- name: load docker image
|
|
run: |
|
|
docker load < /tmp/emqx.tar
|
|
- name: docker compose up
|
|
timeout-minutes: 5
|
|
env:
|
|
_EMQX_DOCKER_IMAGE_TAG: emqx/emqx:${{ needs.build_emqx_for_jmeter_tests.outputs.version }}
|
|
PGSQL_TAG: ${{ matrix.pgsql_tag }}
|
|
run: |
|
|
docker-compose \
|
|
-f .ci/docker-compose-file/docker-compose-emqx-cluster.yaml \
|
|
-f .ci/docker-compose-file/docker-compose-pgsql-tls.yaml \
|
|
up -d --build
|
|
- name: wait docker compose up
|
|
timeout-minutes: 5
|
|
run: |
|
|
while [ "$(docker inspect -f '{{ .State.Health.Status}}' node1.emqx.io)" != "healthy" ] || [ "$(docker inspect -f '{{ .State.Health.Status}}' node2.emqx.io)" != "healthy" ]; do
|
|
echo "['$(date -u +"%y-%m-%dt%h:%m:%sz")']:waiting emqx";
|
|
sleep 5;
|
|
done
|
|
while [ $(docker ps -a --filter name=client --filter exited=0 | wc -l) \
|
|
!= $(docker ps -a --filter name=client | wc -l) ]; do
|
|
sleep 1
|
|
done
|
|
docker ps -a
|
|
echo HAPROXY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' haproxy) >> $GITHUB_ENV
|
|
echo PGSQL_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pgsql-tls) >> $GITHUB_ENV
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: emqx/emqx-fvt
|
|
ref: broker-autotest
|
|
path: scripts
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '8.0.282' # The JDK version to make available on the path.
|
|
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
|
architecture: x64 # (x64 or x86) - defaults to x64
|
|
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
|
distribution: 'zulu'
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: apache-jmeter.tgz
|
|
path: /tmp
|
|
- name: install jmeter
|
|
timeout-minutes: 10
|
|
env:
|
|
JMETER_VERSION: 5.4.3
|
|
run: |
|
|
cd /tmp && tar -xvf apache-jmeter.tgz
|
|
echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
|
echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
|
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
|
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/postgresql-42.2.18.jar https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.18/postgresql-42.2.18.jar
|
|
ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
|
|
- name: run jmeter
|
|
run: |
|
|
/opt/jmeter/bin/jmeter.sh \
|
|
-Jjmeter.save.saveservice.output_format=xml -n \
|
|
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
|
|
-Demqx_ip=$HAPROXY_IP \
|
|
-Ddb_ip=$PGSQL_IP \
|
|
-Dport="5432" \
|
|
-Dpgsql_user="root" \
|
|
-Dpgsql_pwd="public" \
|
|
-Ddbname="mqtt" \
|
|
-Droute="apps/emqx_authn/test/data/certs" \
|
|
-Dca_name="ca.crt" \
|
|
-Dkey_name="client.key" \
|
|
-Dcert_name="client.crt" \
|
|
-l jmeter_logs/${{ matrix.scripts_type }}_${{ matrix.pgsql_tag }}.jtl \
|
|
-j jmeter_logs/logs/${{ matrix.scripts_type }}_${{ matrix.pgsql_tag }}.log
|
|
- name: check logs
|
|
run: |
|
|
if cat jmeter_logs/${{ matrix.scripts_type }}_${{ matrix.pgsql_tag }}.jtl | grep -e '<failure>true</failure>' > /dev/null 2>&1; then
|
|
echo "check logs filed"
|
|
exit 1
|
|
fi
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: jmeter_logs
|
|
path: ./jmeter_logs
|
|
|
|
mysql_authn_authz:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
mysql_tag:
|
|
- 5.7
|
|
- 8
|
|
scripts_type:
|
|
- mysql_authn
|
|
- mysql_authz
|
|
|
|
needs: build_emqx_for_jmeter_tests
|
|
steps:
|
|
- uses: erlef/setup-beam@v1
|
|
with:
|
|
otp-version: "24.2"
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: emqx.tar
|
|
path: /tmp
|
|
- name: load docker image
|
|
run: |
|
|
docker load < /tmp/emqx.tar
|
|
- name: docker compose up
|
|
timeout-minutes: 5
|
|
env:
|
|
_EMQX_DOCKER_IMAGE_TAG: emqx/emqx:${{ needs.build_emqx_for_jmeter_tests.outputs.version }}
|
|
PGSQL_TAG: ${{ matrix.mysql_tag }}
|
|
run: |
|
|
docker-compose \
|
|
-f .ci/docker-compose-file/docker-compose-emqx-cluster.yaml \
|
|
-f .ci/docker-compose-file/docker-compose-mysql-tls.yaml \
|
|
up -d --build
|
|
- name: wait docker compose up
|
|
timeout-minutes: 5
|
|
run: |
|
|
while [ "$(docker inspect -f '{{ .State.Health.Status}}' node1.emqx.io)" != "healthy" ] || [ "$(docker inspect -f '{{ .State.Health.Status}}' node2.emqx.io)" != "healthy" ]; do
|
|
echo "['$(date -u +"%y-%m-%dt%h:%m:%sz")']:waiting emqx";
|
|
sleep 5;
|
|
done
|
|
while [ $(docker ps -a --filter name=client --filter exited=0 | wc -l) \
|
|
!= $(docker ps -a --filter name=client | wc -l) ]; do
|
|
sleep 1
|
|
done
|
|
docker ps -a
|
|
echo HAPROXY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' haproxy) >> $GITHUB_ENV
|
|
echo MYSQL_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql-tls) >> $GITHUB_ENV
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: emqx/emqx-fvt
|
|
ref: broker-autotest
|
|
path: scripts
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '8.0.282' # The JDK version to make available on the path.
|
|
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
|
architecture: x64 # (x64 or x86) - defaults to x64
|
|
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
|
distribution: 'zulu'
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: apache-jmeter.tgz
|
|
path: /tmp
|
|
- name: install jmeter
|
|
timeout-minutes: 10
|
|
env:
|
|
JMETER_VERSION: 5.4.3
|
|
run: |
|
|
cd /tmp && tar -xvf apache-jmeter.tgz
|
|
echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
|
echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
|
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
|
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/mysql-connector-java-8.0.16.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar
|
|
ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
|
|
- name: run jmeter
|
|
run: |
|
|
/opt/jmeter/bin/jmeter.sh \
|
|
-Jjmeter.save.saveservice.output_format=xml -n \
|
|
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
|
|
-Demqx_ip=$HAPROXY_IP \
|
|
-Dmysql_ip=$MYSQL_IP \
|
|
-Dport="3306" \
|
|
-Dmysql_user="root" \
|
|
-Dmysql_pwd="public" \
|
|
-Ddbname="mqtt" \
|
|
-Droute="apps/emqx_authn/test/data/certs" \
|
|
-Dca_name="ca.crt" \
|
|
-Dkey_name="client.key" \
|
|
-Dcert_name="client.crt" \
|
|
-l jmeter_logs/${{ matrix.scripts_type }}_${{ matrix.mysql_tag }}.jtl \
|
|
-j jmeter_logs/logs/${{ matrix.scripts_type }}_${{ matrix.mysql_tag }}.log
|
|
- name: check logs
|
|
run: |
|
|
if cat jmeter_logs/${{ matrix.scripts_type }}_${{ matrix.mysql_tag }}.jtl | grep -e '<failure>true</failure>' > /dev/null 2>&1; then
|
|
echo "check logs filed"
|
|
exit 1
|
|
fi
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: jmeter_logs
|
|
path: ./jmeter_logs
|
|
|
|
JWT_authn:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
scripts_type:
|
|
- jwt_authn
|
|
|
|
needs: build_emqx_for_jmeter_tests
|
|
steps:
|
|
- uses: erlef/setup-beam@v1
|
|
with:
|
|
otp-version: "24.2"
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: emqx.tar
|
|
path: /tmp
|
|
- name: load docker image
|
|
run: |
|
|
docker load < /tmp/emqx.tar
|
|
- name: docker compose up
|
|
timeout-minutes: 5
|
|
env:
|
|
_EMQX_DOCKER_IMAGE_TAG: emqx/emqx:${{ needs.build_emqx_for_jmeter_tests.outputs.version }}
|
|
run: |
|
|
docker-compose \
|
|
-f .ci/docker-compose-file/docker-compose-emqx-cluster.yaml \
|
|
up -d --build
|
|
- name: wait docker compose up
|
|
timeout-minutes: 5
|
|
run: |
|
|
while [ "$(docker inspect -f '{{ .State.Health.Status}}' node1.emqx.io)" != "healthy" ] || [ "$(docker inspect -f '{{ .State.Health.Status}}' node2.emqx.io)" != "healthy" ]; do
|
|
echo "['$(date -u +"%y-%m-%dt%h:%m:%sz")']:waiting emqx";
|
|
sleep 5;
|
|
done
|
|
while [ $(docker ps -a --filter name=client --filter exited=0 | wc -l) \
|
|
!= $(docker ps -a --filter name=client | wc -l) ]; do
|
|
sleep 1
|
|
done
|
|
docker ps -a
|
|
echo HAPROXY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' haproxy) >> $GITHUB_ENV
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: emqx/emqx-fvt
|
|
ref: broker-autotest
|
|
path: scripts
|
|
- name: run jwks_server
|
|
timeout-minutes: 10
|
|
run: |
|
|
cd scripts/jwks-server
|
|
mvn package
|
|
cd target
|
|
docker run --name jwks_server --network emqx_bridge --ip 172.100.239.88 -d -v $(pwd)/jwkserver-0.0.1.jar:/jwks_server/jwkserver-0.0.1.jar --workdir /jwks_server openjdk:8-jdk bash \
|
|
-c "java -jar jwkserver-0.0.1.jar"
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '8.0.282' # The JDK version to make available on the path.
|
|
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
|
architecture: x64 # (x64 or x86) - defaults to x64
|
|
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
|
distribution: 'zulu'
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: apache-jmeter.tgz
|
|
path: /tmp
|
|
- name: install jmeter
|
|
timeout-minutes: 10
|
|
env:
|
|
JMETER_VERSION: 5.4.3
|
|
run: |
|
|
cd /tmp && tar -xvf apache-jmeter.tgz
|
|
echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
|
echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
|
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
|
ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
|
|
- name: run jmeter
|
|
run: |
|
|
/opt/jmeter/bin/jmeter.sh \
|
|
-Jjmeter.save.saveservice.output_format=xml -n \
|
|
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
|
|
-Demqx_ip=$HAPROXY_IP \
|
|
-Djwks_ip="172.100.239.88" \
|
|
-l jmeter_logs/${{ matrix.scripts_type }}.jtl \
|
|
-j jmeter_logs/logs/${{ matrix.scripts_type }}.log
|
|
- name: check logs
|
|
run: |
|
|
if cat jmeter_logs/${{ matrix.scripts_type }}.jtl | grep -e '<failure>true</failure>' > /dev/null 2>&1; then
|
|
echo "check logs filed"
|
|
exit 1
|
|
fi
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: jmeter_logs
|
|
path: ./jmeter_logs
|
|
|
|
built_in_database_authn_authz:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
scripts_type:
|
|
- built_in_database_authn
|
|
- built_in_database_authz
|
|
|
|
needs: build_emqx_for_jmeter_tests
|
|
steps:
|
|
- uses: erlef/setup-beam@v1
|
|
with:
|
|
otp-version: "24.2"
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: emqx.tar
|
|
path: /tmp
|
|
- name: load docker image
|
|
run: |
|
|
docker load < /tmp/emqx.tar
|
|
- name: docker compose up
|
|
timeout-minutes: 5
|
|
env:
|
|
_EMQX_DOCKER_IMAGE_TAG: emqx/emqx:${{ needs.build_emqx_for_jmeter_tests.outputs.version }}
|
|
PGSQL_TAG: ${{ matrix.mysql_tag }}
|
|
run: |
|
|
docker-compose \
|
|
-f .ci/docker-compose-file/docker-compose-emqx-cluster.yaml \
|
|
up -d --build
|
|
- name: wait docker compose up
|
|
timeout-minutes: 5
|
|
run: |
|
|
while [ "$(docker inspect -f '{{ .State.Health.Status}}' node1.emqx.io)" != "healthy" ] || [ "$(docker inspect -f '{{ .State.Health.Status}}' node2.emqx.io)" != "healthy" ]; do
|
|
echo "['$(date -u +"%y-%m-%dt%h:%m:%sz")']:waiting emqx";
|
|
sleep 5;
|
|
done
|
|
while [ $(docker ps -a --filter name=client --filter exited=0 | wc -l) \
|
|
!= $(docker ps -a --filter name=client | wc -l) ]; do
|
|
sleep 1
|
|
done
|
|
docker ps -a
|
|
echo HAPROXY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' haproxy) >> $GITHUB_ENV
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: emqx/emqx-fvt
|
|
ref: broker-autotest
|
|
path: scripts
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '8.0.282' # The JDK version to make available on the path.
|
|
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
|
architecture: x64 # (x64 or x86) - defaults to x64
|
|
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
|
distribution: 'zulu'
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: apache-jmeter.tgz
|
|
path: /tmp
|
|
- name: install jmeter
|
|
timeout-minutes: 10
|
|
env:
|
|
JMETER_VERSION: 5.4.3
|
|
run: |
|
|
cd /tmp && tar -xvf apache-jmeter.tgz
|
|
echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
|
echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
|
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
|
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/mysql-connector-java-8.0.16.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar
|
|
ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
|
|
- name: run jmeter
|
|
run: |
|
|
/opt/jmeter/bin/jmeter.sh \
|
|
-Jjmeter.save.saveservice.output_format=xml -n \
|
|
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
|
|
-Demqx_ip=$HAPROXY_IP \
|
|
-l jmeter_logs/${{ matrix.scripts_type }}_${{ matrix.mysql_tag }}.jtl \
|
|
-j jmeter_logs/logs/${{ matrix.scripts_type }}_${{ matrix.mysql_tag }}.log
|
|
- name: check logs
|
|
run: |
|
|
if cat jmeter_logs/${{ matrix.scripts_type }}_${{ matrix.mysql_tag }}.jtl | grep -e '<failure>true</failure>' > /dev/null 2>&1; then
|
|
echo "check logs filed"
|
|
exit 1
|
|
fi
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: jmeter_logs
|
|
path: ./jmeter_logs
|
|
|
|
delete-artifact:
|
|
runs-on: ubuntu-latest
|
|
needs: [advanced_feat,pgsql_authn_authz,JWT_authn,mysql_authn_authz,built_in_database_authn_authz]
|
|
steps:
|
|
- uses: geekyeggo/delete-artifact@v2
|
|
with:
|
|
name: emqx.tar
|
|
|
|
allgood_integration_tests:
|
|
runs-on: ubuntu-20.04
|
|
needs: [advanced_feat,pgsql_authn_authz,JWT_authn,mysql_authn_authz,built_in_database_authn_authz]
|
|
steps:
|
|
- name: Check if all integration tests succeeded
|
|
uses: re-actors/alls-green@release/v1
|
|
with:
|
|
#allowed-failures:
|
|
#allowed-skips:
|
|
jobs: ${{ toJSON(needs) }}
|