fvt_tests.yaml 5.8 KB

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