Compare commits

..

4 Commits

Author SHA1 Message Date
Jackson Tian
6dd2cf4afe test: add macosx into jobs 2023-09-14 14:39:57 +08:00
时起
8d13c48cce sts support compile on MACOS 2023-09-14 13:58:22 +08:00
Jackson Tian
be6c27326e test: add github action workflow 2023-09-14 13:54:16 +08:00
sdk-team
197159f97b Add value, values, startValue, endValue in ExportModelFeatureTrainingSetTable. 2023-09-13 09:54:04 +00:00
10 changed files with 71 additions and 17 deletions

29
.github/workflows/test.yaml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macosx-latest]
runs-on: ${{ matrix.os }}
env:
CPLUS_INCLUDE_PATH: "/usr/local/include/:/usr/include/jsoncpp/:/usr/local/opt/openssl/include/:/usr/lib/"
steps:
- uses: actions/checkout@v3
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install lcov libcurl4-openssl-dev libssl-dev uuid-dev libjson-c-dev libjsoncpp-dev nodejs npm
- if: ${{ matrix.os == 'macosx-latest' }}
run: brew install lcov libcurl4-openssl-dev libssl-dev uuid-dev libjson-c-dev libjsoncpp-dev nodejs npm
- run: bash ./unit_test.sh
- run: bash ./generate_code_cov.sh
- run: bash ./function_test.sh
- run: bash <(curl -s https://codecov.io/bash)

1
.gitignore vendored
View File

@@ -14,3 +14,4 @@ test/httpserver/nohup.out
.idea
build/
cmake-build-debug/
.DS_Store

View File

@@ -1 +1 @@
1.36.1757
1.36.1758

View File

@@ -183,6 +183,15 @@ if(CMAKE_HOST_WIN32)
target_compile_definitions(core
PRIVATE CURL_STATICLIB
_CRT_SECURE_NO_WARNINGS)
elseif(CMAKE_HOST_APPLE)
MESSAGE(STATUS "core: include & link for MACOS")
target_include_directories(core
PRIVATE /usr/local/include)
target_link_libraries(core
/usr/local/lib/libcrypto.dylib
curl
/usr/local/lib/libjsoncpp.dylib
/usr/local/lib/libuuid.dylib )
else()
target_include_directories(core
PRIVATE /usr/include/jsoncpp)

View File

@@ -7,11 +7,11 @@ if command -v python > /dev/null ; then
MAKE="make -j $(python -c 'import multiprocessing as mp; print(int(mp.cpu_count()))')"
fi
echo $MAKE
echo "$MAKE"
rm -rf sdk_build
mkdir sdk_build
cd sdk_build
cd sdk_build || exit
cmake -DBUILD_PRODUCT="$product" -DBUILD_FUNCTION_TESTS=OFF -DBUILD_UNIT_TESTS=OFF -DENABLE_COVERAGE=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
$MAKE

View File

@@ -1,6 +1,6 @@
#!/bin/bash
cd `dirname $0`
cd $(dirname "$0") || exit
echo '-------build function test----------'
MAKE=make
@@ -8,12 +8,12 @@ if command -v python > /dev/null ; then
MAKE="make -j $(python -c 'import multiprocessing as mp; print(int(mp.cpu_count()))')"
fi
echo $MAKE
echo "$MAKE"
FT_BUILD_DIR=ft_build
rm -rf $FT_BUILD_DIR
mkdir $FT_BUILD_DIR
cd $FT_BUILD_DIR
cd $FT_BUILD_DIR || exit
cmake -DBUILD_FUNCTION_TESTS=ON -DBUILD_UNIT_TESTS=OFF ..
$MAKE cdn core cs ecs rds slb vpc cdn_ft core_ft cs_ft ecs_ft nlp_ft rds_ft slb_ft vpc_ft

View File

@@ -37,10 +37,12 @@ namespace AlibabaCloud
ExportModelFeatureTrainingSetTableResult();
explicit ExportModelFeatureTrainingSetTableResult(const std::string &payload);
~ExportModelFeatureTrainingSetTableResult();
std::string getTaskId()const;
protected:
void parse(const std::string &payload);
private:
std::string taskId_;
};
}

View File

@@ -39,6 +39,13 @@ void ExportModelFeatureTrainingSetTableResult::parse(const std::string &payload)
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["TaskId"].isNull())
taskId_ = value["TaskId"].asString();
}
std::string ExportModelFeatureTrainingSetTableResult::getTaskId()const
{
return taskId_;
}

View File

@@ -80,6 +80,12 @@ if(CMAKE_HOST_WIN32)
set_target_properties(sts
PROPERTIES
COMPILE_OPTIONS "/bigobj")
elseif(CMAKE_HOST_APPLE)
MESSAGE(STATUS "sts: include & link for MACOS")
target_include_directories(sts
PRIVATE /usr/local/include)
target_link_libraries(sts
/usr/local/lib/libjsoncpp.dylib)
else()
target_include_directories(sts
PRIVATE /usr/include/jsoncpp)

View File

@@ -1,31 +1,31 @@
#!/bin/bash
cd `dirname $0`
cd $(dirname "$0") || exit
echo '-------build unit test----------'
echo 'start a test http server'
NODE=`which nodejs`
NODE=$(which nodejs)
if [ "$NODE" ]
then
echo ''
else
NODE=`which node`
NODE=$(which node)
fi
echo 'node binary path: ' $NODE
echo 'node binary path: ' "$NODE"
server=`ps -ef | grep http_test_server | grep -v grep`
echo "check server: " $server
server=$(ps -ef | grep http_test_server | grep -v grep)
echo "check server: " "$server"
if [ "$server" ]
then
echo "server is on"
else
echo "server is off, start it"
cd test/httpserver
cd test/httpserver || exit
npm i
nohup $NODE http_test_server.js &
cd -
nohup "$NODE" http_test_server.js &
cd - || exit
fi
MAKE=make
@@ -33,12 +33,12 @@ if command -v python > /dev/null ; then
MAKE="make -j $(python -c 'import multiprocessing as mp; print(int(mp.cpu_count()))')"
fi
echo $MAKE
echo "$MAKE"
UT_BUILD_DIR=ut_build
rm -rf $UT_BUILD_DIR
mkdir $UT_BUILD_DIR
cd $UT_BUILD_DIR
cd $UT_BUILD_DIR || exit
cmake -DBUILD_FUNCTION_TESTS=OFF -DBUILD_UNIT_TESTS=ON -DENABLE_COVERAGE=ON ..
$MAKE core_ut