Skip to content

Commit

Permalink
fix(build): fix a link error on macOS (#1615)
Browse files Browse the repository at this point in the history
#1602

Remove the `_test` postfix of function tests to prevent the link errors on macOS look like:
```
[ 50%] Linking CXX executable backup_restore_test
ld: can't write output file to 'backup_restore_test' because that path is a directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/test/function_test/backup_restore_test/backup_restore_test] Error 1
make[1]: *** [src/test/function_test/backup_restore_test/CMakeFiles/backup_restore_test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
```
  • Loading branch information
acelyc111 authored Sep 20, 2023
1 parent 22c9181 commit 7b2bd09
Show file tree
Hide file tree
Showing 39 changed files with 18 additions and 16 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
6 changes: 3 additions & 3 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 Down Expand Up @@ -484,7 +484,7 @@ function run_test()
run_stop_zk
run_start_zk
fi
pushd ${BUILD_LATEST_DIR}/bin/$module
pushd ${BUILD_LATEST_DIR}/bin/${module}
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 7b2bd09

Please sign in to comment.