forked from TuGraph-family/tugraph-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub_ci.sh
93 lines (83 loc) · 2.99 KB
/
github_ci.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
set -e
ASAN=$1
TEST=$2
WITH_PROCEDURE=${3:-"OFF"}
cd $WORKSPACE
# cpplint check
bash ./cpplint/doc_gen.sh
bash ./cpplint/check_all.sh
# build deps
cd deps
bash ./build_deps.sh -j2
# build tugraph
cd $WORKSPACE
mkdir build && cd build
if [[ "$ASAN" == "asan" ]]; then
echo 'build with asan ...'
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON -DBUILD_PROCEDURE=$WITH_PROCEDURE
else
cmake .. -DCMAKE_BUILD_TYPE=Coverage -DBUILD_PROCEDURE=$WITH_PROCEDURE
fi
make -j2
if [[ "$TEST" == "ut" ]]; then
# build tugraph db management
#cd $WORKSPACE/deps/tugraph-db-management/
#sh local_build.sh
#cp target/tugraph-db-management-*.jar $WORKSPACE/build/output/
# unittest
mkdir -p $WORKSPACE/testresult/gtest/
cd $WORKSPACE/build/output
ln -s ../../test/integration/data ./
OMP_NUM_THREADS=2 ./fma_unit_test -t all
if [[ "$ASAN" == "asan" ]]; then
export LSAN_OPTIONS=suppressions=$WORKSPACE/test/asan.suppress
else
export LD_PRELOAD=$WORKSPACE/build/output/liblgraph.so
fi
OMP_NUM_THREADS=2 ./unit_test --gtest_output=xml:$WORKSPACE/testresult/gtest/
rm -rf testdb* .import_tmp
if [[ "$ASAN" == "asan" ]]; then
exit 0
fi
# codecov
cd $WORKSPACE
bash ./ci/codecov.sh $WORKSPACE/build $WORKSPACE/testresult
# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) -f $WORKSPACE/testresult/coverage.info -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports"
python3 ./ci/lcov_cobertura.py $WORKSPACE/testresult/coverage.info --output $WORKSPACE/testresult/coverage.xml --demangle
else
# build java client
#cd $WORKSPACE/deps/tugraph-db-client-java/
#sh local_build.sh
#cp rpc-client-test/target/tugraph-db-java-rpc-client-test-*.jar $WORKSPACE/build/output/
#cp ogm/tugraph-db-ogm-test/target/tugraph-db-ogm-test-*.jar $WORKSPACE/build/output/
# build cpp client test
export LD_PRELOAD=$WORKSPACE/build/output/liblgraph.so
cd $WORKSPACE/test/test_rpc_client
sh ./cpp/CppClientTest/compile.sh
cp -r ./cpp/CppClientTest/build/clienttest $WORKSPACE/build/output/
#cd $WORKSPACE/src/client/python/TuGraphClient
# install TuGraphClient
#python3 setup.py install
# run TuGraphClient unit_tests
#python3 setup.py test
# integrate tests
cd $WORKSPACE/build/output
cp ../../src/client/python/TuGraphClient/TuGraphClient.py .
cp ../../src/client/python/TuGraphClient/TuGraphRestClient.py .
cp -r ../../test/integration/* ./
cp -r ../../learn/examples/* ./
cp -r ../../demo/movie .
if [[ "$WITH_PROCEDURE" == "OFF" ]]; then
rm -rf test_algo.py test_sampling.py test_train.py test_algo_v2.py
fi
pytest ./
# codecov
cd $WORKSPACE
mkdir testresult
bash ./ci/codecov.sh $WORKSPACE/build $WORKSPACE/testresult
# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) -f $WORKSPACE/testresult/coverage.info -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports"
python3 ./ci/lcov_cobertura.py $WORKSPACE/testresult/coverage.info --output $WORKSPACE/testresult/coverage.xml --demangle
fi