Browse Source

add ds logs and server status check with e2e test (#2277)

pull/3/MERGE
khadgarmage 5 years ago committed by gaojun2048
parent
commit
e37aecdbc7
  1. 14
      .github/workflows/ci_e2e.yml
  2. 10
      dockerfile/hooks/check

14
.github/workflows/ci_e2e.yml

@ -49,7 +49,8 @@ jobs:
- name: Docker Run - name: Docker Run
run: | run: |
VERSION=`cat $(pwd)/pom.xml| grep "SNAPSHOT</version>" | awk -F "-SNAPSHOT" '{print $1}' | awk -F ">" '{print $2}'` VERSION=`cat $(pwd)/pom.xml| grep "SNAPSHOT</version>" | awk -F "-SNAPSHOT" '{print $1}' | awk -F ">" '{print $2}'`
docker run -dit -e POSTGRESQL_USERNAME=test -e POSTGRESQL_PASSWORD=test -p 8888:8888 dolphinscheduler:$VERSION all mkdir -p /tmp/logs
docker run -dit -e POSTGRESQL_USERNAME=test -e POSTGRESQL_PASSWORD=test -v /tmp/logs:/opt/dolphinscheduler/logs -p 8888:8888 dolphinscheduler:$VERSION all
- name: Check Server Status - name: Check Server Status
run: sh ./dockerfile/hooks/check run: sh ./dockerfile/hooks/check
- name: Prepare e2e env - name: Prepare e2e env
@ -65,7 +66,10 @@ jobs:
- name: Run e2e Test - name: Run e2e Test
run: cd ./e2e && mvn -B clean test run: cd ./e2e && mvn -B clean test
- name: Collect logs - name: Collect logs
run: | if: failure()
mkdir -p ${LOG_DIR} uses: actions/upload-artifact@v1
docker logs dolphinscheduler > ${LOG_DIR}/dolphinscheduler.txt with:
continue-on-error: true name: dslogs
path: /tmp/logs

10
dockerfile/hooks/check

@ -16,7 +16,7 @@
# limitations under the License. # limitations under the License.
# #
echo "------ dolphinscheduler check - server - status -------" echo "------ dolphinscheduler check - server - status -------"
sleep 20 sleep 60
server_num=$(docker top `docker container list | grep '/sbin/tini' | awk '{print $1}'`| grep java | grep "dolphinscheduler" | awk -F 'classpath ' '{print $2}' | awk '{print $2}' | sort | uniq -c | wc -l) server_num=$(docker top `docker container list | grep '/sbin/tini' | awk '{print $1}'`| grep java | grep "dolphinscheduler" | awk -F 'classpath ' '{print $2}' | awk '{print $2}' | sort | uniq -c | wc -l)
if [ $server_num -eq 5 ] if [ $server_num -eq 5 ]
then then
@ -25,3 +25,11 @@ else
echo "Server start failed "$server_num echo "Server start failed "$server_num
exit 1 exit 1
fi fi
ready=`curl http://127.0.0.1:8888/dolphinscheduler/login -d 'userName=admin&userPassword=dolphinscheduler123' -v | grep "login success" | wc -l`
if [ $ready -eq 1 ]
then
echo "Servers is ready"
else
echo "Servers is not ready"
exit 1
fi

Loading…
Cancel
Save