Skip to content

Commit

Permalink
Merge pull request databendlabs#3295 from PsiACE/new-query-tests
Browse files Browse the repository at this point in the history
[test] apply the new test style to databend-query
  • Loading branch information
BohuTANG authored Dec 8, 2021
2 parents 4c79bb6 + e57923f commit 4ad00e3
Show file tree
Hide file tree
Showing 191 changed files with 1,872 additions and 1,827 deletions.
4 changes: 4 additions & 0 deletions query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ license = "Apache-2.0"
publish = false
edition = "2021"

[lib]
doctest = false
test = false

[[bin]]
name = "databend-query"
path = "src/bin/databend-query.rs"
Expand Down
9 changes: 0 additions & 9 deletions query/src/api/http/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(test)]
mod cluster_test;
#[cfg(test)]
mod config_test;
#[cfg(test)]
mod health_test;
#[cfg(test)]
mod logs_test;

pub mod cluster;
pub mod config;
pub mod health;
Expand Down
10 changes: 4 additions & 6 deletions query/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@
pub use http_service::HttpService;
pub use rpc::BroadcastAction;
pub use rpc::CancelAction;
pub use rpc::DatabendQueryFlightDispatcher;
pub use rpc::DatabendQueryFlightService;
pub use rpc::FlightAction;
pub use rpc::FlightClient;
pub use rpc::FlightTicket;
pub use rpc::ShuffleAction;
pub use rpc::StreamTicket;
pub use rpc_service::RpcService;

mod http;
pub mod http;
mod http_service;
mod rpc;
mod rpc_service;

#[cfg(test)]
mod http_service_test;
#[cfg(test)]
mod rpc_service_test;
13 changes: 1 addition & 12 deletions query/src/api/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(test)]
mod flight_dispatcher_test;

#[cfg(test)]
mod flight_service_test;

#[cfg(test)]
mod flight_actions_test;

#[cfg(test)]
mod flight_tickets_test;

pub use flight_actions::BroadcastAction;
pub use flight_actions::CancelAction;
pub use flight_actions::FlightAction;
Expand All @@ -32,6 +20,7 @@ pub use flight_client::FlightClient;
pub use flight_dispatcher::DatabendQueryFlightDispatcher;
pub use flight_service::DatabendQueryFlightService;
pub use flight_tickets::FlightTicket;
pub use flight_tickets::StreamTicket;

mod flight_actions;
mod flight_client;
Expand Down
6 changes: 3 additions & 3 deletions query/src/api/rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ use crate::servers::Server as DatabendQueryServer;
use crate::sessions::SessionManager;

pub struct RpcService {
pub(crate) sessions: Arc<SessionManager>,
pub(crate) abort_notify: Arc<Notify>,
pub(crate) dispatcher: Arc<DatabendQueryFlightDispatcher>,
pub sessions: Arc<SessionManager>,
pub abort_notify: Arc<Notify>,
pub dispatcher: Arc<DatabendQueryFlightDispatcher>,
}

impl RpcService {
Expand Down
3 changes: 0 additions & 3 deletions query/src/clusters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(test)]
mod cluster_test;

mod cluster;

pub use cluster::Cluster;
Expand Down
4 changes: 1 addition & 3 deletions query/src/common/hashtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
pub use hash_table::HashTable;
pub use hash_table_entity::HashTableEntity;
pub use hash_table_entity::KeyValueEntity;
pub use hash_table_grower::Grower;
pub use hash_table_iter::HashTableIter;
pub use hash_table_key::HashTableKeyable;

#[cfg(test)]
mod hash_table_grower_test;

mod hash_table;
#[allow(clippy::missing_safety_doc, clippy::not_unsafe_ptr_arg_deref)]
mod hash_table_entity;
Expand Down
3 changes: 0 additions & 3 deletions query/src/configs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#[macro_use]
mod macros;

#[cfg(test)]
mod config_test;

mod config;
pub mod config_log;
pub mod config_meta;
Expand Down
3 changes: 0 additions & 3 deletions query/src/functions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(test)]
mod context_function_test;

mod context_function;

pub use context_function::ContextFunction;
39 changes: 0 additions & 39 deletions query/src/interpreters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(test)]
mod interpreter_database_create_test;
#[cfg(test)]
mod interpreter_database_drop_test;
#[cfg(test)]
mod interpreter_describe_table_test;
#[cfg(test)]
mod interpreter_explain_test;
#[cfg(test)]
mod interpreter_grant_privilege_test;
#[cfg(test)]
mod interpreter_insert_test;
#[cfg(test)]
mod interpreter_interceptor_test;
#[cfg(test)]
mod interpreter_revoke_previlege_test;
#[cfg(test)]
mod interpreter_select_test;
#[cfg(test)]
mod interpreter_setting_test;
#[cfg(test)]
mod interpreter_show_create_table_test;
#[cfg(test)]
mod interpreter_stage_create_test;
#[cfg(test)]
mod interpreter_table_create_test;
#[cfg(test)]
mod interpreter_table_drop_test;
#[cfg(test)]
mod interpreter_truncate_table_test;
#[cfg(test)]
mod interpreter_use_database_test;
#[cfg(test)]
mod interpreter_user_alter_test;
#[cfg(test)]
mod interpreter_user_create_test;
#[cfg(test)]
mod interpreter_user_drop_test;

mod interpreter;
mod interpreter_common;
mod interpreter_copy;
Expand Down
3 changes: 0 additions & 3 deletions query/src/interpreters/plan_schedulers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(test)]
mod plan_scheduler_test;

#[allow(clippy::needless_range_loop)]
mod plan_scheduler;
mod plan_scheduler_error;
Expand Down
3 changes: 0 additions & 3 deletions query/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#![feature(core_intrinsics)]
#![feature(arbitrary_self_types)]

#[cfg(test)]
pub mod tests;

pub mod api;
pub mod catalogs;
pub mod clusters;
Expand Down
3 changes: 0 additions & 3 deletions query/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(test)]
mod metric_service_test;

mod metric_service;

pub use metric_service::MetricService;
16 changes: 0 additions & 16 deletions query/src/optimizers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(test)]
mod optimizer_constant_folding_test;
#[cfg(test)]
mod optimizer_expression_transform_test;
#[cfg(test)]
mod optimizer_scatters_test;
#[cfg(test)]
mod optimizer_statistics_exact_test;
#[cfg(test)]
mod optimizer_test;
#[cfg(test)]
mod utils_test;

#[cfg(test)]
mod optimizer_top_n_push_down_test;

mod metrics;
mod optimizer;
mod optimizer_constant_folding;
Expand Down
80 changes: 0 additions & 80 deletions query/src/optimizers/optimizer_alias_push_down_test.rs

This file was deleted.

Loading

0 comments on commit 4ad00e3

Please sign in to comment.