You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2022/09/20 14:04:37 UTC

[incubator-devlake] 02/02: fix(dora): e2e

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

abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 971f1f8268130c1961f8c1e0da418a979aa262e4
Author: Yingchu Chen <yi...@merico.dev>
AuthorDate: Tue Sep 20 21:50:57 2022 +0800

    fix(dora): e2e
---
 plugins/dora/e2e/calculate_change_lead_time_test.go | 1 +
 plugins/dora/e2e/raw_tables/repos.csv               | 2 ++
 plugins/dora/tasks/change_lead_time_calculator.go   | 2 +-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/dora/e2e/calculate_change_lead_time_test.go b/plugins/dora/e2e/calculate_change_lead_time_test.go
index b27c7164..90b7ef61 100644
--- a/plugins/dora/e2e/calculate_change_lead_time_test.go
+++ b/plugins/dora/e2e/calculate_change_lead_time_test.go
@@ -50,6 +50,7 @@ func TestCalculateCLTimeDataFlow(t *testing.T) {
 	dataflowTester.ImportCsvIntoTabler("./raw_tables/pull_request_comments.csv", &code.PullRequestComment{})
 	dataflowTester.ImportCsvIntoTabler("./raw_tables/pull_request_commits.csv", &code.PullRequestCommit{})
 	dataflowTester.ImportCsvIntoTabler("./raw_tables/commits.csv", &code.Commit{})
+	dataflowTester.ImportCsvIntoTabler("./raw_tables/repos.csv", &code.Repo{})
 
 	// verify converter
 	dataflowTester.Subtask(tasks.CalculateChangeLeadTimeMeta, taskData)
diff --git a/plugins/dora/e2e/raw_tables/repos.csv b/plugins/dora/e2e/raw_tables/repos.csv
new file mode 100644
index 00000000..199b4f35
--- /dev/null
+++ b/plugins/dora/e2e/raw_tables/repos.csv
@@ -0,0 +1,2 @@
+id,created_at,updated_at,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,name,url,description,owner_id,language,forked_from,created_date,updated_date,deleted
+github:GithubRepo:1:384111310,2022-09-20 13:47:48.519,2022-09-20 13:47:48.519,"{""ConnectionId"":1,""Owner"":""apache"",""Repo"":""incubator-devlake""}",_raw_github_api_repositories,1,"",apache/incubator-devlake,https://github.com/apache/incubator-devlake,"Apache DevLake is an open-source dev data platform to ingest, analyze, and visualize the fragmented data from DevOps tools, which can distill insights to improve engineering productivity.","",Go,"",2021-07-08 12:06:09,2022-09-20 03:25:21,0
diff --git a/plugins/dora/tasks/change_lead_time_calculator.go b/plugins/dora/tasks/change_lead_time_calculator.go
index 7df0efdc..ceffd02d 100644
--- a/plugins/dora/tasks/change_lead_time_calculator.go
+++ b/plugins/dora/tasks/change_lead_time_calculator.go
@@ -35,7 +35,7 @@ func CalculateChangeLeadTime(taskCtx core.SubTaskContext) errors.Error {
 	db := taskCtx.GetDal()
 	repoIdList := make([]string, 0)
 	repoClause := dal.From(&code.Repo{})
-	err := db.Pluck("id", repoIdList, repoClause)
+	err := db.Pluck("id", &repoIdList, repoClause)
 	if err != nil {
 		return err
 	}