pytest.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. ## Use 5.1.0 to bypass the newly added test cases in
  18. ## https://github.com/emqx/paho.mqtt.testing/pull/13
  19. ## This is a temporary solution for 5.1.0 release. After 5.1.0 release, we should use
  20. ## the develop-5.0 branch
  21. git clone -b 5.1.0 https://github.com/emqx/paho.mqtt.testing.git /paho.mqtt.testing
  22. pip install pytest==7.1.2 pytest-retry
  23. pytest --retries 3 -v /paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host "$TARGET_HOST"
  24. RESULT=$?
  25. pytest --retries 3 -v /paho.mqtt.testing/interoperability/test_client --host "$TARGET_HOST"
  26. RESULT=$(( RESULT + $? ))
  27. # pytest -v /paho.mqtt.testing/interoperability/test_cluster --host1 "node1.emqx.io" --host2 "node2.emqx.io"
  28. # RESULT=$(( RESULT + $? ))
  29. exit $RESULT