| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- name: API Test Suite
- concurrency:
- group: apt-${{ github.event_name }}-${{ github.ref }}
- cancel-in-progress: true
- on:
- push:
- tags:
- - e*
- - v*
- pull_request:
- jobs:
- build:
- runs-on: ubuntu-latest
- container: "ghcr.io/emqx/emqx-builder/5.0:23.2.7.2-emqx-2-ubuntu20.04"
- steps:
- - uses: actions/checkout@v2
- - name: zip emqx-broker
- if: endsWith(github.repository, 'emqx')
- run: |
- make emqx-zip
- - name: zip emqx-broker
- if: endsWith(github.repository, 'enterprise')
- run: |
- echo "https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com" > $HOME/.git-credentials
- git config --global credential.helper store
- make emqx-ee-zip
- - uses: actions/upload-artifact@v2
- with:
- name: emqx-broker
- path: _packages/**/*.zip
- api-test:
- needs: build
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- script_name:
- - api_metrics
- - api_subscriptions
- - api_clients
- - api_routes
- - api_publish
- - api_user
- - api_login
- - api_banned
- - api_alarms
- - api_nodes
- - api_topic_metrics
- - api_retainer
- - api_auto_subscribe
- - api_delayed_publish
- - api_topic_rewrite
- - api_event_message
- - api_stats
- steps:
- - uses: actions/checkout@v2
- with:
- repository: emqx/emqx-fvt
- ref: 1.0.2-dev1
- path: .
- - uses: actions/setup-java@v1
- 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
- - uses: actions/download-artifact@v2
- with:
- name: emqx-broker
- path: .
- - name: start emqx-broker
- env:
- EMQX_LISTENERS__WSS__DEFAULT__BIND: "0.0.0.0:8085"
- run: |
- unzip ./emqx/*.zip
- ./emqx/bin/emqx start
- - name: install jmeter
- timeout-minutes: 10
- env:
- JMETER_VERSION: 5.3
- run: |
- wget --no-verbose --no-check-certificate -O /tmp/apache-jmeter.tgz https://downloads.apache.org/jmeter/binaries/apache-jmeter-$JMETER_VERSION.tgz
- 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 ${{ matrix.script_name }}
- run: |
- /opt/jmeter/bin/jmeter.sh \
- -Jjmeter.save.saveservice.output_format=xml -n \
- -t .ci/api-test-suite/${{ matrix.script_name }}.jmx \
- -Demqx_ip="127.0.0.1" \
- -l jmeter_logs/${{ matrix.script_name }}.jtl \
- -j jmeter_logs/logs/${{ matrix.script_name }}.log
- - name: check test logs
- run: |
- if cat jmeter_logs/${{ matrix.script_name }}.jtl | grep -e '<failure>true</failure>' > /dev/null 2>&1; then
- grep -A 5 -B 3 '<failure>true</failure>' jmeter_logs/${{ matrix.script_name }}.jtl > jmeter_logs/${{ matrix.script_name }}_err_api.txt
- echo "check logs failed"
- exit 1
- fi
- - uses: actions/upload-artifact@v1
- if: failure()
- with:
- name: jmeter_logs
- path: ./jmeter_logs
- delete-package:
- runs-on: ubuntu-20.04
- needs: api-test
- if: always()
- steps:
- - uses: geekyeggo/delete-artifact@v1
- with:
- name: emqx-broker
|