chore(ci): inspect docker logs after pytest failure

This commit is contained in:
Zaiming Shi 2021-03-25 16:56:58 +01:00 committed by Zaiming (Stone) Shi
parent abf26f01d8
commit 4829814c58
3 changed files with 37 additions and 6 deletions

View File

@ -11,6 +11,7 @@ services:
- "EMQX_CLUSTER__STATIC__SEEDS=emqx@node1.emqx.io, emqx@node2.emqx.io"
- "EMQX_ZONE__EXTERNAL__RETRY_INTERVAL=2s"
- "EMQX_MQTT__MAX_TOPIC_ALIAS=10"
- "EMQX_LOG__LEVEL=debug"
command:
- /bin/sh
- -c
@ -38,6 +39,7 @@ services:
- "EMQX_CLUSTER__STATIC__SEEDS=emqx@node1.emqx.io, emqx@node2.emqx.io"
- "EMQX_ZONE__EXTERNAL__RETRY_INTERVAL=2s"
- "EMQX_MQTT__MAX_TOPIC_ALIAS=10"
- "EMQX_LOG__LEVEL=debug"
command:
- /bin/sh
- -c
@ -64,6 +66,8 @@ services:
tty: true
networks:
emqx-bridge:
volumes:
- ./scripts:/scripts
networks:
emqx-bridge:

22
.ci/fvt_tests/scripts/pytest.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
## This script is to run emqx cluster smoke tests (fvt) in github action
## This script is executed in pacho_client
set -x
set +e
NODE1="node1.emqx.io"
NODE2="node2.emqx.io"
apk update && apk add git curl
git clone -b develop-4.0 https://github.com/emqx/paho.mqtt.testing.git /paho.mqtt.testing
pip install pytest
pytest -v /paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host "$NODE1"
RESULT=$?
pytest -v /paho.mqtt.testing/interoperability/test_cluster --host1 "$NODE1" --host2 "$NODE2"
RESULT=$(( RESULT + $? ))
pytest -v /paho.mqtt.testing/interoperability/test_client --host "$NODE1"
RESULT=$(( RESULT + $? ))
exit $RESULT

View File

@ -44,12 +44,10 @@ jobs:
done
- name: make paho tests
run: |
docker exec -i paho_client sh -c "apk update && apk add git curl \
&& git clone -b develop-4.0 https://github.com/emqx/paho.mqtt.testing.git /paho.mqtt.testing \
&& pip install pytest \
&& pytest -v /paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host node1.emqx.io \
&& pytest -v /paho.mqtt.testing/interoperability/test_cluster --host1 node1.emqx.io --host2 node2.emqx.io \
&& pytest -v /paho.mqtt.testing/interoperability/test_client --host node1.emqx.io"
if ! docker exec -i paho_client /scripts/pytest.sh; then
docker logs node1.emqx.io
docker logs node2.emqx.io
fi
helm_test:
runs-on: ubuntu-20.04
@ -138,7 +136,14 @@ jobs:
emqx2=$(kubectl get pods emqx-2 -o jsonpath='{.status.podIP}')
pytest -v paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host $emqx_svc
RESULT=$?
pytest -v paho.mqtt.testing/interoperability/test_cluster --host1 $emqx1 --host2 $emqx2
RESULT=$((RESULT + $?))
if [ 0 -ne $RESULT ]; then
kubectl logs emqx-1
kubectl logs emqx-2
fi
exit $RESULT
relup_test:
runs-on: ubuntu-20.04