Fix log dir config env issue
@@ -19,12 +19,20 @@ use futures::TryStreamExt;
use pretty_assertions::assert_eq;
use crate::catalogs::Table;
+use crate::clusters::Cluster;
+use crate::configs::Config;
use crate::datasources::system::configs_table::ConfigsTable;
+use crate::sessions::SessionManager;
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn test_configs_table() -> Result<()> {
- let ctx = crate::tests::try_create_context()?;
- ctx.get_settings().set_max_threads(2)?;
+ let config = Config::default();
+ let cluster = Cluster::empty();
+
+ let sessions = SessionManager::from_conf(config, cluster)?;
+ let test_session = sessions.create_session("TestSession")?;
+ let ctx = test_session.create_context();
+ ctx.get_settings().set_max_threads(8)?;
let table = ConfigsTable::create();
let source_plan = table.read_plan(
@@ -40,9 +48,9 @@ async fn test_configs_table() -> Result<()> {
assert_eq!(block.num_rows(), 28);
let expected = vec![
- "+-----------------------------------+---------------------------------------------------------------------+-------+-------------+",
+ "+-----------------------------------+----------------+-------+-------------+",
"| name | value | group | description |",
- "+-----------------------------------+---------------------------------------------------------------------+-------+-------------+",
+ "+-----------------------------------+----------------+-------+-------------+",
"| api_tls_server_cert | | query | |",
"| api_tls_server_key | | query | |",
"| clickhouse_handler_host | 127.0.0.1 | query | |",
@@ -50,7 +58,7 @@ async fn test_configs_table() -> Result<()> {
"| disable_local_database_engine | 0 | query | |",
"| flight_api_address | 127.0.0.1:9090 | query | |",
"| http_api_address | 127.0.0.1:8080 | query | |",
- "| log_dir | /Users/kaichen/Documents/projects/datafuse/query/../tests/data/logs | log | |",
+ "| log_dir | ./_logs | log | |",
"| log_level | INFO | log | |",
"| max_active_sessions | 256 | query | |",
"| meta_address | | meta | |",
@@ -71,7 +79,7 @@ async fn test_configs_table() -> Result<()> {
"| store_address | | store | |",
"| store_password | | store | |",
"| store_username | root | store | |",
- "+-----------------------------------+---------------------------------------------------------------------+-------+-------------+",
+ "+-----------------------------------+----------------+-------+-------------+",
];
common_datablocks::assert_blocks_sorted_eq(expected, result.as_slice());
Ok(())
