fvt_tests.yaml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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_with_edgex:
  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. timeout-minutes: 10
  23. env:
  24. JMETER_VERSION: 5.2.1
  25. run: |
  26. wget -O /tmp/apache-jmeter.tgz http://us.mirrors.quenda.co/apache//jmeter/binaries/apache-jmeter-$JMETER_VERSION.tgz
  27. cd /tmp && tar -xvf apache-jmeter.tgz
  28. echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
  29. echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
  30. 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
  31. ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
  32. - name: install emqx
  33. env:
  34. EMQX_VERSION: v4.0.2
  35. run: |
  36. wget -O emqx.deb https://www.emqx.io/downloads/broker/v4.0.2/emqx-ubuntu18.04-${EMQX_VERSION}_amd64.deb
  37. sudo dpkg -i emqx.deb
  38. - uses: actions/checkout@v2
  39. - name: build kuiper
  40. run: |
  41. sudo apt update && sudo apt install pkg-config libczmq-dev -y
  42. make build_with_edgex
  43. - name: run edgex && emqx && kuiper
  44. run: |
  45. sudo ./fvt_scripts/setup_env.sh
  46. ln -s _build/kuiper-$(git describe --tags --always)-$(uname -s | tr "[A-Z]" "[a-z]")-x86_64/log kuiper_logs
  47. - name: run fvt tests
  48. timeout-minutes: 5
  49. run: ./fvt_scripts/run_jmeter.sh with_edgex=true
  50. - uses: actions/upload-artifact@v1
  51. if: always()
  52. with:
  53. name: kuiper_logs_with_edgex
  54. path: ./kuiper_logs
  55. - uses: actions/upload-artifact@v1
  56. if: always()
  57. with:
  58. name: jmeter_logs_with_edgex
  59. path: ./jmeter_logs
  60. - name: checkout out
  61. run: |
  62. sudo apt update && sudo apt install -y libxml2-utils
  63. cd jmeter_logs
  64. 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
  65. echo -e "---------------------------------------------\n"
  66. echo "FVT tests error"
  67. exit 1
  68. fi
  69. fvt_tests_without_edgex:
  70. runs-on: ubuntu-latest
  71. steps:
  72. - uses: actions/setup-go@v1
  73. with:
  74. go-version: '1.11.5'
  75. - uses: actions/setup-java@v1
  76. with:
  77. java-version: '8' # The JDK version to make available on the path.
  78. java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
  79. architecture: x64 # (x64 or x86) - defaults to x64
  80. - name: set up jmeter
  81. timeout-minutes: 10
  82. env:
  83. JMETER_VERSION: 5.2.1
  84. run: |
  85. wget -O /tmp/apache-jmeter.tgz http://us.mirrors.quenda.co/apache//jmeter/binaries/apache-jmeter-$JMETER_VERSION.tgz
  86. cd /tmp && tar -xvf apache-jmeter.tgz
  87. echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
  88. echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
  89. 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
  90. ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
  91. - name: install emqx
  92. env:
  93. EMQX_VERSION: v4.0.2
  94. run: |
  95. wget -O emqx.deb https://www.emqx.io/downloads/broker/v4.0.2/emqx-ubuntu18.04-${EMQX_VERSION}_amd64.deb
  96. sudo dpkg -i emqx.deb
  97. - uses: actions/checkout@v2
  98. - name: build kuiper
  99. run: |
  100. sudo apt update && sudo apt install pkg-config libczmq-dev -y
  101. make
  102. - name: run edgex && emqx && kuiper
  103. run: |
  104. sudo ./fvt_scripts/setup_env.sh
  105. ln -s _build/kuiper-$(git describe --tags --always)-$(uname -s | tr "[A-Z]" "[a-z]")-x86_64/log kuiper_logs
  106. - name: run fvt tests
  107. timeout-minutes: 5
  108. run: ./fvt_scripts/run_jmeter.sh with_edgex=false
  109. - uses: actions/upload-artifact@v1
  110. if: always()
  111. with:
  112. name: kuiper_logs_without_edgex
  113. path: ./kuiper_logs
  114. - uses: actions/upload-artifact@v1
  115. if: always()
  116. with:
  117. name: jmeter_logs_without_edgex
  118. path: ./jmeter_logs
  119. - name: checkout out
  120. run: |
  121. sudo apt update && sudo apt install -y libxml2-utils
  122. cd jmeter_logs
  123. 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
  124. echo -e "---------------------------------------------\n"
  125. echo "FVT tests error"
  126. exit 1
  127. fi