This is an automated email from the ASF dual-hosted git repository.
zhangliang2022 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 1275f9357 refactor: move table_info_checker to unithelper package
(#5801)
1275f9357 is described below
commit 1275f9357869a64442e16dd718045b95ae5ce8f8
Author: Klesh Wong <[email protected]>
AuthorDate: Thu Aug 3 15:50:04 2023 +0800
refactor: move table_info_checker to unithelper package (#5801)
---
backend/core/domain_tables_info_test.go | 7 ++++---
backend/{core/utils => helpers/unithelper}/table_info_checker.go | 5 +++--
backend/plugins/table_info_test.go | 4 ++--
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/backend/core/domain_tables_info_test.go
b/backend/core/domain_tables_info_test.go
index 62eae3786..68f93cec3 100644
--- a/backend/core/domain_tables_info_test.go
+++ b/backend/core/domain_tables_info_test.go
@@ -18,13 +18,14 @@ limitations under the License.
package core
import (
- "github.com/apache/incubator-devlake/core/models/domainlayer/domaininfo"
- "github.com/apache/incubator-devlake/core/utils"
"testing"
+
+ "github.com/apache/incubator-devlake/core/models/domainlayer/domaininfo"
+ "github.com/apache/incubator-devlake/helpers/unithelper"
)
func Test_GetDomainTablesInfo(t *testing.T) {
- checker := utils.NewTableInfoChecker(utils.TableInfoCheckerConfig{})
+ checker :=
unithelper.NewTableInfoChecker(unithelper.TableInfoCheckerConfig{})
checker.FeedIn("models/domainlayer", domaininfo.GetDomainTablesInfo)
err := checker.Verify()
if err != nil {
diff --git a/backend/core/utils/table_info_checker.go
b/backend/helpers/unithelper/table_info_checker.go
similarity index 99%
rename from backend/core/utils/table_info_checker.go
rename to backend/helpers/unithelper/table_info_checker.go
index 0b76d0329..bece5b31f 100644
--- a/backend/core/utils/table_info_checker.go
+++ b/backend/helpers/unithelper/table_info_checker.go
@@ -15,20 +15,21 @@ See the License for the specific language governing
permissions and
limitations under the License.
*/
-package utils
+package unithelper
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
- "golang.org/x/exp/slices"
fs2 "io/fs"
"os"
"path/filepath"
"sort"
"strings"
+ "golang.org/x/exp/slices"
+
"github.com/apache/incubator-devlake/core/dal"
"github.com/apache/incubator-devlake/core/errors"
)
diff --git a/backend/plugins/table_info_test.go
b/backend/plugins/table_info_test.go
index 0ff7365f0..34c70a5fc 100644
--- a/backend/plugins/table_info_test.go
+++ b/backend/plugins/table_info_test.go
@@ -20,7 +20,7 @@ package plugins
import (
"testing"
- "github.com/apache/incubator-devlake/core/utils"
+ "github.com/apache/incubator-devlake/helpers/unithelper"
ae "github.com/apache/incubator-devlake/plugins/ae/impl"
bamboo "github.com/apache/incubator-devlake/plugins/bamboo/impl"
bitbucket "github.com/apache/incubator-devlake/plugins/bitbucket/impl"
@@ -51,7 +51,7 @@ import (
func Test_GetPluginTablesInfo(t *testing.T) {
// Make sure EVERY Go plugin is listed here
- checker := utils.NewTableInfoChecker(utils.TableInfoCheckerConfig{
+ checker :=
unithelper.NewTableInfoChecker(unithelper.TableInfoCheckerConfig{
ValidatePluginCount: true,
})
checker.FeedIn("ae/models", ae.AE{}.GetTablesInfo)