pytest.sh 977 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. ## This script is to run emqx cluster smoke tests (fvt) in github action
  3. ## This script is executed in paho_client
  4. set -x
  5. set +e
  6. EMQX_TEST_DB_BACKEND=$1
  7. if [ "$EMQX_TEST_DB_BACKEND" = "rlog" ]
  8. then
  9. # TODO: target only replica to avoid replication races
  10. # see: https://github.com/emqx/emqx/issues/6094
  11. TARGET_HOST="node2.emqx.io"
  12. else
  13. # use loadbalancer
  14. TARGET_HOST="haproxy"
  15. fi
  16. apk update && apk add git curl
  17. git clone -b develop-5.0 https://github.com/emqx/paho.mqtt.testing.git /paho.mqtt.testing
  18. pip install pytest==7.1.2 pytest-retry==1.3.0
  19. pytest --retries 3 -v /paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host "$TARGET_HOST"
  20. RESULT=$?
  21. pytest --retries 3 -v /paho.mqtt.testing/interoperability/test_client --host "$TARGET_HOST"
  22. RESULT=$(( RESULT + $? ))
  23. # pytest -v /paho.mqtt.testing/interoperability/test_cluster --host1 "node1.emqx.io" --host2 "node2.emqx.io"
  24. # RESULT=$(( RESULT + $? ))
  25. exit $RESULT