Skip to content

Commit

Permalink
fix(build): fix a link error on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Sep 19, 2023
1 parent 22c9181 commit fd9bfa1
Show file tree
Hide file tree
Showing 39 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ scripts/py_utils/*.pyc
cmake-build-debug
packages

src/test/function_test/bulk_load_test/pegasus-bulk-load-function-test-files/
src/test/function_test/bulk_load/pegasus-bulk-load-function-test-files/
config-shell.ini.*
*.tar.gz
pegasus-server*
Expand Down
19 changes: 14 additions & 5 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ function run_test()
echo "test_modules=$test_modules"

# download bulk load test data
if [[ "$test_modules" =~ "bulk_load_test" && ! -d "$ROOT/src/test/function_test/bulk_load_test/pegasus-bulk-load-function-test-files" ]]; then
if [[ "$test_modules" =~ "bulk_load_test" && ! -d "$ROOT/src/test/function_test/bulk_load/pegasus-bulk-load-function-test-files" ]]; then
echo "Start to download files used for bulk load function test"
wget "https://github.com/XiaoMi/pegasus-common/releases/download/deps/pegasus-bulk-load-function-test-files.zip"
unzip "pegasus-bulk-load-function-test-files.zip" -d "$ROOT/src/test/function_test/bulk_load_test"
unzip "pegasus-bulk-load-function-test-files.zip" -d "$ROOT/src/test/function_test/bulk_load"
rm "pegasus-bulk-load-function-test-files.zip"
echo "Prepare files used for bulk load function test succeed"
fi
Expand All @@ -449,17 +449,26 @@ function run_test()
echo "====================== run $module =========================="
# restart onebox when test pegasus
local need_onebox_tests=(
pegasus_geo_test
pegasus_rproxy_test
)
local function_tests=(
backup_restore_test
base_api_test
bulk_load_test
detect_hotspot_test
partition_split_test
pegasus_geo_test
pegasus_rproxy_test
recovery_test
restore_test
throttle_test
)
need_onebox_tests+=(${function_tests[@]})
module_dir=${module}
if [[ "${function_tests[@]}" =~ "${module}" ]]; then
# Remove the "_test" suffix for function tests.
suffix="_test"
module_dir=${module_dir%"${suffix}"}
fi
if [[ "${need_onebox_tests[@]}" =~ "${module}" ]]; then
run_clear_onebox
m_count=3
Expand All @@ -484,7 +493,7 @@ function run_test()
run_stop_zk
run_start_zk
fi
pushd ${BUILD_LATEST_DIR}/bin/$module
pushd ${BUILD_LATEST_DIR}/bin/${module_dir}
REPORT_DIR=${REPORT_DIR} TEST_BIN=${module} TEST_OPTS=${test_opts} ./run.sh
if [ $? != 0 ]; then
echo "run test \"$module\" in `pwd` failed"
Expand Down
3 changes: 2 additions & 1 deletion src/server/info_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@

#pragma once

// IWYU pragma: no_include <bits/std_abs.h>
#include <s2/third_party/absl/base/port.h>
#include <stdint.h>
#include <stdlib.h>
// IWYU pragma: no_include <bits/std_abs.h>
#include <cmath> // IWYU pragma: keep
#include <map>
#include <memory>
#include <string>
Expand Down
16 changes: 8 additions & 8 deletions src/test/function_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
# under the License.

add_subdirectory(utils)
add_subdirectory(backup_restore_test)
add_subdirectory(base_api_test)
add_subdirectory(bulk_load_test)
add_subdirectory(detect_hotspot_test)
add_subdirectory(partition_split_test)
add_subdirectory(recovery_test)
add_subdirectory(restore_test)
add_subdirectory(throttle_test)
add_subdirectory(backup_restore)
add_subdirectory(base_api)
add_subdirectory(bulk_load)
add_subdirectory(detect_hotspot)
add_subdirectory(partition_split)
add_subdirectory(recovery)
add_subdirectory(restore)
add_subdirectory(throttle)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class bulk_load_test : public test_util
ASSERT_NO_FATAL_FAILURE(
run_cmd_from_project_root("mkdir -p onebox/block_service/local_service"));
ASSERT_NO_FATAL_FAILURE(run_cmd_from_project_root(
"cp -r src/test/function_test/bulk_load_test/pegasus-bulk-load-function-test-files/" +
"cp -r src/test/function_test/bulk_load/pegasus-bulk-load-function-test-files/" +
LOCAL_ROOT + " onebox/block_service/local_service"));
string cmd = "echo '{\"app_id\":" + std::to_string(app_id_) +
",\"app_name\":\"temp\",\"partition_count\":8}' > "
Expand All @@ -114,7 +114,7 @@ class bulk_load_test : public test_util
void replace_bulk_load_info()
{
string cmd = "cp -R "
"src/test/function_test/bulk_load_test/pegasus-bulk-load-function-test-files/"
"src/test/function_test/bulk_load/pegasus-bulk-load-function-test-files/"
"mock_bulk_load_info/. " +
bulk_load_local_root_ + "/" + CLUSTER + "/" + app_name_ + "/";
ASSERT_NO_FATAL_FAILURE(run_cmd_from_project_root(cmd));
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ struct throttle_test_recorder

// read/write throttle function test
// the details of records are saved in
// `./src/builder/test/function_test/throttle_test/throttle_test_result.txt`
// `./src/builder/test/function_test/throttle/throttle_test_result.txt`
class throttle_test : public test_util
{
public:
Expand Down
1 change: 1 addition & 0 deletions src/utils/output_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "utils/output_utils.h"

#include <stdlib.h>
// IWYU pragma: no_include <ext/alloc_traits.h>
#include <memory>

Expand Down

0 comments on commit fd9bfa1

Please sign in to comment.