You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by yx...@apache.org on 2022/05/02 10:22:47 UTC

[shardingsphere] branch master updated: Update code-conduct for avoid test static codes (#17268)

This is an automated email from the ASF dual-hosted git repository.

yx9o pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 4f4a5547789 Update code-conduct for avoid test static codes (#17268)
4f4a5547789 is described below

commit 4f4a55477897b7166f2a35229f557d71cef22ef7
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Mon May 2 18:22:41 2022 +0800

    Update code-conduct for avoid test static codes (#17268)
---
 docs/community/content/contribute/code-conduct.cn.md                    | 2 +-
 docs/community/content/contribute/code-conduct.en.md                    | 1 +
 .../postgresql/prepare/datasource/PostgreSQLDataSourcePreparer.java     | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/docs/community/content/contribute/code-conduct.cn.md b/docs/community/content/contribute/code-conduct.cn.md
index 33f953cb303..470c2ead016 100644
--- a/docs/community/content/contribute/code-conduct.cn.md
+++ b/docs/community/content/contribute/code-conduct.cn.md
@@ -65,7 +65,7 @@ chapter = true
    - 正确性测试(Correct):通过正确的输入,得到预期结果。
    - 合理性设计(Design):与生产代码设计相结合,设计高质量的单元测试。
    - 容错性测试(Error):通过非法数据、异常流程等错误的输入,得到预期结果。
- - 如无特殊理由,测试需全覆盖。
+ - 除去简单的 `getter /setter` 方法,以及声明 SPI 的静态代码,如:`getType / getOrder`,单元测试需全覆盖。
  - 每个测试用例需精确断言。
  - 准备环境的代码和测试代码分离。
  - 只有 junit `Assert`,hamcrest `CoreMatchers`,Mockito 相关可以使用 static import。
diff --git a/docs/community/content/contribute/code-conduct.en.md b/docs/community/content/contribute/code-conduct.en.md
index 0cb7ffe064c..930d073a1d3 100644
--- a/docs/community/content/contribute/code-conduct.en.md
+++ b/docs/community/content/contribute/code-conduct.en.md
@@ -63,6 +63,7 @@ The following code of conduct is based on full compliance with [ASF CODE OF COND
    - Design: Design with production codes.
    - Error: Error value test, test for error input, exception to get expect result.
  - Without particular reasons, test cases should be fully covered.
+ - Test cases should be fully covered expect simply `getter /setter` methods, and declared static codes of SPI, such as: `getType / getOrder`.
  - Every test case need precised assertion.
  - Environment preparation codes should be separate from test codes.
  - Only those that relate to junit `Assert`, hamcrest `CoreMatchers` and `Mockito` can use static import.
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/prepare/datasource/PostgreSQLDataSourcePreparer.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/prepare/datasource/PostgreSQLDataSource [...]
index 2d316002fe6..9b8368c3024 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/prepare/datasource/PostgreSQLDataSourcePreparer.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/prepare/datasource/PostgreSQLDataSourcePreparer.java
@@ -142,7 +142,7 @@ public final class PostgreSQLDataSourcePreparer extends AbstractDataSourcePrepar
                     joiner.add(queryCreateTableSql(sourceConnection, schemaName, actualTableName, primaryKeyPair.getRight()));
                     queryCreateIndexes(sourceConnection, schemaName, actualTableName, primaryKeyPair.getLeft()).forEach(joiner::add);
                     // TODO support query comment for multi schema
-                    //queryCommentOnList(sourceConnection, schemaName, actualTableName).forEach(joiner::add);
+                    // queryCommentOnList(sourceConnection, schemaName, actualTableName).forEach(joiner::add);
                     String tableDefinition = joiner.toString();
                     result.add(new ActualTableDefinition(each.getLogicTableName(), actualTableName, tableDefinition));
                 }