mirror of
https://github.com/wassname/ray.git
synced 2026-09-11 12:43:20 +08:00
[TEST]Use manager class to start/stop components instead of spreading duplicated codes everywhere (#8500)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <unistd.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "queue/queue_client.h"
|
||||
#include "ray/common/test_util.h"
|
||||
#include "ray/core_worker/core_worker.h"
|
||||
|
||||
#include "data_reader.h"
|
||||
@@ -16,24 +17,16 @@ using namespace std::placeholders;
|
||||
namespace ray {
|
||||
namespace streaming {
|
||||
|
||||
static std::string store_executable;
|
||||
static std::string raylet_executable;
|
||||
static std::string gcs_server_executable;
|
||||
static std::string actor_executable;
|
||||
static int node_manager_port;
|
||||
|
||||
class StreamingWriterTest : public StreamingQueueTestBase {
|
||||
public:
|
||||
StreamingWriterTest()
|
||||
: StreamingQueueTestBase(1, raylet_executable, store_executable, node_manager_port,
|
||||
actor_executable, gcs_server_executable) {}
|
||||
StreamingWriterTest() : StreamingQueueTestBase(1, node_manager_port) {}
|
||||
};
|
||||
|
||||
class StreamingExactlySameTest : public StreamingQueueTestBase {
|
||||
public:
|
||||
StreamingExactlySameTest()
|
||||
: StreamingQueueTestBase(1, raylet_executable, store_executable, node_manager_port,
|
||||
actor_executable, gcs_server_executable) {}
|
||||
StreamingExactlySameTest() : StreamingQueueTestBase(1, node_manager_port) {}
|
||||
};
|
||||
|
||||
TEST_P(StreamingWriterTest, streaming_writer_exactly_once_test) {
|
||||
@@ -57,11 +50,14 @@ INSTANTIATE_TEST_CASE_P(StreamingTest, StreamingExactlySameTest,
|
||||
int main(int argc, char **argv) {
|
||||
// set_streaming_log_config("streaming_writer_test", StreamingLogLevel::INFO, 0);
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
RAY_CHECK(argc == 6);
|
||||
ray::streaming::store_executable = std::string(argv[1]);
|
||||
ray::streaming::raylet_executable = std::string(argv[2]);
|
||||
RAY_CHECK(argc == 9);
|
||||
ray::TEST_STORE_EXEC_PATH = std::string(argv[1]);
|
||||
ray::TEST_RAYLET_EXEC_PATH = std::string(argv[2]);
|
||||
ray::streaming::node_manager_port = std::stoi(std::string(argv[3]));
|
||||
ray::streaming::actor_executable = std::string(argv[4]);
|
||||
ray::streaming::gcs_server_executable = std::string(argv[5]);
|
||||
ray::TEST_MOCK_WORKER_EXEC_PATH = std::string(argv[4]);
|
||||
ray::TEST_GCS_SERVER_EXEC_PATH = std::string(argv[5]);
|
||||
ray::TEST_REDIS_SERVER_EXEC_PATH = std::string(argv[6]);
|
||||
ray::TEST_REDIS_MODULE_LIBRARY_PATH = std::string(argv[7]);
|
||||
ray::TEST_REDIS_CLIENT_EXEC_PATH = std::string(argv[8]);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user