mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
docs: Verify/review config descriptions (#1960)
- Reviewed and modified descriptions. - Added some minor formatting. - Removed the "Key:" before every key name, seems redundant.
This commit is contained in:
@@ -97,13 +97,13 @@ protected:
|
||||
{"log_directory", ConfigValue{ConfigType::String}.optional()},
|
||||
|
||||
{"log_rotation_size",
|
||||
ConfigValue{ConfigType::Integer}.defaultValue(2048).withConstraint(config::gValidateLogSize)},
|
||||
ConfigValue{ConfigType::Integer}.defaultValue(2048).withConstraint(config::gValidateUint32)},
|
||||
|
||||
{"log_directory_max_size",
|
||||
ConfigValue{ConfigType::Integer}.defaultValue(50 * 1024).withConstraint(config::gValidateLogSize)},
|
||||
ConfigValue{ConfigType::Integer}.defaultValue(50 * 1024).withConstraint(config::gValidateUint32)},
|
||||
|
||||
{"log_rotation_hour_interval",
|
||||
ConfigValue{ConfigType::Integer}.defaultValue(12).withConstraint(config::gValidateLogRotationTime)},
|
||||
ConfigValue{ConfigType::Integer}.defaultValue(12).withConstraint(config::gValidateUint32)},
|
||||
|
||||
{"log_tag_style", ConfigValue{ConfigType::String}.defaultValue("none")},
|
||||
};
|
||||
|
||||
@@ -213,7 +213,10 @@ TEST_F(CliArgsTestsWithTmpFile, Parse_ConfigDescriptionFileContent)
|
||||
|
||||
auto const fileContent = buffer.str();
|
||||
EXPECT_TRUE(fileContent.find("# Clio Config Description") != std::string::npos);
|
||||
EXPECT_TRUE(fileContent.find("This file lists all Clio Configuration definitions in detail.") != std::string::npos);
|
||||
EXPECT_TRUE(
|
||||
fileContent.find("This document provides a list of all available Clio configuration properties in detail.") !=
|
||||
std::string::npos
|
||||
);
|
||||
EXPECT_TRUE(fileContent.find("## Configuration Details") != std::string::npos);
|
||||
|
||||
// all keys that exist in clio config should be listed in config description file
|
||||
|
||||
@@ -173,10 +173,11 @@ TEST(ConfigDescription, GetValues)
|
||||
|
||||
EXPECT_EQ(
|
||||
definition.get("database.type"),
|
||||
"Type of database to use. We currently support Cassandra and Scylladb. We default to Scylladb."
|
||||
"Specifies the type of database used for storing and retrieving data required by the Clio server. Both "
|
||||
"ScyllaDB and Cassandra can serve as backends for Clio; however, this value must be set to `cassandra`."
|
||||
);
|
||||
EXPECT_EQ(definition.get("etl_sources.[].ip"), "IP address of the ETL source.");
|
||||
EXPECT_EQ(definition.get("prometheus.enabled"), "Enable or disable Prometheus metrics.");
|
||||
EXPECT_EQ(definition.get("etl_sources.[].ip"), "The IP address of the ETL source.");
|
||||
EXPECT_EQ(definition.get("prometheus.enabled"), "Enables or disables Prometheus metrics.");
|
||||
}
|
||||
|
||||
struct ConfigDescriptionAssertTest : common::util::WithMockAssert {};
|
||||
|
||||
@@ -236,7 +236,7 @@ TEST_F(ConstraintTest, SetValuesOnNumberConstraint)
|
||||
auto positiveNum = ConfigValue{ConfigType::Integer}.defaultValue(20u).withConstraint(gValidateUint16);
|
||||
auto const err = positiveNum.setValue(-22, "key");
|
||||
EXPECT_TRUE(err.has_value());
|
||||
EXPECT_EQ(err->error, fmt::format("key Number must be between {} and {}", 0, 65535));
|
||||
EXPECT_EQ(err->error, fmt::format("key Number must be between {} and {}", 1, 65535));
|
||||
EXPECT_FALSE(positiveNum.setValue(99, "key"));
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
ConstraintTestBundle{"ipConstraint", gValidateIp},
|
||||
ConstraintTestBundle{"channelConstraint", gValidateChannelName},
|
||||
ConstraintTestBundle{"logLevelConstraint", gValidateLogLevelName},
|
||||
ConstraintTestBundle{"cannsandraNameCnstraint", gValidateCassandraName},
|
||||
ConstraintTestBundle{"cassandraNameConstraint", gValidateCassandraName},
|
||||
ConstraintTestBundle{"loadModeConstraint", gValidateLoadMode},
|
||||
ConstraintTestBundle{"ChannelNameConstraint", gValidateChannelName},
|
||||
ConstraintTestBundle{"ApiVersionConstraint", gValidateApiVersion},
|
||||
|
||||
Reference in New Issue
Block a user