fvt_tests.yaml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. name: Run fvt tests
  2. on:
  3. push:
  4. pull_request:
  5. release:
  6. types:
  7. - published
  8. - prereleased
  9. jobs:
  10. fvt_tests:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/setup-go@v1
  14. with:
  15. go-version: '1.11.5'
  16. - uses: actions/setup-java@v1
  17. with:
  18. java-version: '8' # The JDK version to make available on the path.
  19. java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
  20. architecture: x64 # (x64 or x86) - defaults to x64
  21. - name: set up jmeter
  22. env:
  23. JMETER_VERSION: 5.2.1
  24. run: |
  25. wget -O /tmp/apache-jmeter.tgz http://mirror.bit.edu.cn/apache//jmeter/binaries/apache-jmeter-$JMETER_VERSION.tgz
  26. cd /tmp && tar -xvf apache-jmeter.tgz
  27. echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
  28. echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
  29. wget -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-1.13-jar-with-dependencies.jar https://github.com/emqx/mqtt-jmeter/raw/master/Download/v1.13.0/mqtt-xmeter-1.13-jar-with-dependencies.jar
  30. ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
  31. - name: install emqx
  32. env:
  33. EMQX_VERSION: v4.0.2
  34. run: |
  35. wget -O emqx.deb https://www.emqx.io/downloads/broker/v4.0.2/emqx-ubuntu18.04-${EMQX_VERSION}_amd64.deb
  36. sudo dpkg -i emqx.deb
  37. - uses: actions/checkout@v2
  38. - name: build kuiper
  39. run: make
  40. - name: run emqx and kuiper
  41. run: sudo ./fvt_scripts/setup_env.sh
  42. - name: run fvt tests
  43. timeout-minutes: 5
  44. run: ./fvt_scripts/run_jmeter.sh
  45. - uses: actions/upload-artifact@v1
  46. with:
  47. name: jmeter.logs
  48. path: ./jmeter_logs
  49. - name: checkout out
  50. run: |
  51. sudo apt update && sudo apt install -y libxml2-utils
  52. cd jmeter_logs
  53. if [ "$(xmllint --format --xpath '/testResults/sample/@rc' $(ls *.jtl) | sed -r 's/ /\n/g;' | sort -u | grep -E 'rc=\"[45][0-9][0-9]\"|rc=\"\"')" != "" ]; then
  54. echo -e "---------------------------------------------\n"
  55. echo "FVT tests error"
  56. exit 1
  57. fi