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:34:32 UTC

[GitHub] [incubator-devlake] mindlesscloud opened a new pull request, #2349: test: jira e2e

mindlesscloud opened a new pull request, #2349:
URL: https://github.com/apache/incubator-devlake/pull/2349

   # Summary
   
   Jira e2e test for :
   - remotelink
   - changelog
   - worklog
   
   ### Does this close any open issues?
   Please mention the issues here.
   
   ### Screenshots
   Include any relevant screenshots here.
   
   ### Other Information
   Any other information that is important to this PR.
   


-- 
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


[GitHub] [incubator-devlake] klesh merged pull request #2349: test: jira e2e

Posted by GitBox <gi...@apache.org>.
klesh merged PR #2349:
URL: https://github.com/apache/incubator-devlake/pull/2349


-- 
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


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

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2349:
URL: https://github.com/apache/incubator-devlake/pull/2349#discussion_r905843013


##########
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:
   fixed



##########
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:
   fixed



-- 
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


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

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2349:
URL: https://github.com/apache/incubator-devlake/pull/2349#discussion_r906030570


##########
plugins/jira/e2e/remotelink_test.go:
##########
@@ -0,0 +1,80 @@
+/*
+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/plugins/jira/impl"
+	"github.com/apache/incubator-devlake/plugins/jira/models"
+	"github.com/apache/incubator-devlake/plugins/jira/tasks"
+)
+
+func TestRemotelinkDataFlow(t *testing.T) {
+	var plugin impl.Jira
+	dataflowTester := e2ehelper.NewDataFlowTester(t, "jira", plugin)
+
+	taskData := &tasks.JiraTaskData{
+		Options: &tasks.JiraOptions{
+			ConnectionId: 2,
+			BoardId:      8,
+		},
+		Connection: &models.JiraConnection{
+			RemotelinkCommitShaPattern: ".*/commit/(.*)",

Review Comment:
   fixed



-- 
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


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

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2349:
URL: https://github.com/apache/incubator-devlake/pull/2349#discussion_r905842752


##########
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:
   Good idea!



-- 
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


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

Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #2349:
URL: https://github.com/apache/incubator-devlake/pull/2349#discussion_r905693912


##########
plugins/jira/e2e/snapshot_tables/worklogs.csv:
##########
@@ -0,0 +1,7 @@
+id,author_id,comment,time_spent_minutes,logged_date,started_date,issue_id
+jira:JiraWorklog:2:10076:10006,,,600,2020-06-15T08:59:51.302+00:00,2020-06-05T20:59:00.000+00:00,jira:JiraIssue:2:10076
+jira:JiraWorklog:2:10077:10007,,,240,2020-06-15T09:00:26.952+00:00,2020-06-15T09:00:00.000+00:00,jira:JiraIssue:2:10077
+jira:JiraWorklog:2:10077:10008,,,240,2020-06-15T09:01:06.211+00:00,2020-06-15T05:00:42.836+00:00,jira:JiraIssue:2:10077
+jira:JiraWorklog:2:10078:10009,,,60,2020-06-15T09:01:44.154+00:00,2020-06-15T09:01:00.000+00:00,jira:JiraIssue:2:10078
+jira:JiraWorklog:2:10079:10218,,,120,2020-07-22T07:25:29.102+00:00,2020-07-22T07:24:00.000+00:00,jira:JiraIssue:2:10079
+jira:JiraWorklog:2:10085:10010,,,60,2020-06-15T09:07:56.793+00:00,2020-06-15T09:07:00.000+00:00,jira:JiraIssue:2:10085

Review Comment:
   Is the reason for only 7 rows filtering by _tool_jira_board_issues?



-- 
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


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

Posted by GitBox <gi...@apache.org>.
klesh commented on code in PR #2349:
URL: https://github.com/apache/incubator-devlake/pull/2349#discussion_r905816694


##########
plugins/jira/e2e/remotelink_test.go:
##########
@@ -0,0 +1,80 @@
+/*
+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/plugins/jira/impl"
+	"github.com/apache/incubator-devlake/plugins/jira/models"
+	"github.com/apache/incubator-devlake/plugins/jira/tasks"
+)
+
+func TestRemotelinkDataFlow(t *testing.T) {
+	var plugin impl.Jira
+	dataflowTester := e2ehelper.NewDataFlowTester(t, "jira", plugin)
+
+	taskData := &tasks.JiraTaskData{
+		Options: &tasks.JiraOptions{
+			ConnectionId: 2,
+			BoardId:      8,
+		},
+		Connection: &models.JiraConnection{
+			RemotelinkCommitShaPattern: ".*/commit/(.*)",

Review Comment:
   This option should be moved to `task.options.transformationRules` 



-- 
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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2349:
URL: https://github.com/apache/incubator-devlake/pull/2349#discussion_r905832288


##########
plugins/jira/e2e/snapshot_tables/worklogs.csv:
##########
@@ -0,0 +1,7 @@
+id,author_id,comment,time_spent_minutes,logged_date,started_date,issue_id
+jira:JiraWorklog:2:10076:10006,,,600,2020-06-15T08:59:51.302+00:00,2020-06-05T20:59:00.000+00:00,jira:JiraIssue:2:10076
+jira:JiraWorklog:2:10077:10007,,,240,2020-06-15T09:00:26.952+00:00,2020-06-15T09:00:00.000+00:00,jira:JiraIssue:2:10077
+jira:JiraWorklog:2:10077:10008,,,240,2020-06-15T09:01:06.211+00:00,2020-06-15T05:00:42.836+00:00,jira:JiraIssue:2:10077
+jira:JiraWorklog:2:10078:10009,,,60,2020-06-15T09:01:44.154+00:00,2020-06-15T09:01:00.000+00:00,jira:JiraIssue:2:10078
+jira:JiraWorklog:2:10079:10218,,,120,2020-07-22T07:25:29.102+00:00,2020-07-22T07:24:00.000+00:00,jira:JiraIssue:2:10079
+jira:JiraWorklog:2:10085:10010,,,60,2020-06-15T09:07:56.793+00:00,2020-06-15T09:07:00.000+00:00,jira:JiraIssue:2:10085

Review Comment:
   yes, that's the reason



-- 
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