Skip to content

Commit ac89f57

Browse files
committed
[test] apply the new test style to common-meta-types
Signed-off-by: Chojan Shang <[email protected]>
1 parent 6be6433 commit ac89f57

File tree

7 files changed

+30
-20
lines changed

7 files changed

+30
-20
lines changed

common/meta/types/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ license = "Apache-2.0"
66
publish = false
77
edition = "2021"
88

9+
[lib]
10+
doctest = false
11+
test = false
12+
913
[dependencies]
1014
common-datavalues = {path = "../../datavalues"}
1115
common-exception = {path = "../../exception"}

common/meta/types/src/lib.rs

-9
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414

1515
//! This crate defines data types used in meta data storage service.
1616
17-
#[cfg(test)]
18-
mod cluster_test;
19-
#[cfg(test)]
20-
mod match_seq_test;
21-
#[cfg(test)]
22-
mod user_privilege_test;
23-
#[cfg(test)]
24-
mod user_quota_test;
25-
2617
pub use change::AddResult;
2718
pub use change::Change;
2819
pub use cluster::Node;

common/meta/types/src/cluster_test.rs renamed to common/meta/types/tests/it/cluster.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
// limitations under the License.
1414

1515
use common_exception::exception::Result;
16-
17-
use crate::NodeInfo;
16+
use common_meta_types::NodeInfo;
1817

1918
#[test]
2019
fn test_node_info_ip_port() -> Result<()> {

common/meta/types/tests/it/main.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2021 Datafuse Labs.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
mod cluster;
16+
mod match_seq;
17+
mod user_privilege;
18+
mod user_quota;

common/meta/types/src/match_seq_test.rs renamed to common/meta/types/tests/it/match_seq.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
use std::result::Result;
1616

17-
use crate::ConflictSeq;
18-
use crate::MatchSeq;
19-
use crate::MatchSeqExt;
20-
use crate::SeqV;
17+
use common_meta_types::ConflictSeq;
18+
use common_meta_types::MatchSeq;
19+
use common_meta_types::MatchSeqExt;
20+
use common_meta_types::SeqV;
2121

2222
#[test]
2323
fn test_match_seq_match_seq_value() -> Result<(), ()> {

common/meta/types/src/user_privilege_test.rs renamed to common/meta/types/tests/it/user_privilege.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
// limitations under the License.
1414

1515
use common_exception::exception::Result;
16-
17-
use crate::UserPrivilege;
18-
use crate::UserPrivilegeType;
16+
use common_meta_types::UserPrivilege;
17+
use common_meta_types::UserPrivilegeType;
1918

2019
#[test]
2120
fn test_user_privilege() -> Result<()> {

common/meta/types/src/user_quota_test.rs renamed to common/meta/types/tests/it/user_quota.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
// limitations under the License.
1414

1515
use common_exception::exception::Result;
16-
17-
use crate::UserQuota;
16+
use common_meta_types::UserQuota;
1817

1918
#[test]
2019
fn test_user_quota() -> Result<()> {

0 commit comments

Comments
 (0)