forked from flink-extended/dl-on-flink
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_tests.sh
executable file
·76 lines (69 loc) · 2.52 KB
/
run_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
##
## Licensed to the Apache Software Foundation (ASF) under one
## or more contributor license agreements. See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership. The ASF licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing,
## software distributed under the License is distributed on an
## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
## KIND, either express or implied. See the License for the
## specific language governing permissions and limitations
## under the License.
##
set -e
CURRENT_DIR=`pwd`
trap "cd ${CURRENT_DIR}" EXIT
SOURCE_ROOT=$(cd "$(dirname "$0")";pwd)
echo ${SOURCE_ROOT}
export PYTHONPATH=${SOURCE_ROOT}
cd ${SOURCE_ROOT}
function run_tests() {
code_path=$1
test_files=$(find ${code_path} | grep -v __pycache__ | grep -v temp | grep test_ | grep "\.py$")
for i in ${test_files}
do
echo "RUN TEST: ${i}"
FILE_NAME=`basename ${i}`
DIR_NAME=`dirname ${i}`
cd ${DIR_NAME} && python3 -m unittest ${FILE_NAME}
cd ${SOURCE_ROOT}
sleep 2
done
}
function run_test_class() {
dir_name=$1
class_name=$2
echo "RUN TEST: ${2}"
cd ${dir_name} && python3 -m unittest ${class_name}
cd ${SOURCE_ROOT}
}
# python3 -m unittest discover -v ai_flow.test.api
mvn verify
run_tests 'ai_flow/test/common/'
run_tests 'ai_flow/test/graph'
run_tests 'ai_flow/test/workflow'
run_tests 'ai_flow/test/project'
run_tests 'ai_flow/test/context'
run_tests 'ai_flow/test/ai_graph'
run_tests 'ai_flow/test/translator'
run_tests 'ai_flow/test/runtime'
run_tests 'ai_flow/test/plugin_interface'
run_tests 'ai_flow/test/scheduler'
run_tests 'ai_flow/test/api'
run_tests 'ai_flow/test/util'
run_tests 'ai_flow/test/store/'
run_tests 'ai_flow/test/endpoint/server/'
run_test_class 'ai_flow/test/endpoint/' 'test_client.TestAIFlowClientSqlite'
run_test_class 'ai_flow/test/endpoint/' 'test_mysql_client.TestAIFlowClientMySQL'
run_test_class 'ai_flow/test/endpoint/' 'test_high_availability.TestHighAvailableAIFlowServer'
run_test_class 'ai_flow/test/endpoint/' 'test_java_client.JavaAIFlowClientTest'
run_tests 'ai_flow_plugins/tests/blob_manager_plugins'
run_tests 'ai_flow_plugins/tests/job_plugins'
run_tests 'ai_flow_plugins/tests/scheduler_plugins'