mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 03:35:55 +00:00
@@ -3,12 +3,6 @@ The correctness of new implementations can be verified via running unit tests. B
|
||||
## Requirements
|
||||
### 1. Cassandra cluster
|
||||
Have access to a **local (127.0.0.1)** Cassandra cluster, opened at port **9042**. Please ensure that the cluster is successfully running before running Unit Tests.
|
||||
### 2. Postgres server
|
||||
Have access to a **local (127.0.0.1)** Postgres server, opened at port **5432**. The server must also have a super user named **postgres** with password set to **postgres**. In addition, modify *postgresql.conf* with the following field values:
|
||||
```
|
||||
max_connections = 1000
|
||||
shared_buffers = 1280MB
|
||||
```
|
||||
## Running
|
||||
To run the unit tests, first build Clio as normal, then execute `./clio_tests` to run the unit tests.
|
||||
|
||||
@@ -28,4 +22,4 @@ TEST(module_name, test_name)
|
||||
{
|
||||
// Test code goes here
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
@@ -37,20 +37,7 @@ TEST(BackendTest, Basic)
|
||||
{"max_requests_outstanding", 1000},
|
||||
{"indexer_key_shift", 2},
|
||||
{"threads", 8}}}}}};
|
||||
boost::json::object postgresConfig{
|
||||
{"database",
|
||||
{{"type", "postgres"},
|
||||
{"experimental", true},
|
||||
{"postgres",
|
||||
{{"contact_point", "127.0.0.1"},
|
||||
{"username", "postgres"},
|
||||
{"database", keyspace.c_str()},
|
||||
{"password", "postgres"},
|
||||
{"indexer_key_shift", 2},
|
||||
{"max_connections", 100},
|
||||
{"threads", 8}}}}}};
|
||||
std::vector<boost::json::object> configs = {
|
||||
cassandraConfig, postgresConfig};
|
||||
std::vector<boost::json::object> configs = {cassandraConfig};
|
||||
for (auto& config : configs)
|
||||
{
|
||||
std::cout << keyspace << std::endl;
|
||||
@@ -1853,20 +1840,7 @@ TEST(Backend, cacheIntegration)
|
||||
{"max_requests_outstanding", 1000},
|
||||
{"indexer_key_shift", 2},
|
||||
{"threads", 8}}}}}};
|
||||
boost::json::object postgresConfig{
|
||||
{"database",
|
||||
{{"type", "postgres"},
|
||||
{"experimental", true},
|
||||
{"postgres",
|
||||
{{"contact_point", "127.0.0.1"},
|
||||
{"username", "postgres"},
|
||||
{"database", keyspace.c_str()},
|
||||
{"password", "postgres"},
|
||||
{"indexer_key_shift", 2},
|
||||
{"max_connections", 100},
|
||||
{"threads", 8}}}}}};
|
||||
std::vector<boost::json::object> configs = {
|
||||
cassandraConfig, postgresConfig};
|
||||
std::vector<boost::json::object> configs = {cassandraConfig};
|
||||
for (auto& config : configs)
|
||||
{
|
||||
std::cout << keyspace << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user