You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/06/24 03:47:02 UTC

[GitHub] [incubator-devlake] warren830 commented on a diff in pull request #2349: test: jira e2e

warren830 commented on code in PR #2349:
URL: https://github.com/apache/incubator-devlake/pull/2349#discussion_r905692420


##########
plugins/jira/e2e/snapshot_tables/_tool_jira_issue_commits.csv:
##########
@@ -0,0 +1,10 @@
+connection_id,issue_id,commit_sha,commit_url,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark
+2,10063,8748a066cbaf67b15e86f2c636f9931347e987cf,https://gitlab.com/meri.co/vdev.co/-/commit/8748a066cbaf67b15e86f2c636f9931347e987cf,"{""ConnectionId"":2,""BoardId"":8}",_raw_jira_api_remotelinks,101041,
+2,10064,abc0892edaee00dd7ee268dbee71620407a29bca,https://gitlab.com/meri.co/vdev.co/-/commit/abc0892edaee00dd7ee268dbee71620407a29bca,"{""ConnectionId"":2,""BoardId"":8}",_raw_jira_api_remotelinks,101043,

Review Comment:
   We can change the original link to hide our project info



##########
plugins/jira/e2e/snapshot_tables/_tool_jira_changelog_items.csv:
##########
@@ -0,0 +1,31 @@
+connection_id,changelog_id,field,field_type,field_id,from_value,from_string,to_value,to_string
+2,11646,assignee,jira,,,,5ecfbd0ba04d9c0c220c18d8,yanghui
+2,11648,assignee,jira,,5ecfbd0ba04d9c0c220c18d8,yanghui,5ecfbd0c2490cf0c09e2e598,Gerile Tu
+2,11677,summary,jira,,,[Industry Metrics]提供效率报表的行业指标,,[Industry Metrics]提供效率报表的行业指标 (需求还不明确)

Review Comment:
   Not sure if we should change some content of the tables to avoid data leak



##########
plugins/jira/e2e/changelog_test.go:
##########
@@ -0,0 +1,102 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package e2e
+
+import (
+	"testing"
+
+	"github.com/apache/incubator-devlake/helpers/e2ehelper"
+	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
+	"github.com/apache/incubator-devlake/plugins/jira/impl"
+	"github.com/apache/incubator-devlake/plugins/jira/models"
+	"github.com/apache/incubator-devlake/plugins/jira/tasks"
+)
+
+func TestChangelogDataFlow(t *testing.T) {
+	var plugin impl.Jira
+	dataflowTester := e2ehelper.NewDataFlowTester(t, "jira", plugin)
+
+	taskData := &tasks.JiraTaskData{
+		Options: &tasks.JiraOptions{
+			ConnectionId: 2,
+			BoardId:      8,
+		},
+	}
+
+	// import raw data table
+	dataflowTester.ImportCsvIntoRawTable("./raw_tables/_raw_jira_api_changelogs.csv", "_raw_jira_api_changelogs")
+
+	// verify changelog extraction
+	dataflowTester.FlushTabler(&models.JiraChangelog{})
+	dataflowTester.FlushTabler(&models.JiraChangelogItem{})
+	dataflowTester.FlushTabler(&models.JiraUser{})
+	dataflowTester.Subtask(tasks.ExtractChangelogsMeta, taskData)
+	dataflowTester.VerifyTable(
+		models.JiraChangelog{},
+		"./snapshot_tables/_tool_jira_changelogs.csv",
+		[]string{"connection_id", "changelog_id"},
+		[]string{
+			"issue_id",
+			"author_account_id",
+			"author_display_name",
+			"author_active",
+			"created",
+			"issue_updated",
+			"_raw_data_params",
+			"_raw_data_table",
+			"_raw_data_id",
+			"_raw_data_remark",
+		},
+	)
+
+	dataflowTester.VerifyTable(
+		models.JiraChangelogItem{},
+		"./snapshot_tables/_tool_jira_changelog_items.csv",
+		[]string{"connection_id", "changelog_id", "field"},
+		[]string{
+			"field_type",
+			"field_id",
+			"from_value",
+			"from_string",
+			"to_value",
+			"to_string",
+		},
+	)
+
+	// verify changelog conversion
+	dataflowTester.ImportCsvIntoTabler("./snapshot_tables/_tool_jira_board_issues.csv", &models.JiraBoardIssue{})

Review Comment:
   This _tool_jira_board_issues.csv will depend on other test. In gitlab an tapd, we choose to run the dependent sub tasks inside this test, and use another csv like ‘_tool_jira_board_issues_for_changelog’ to support this test



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org