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 cfd85d07ace28fd21ead8d85dff3406f6b01d777 Author: abeizn <[email protected]> AuthorDate: Thu Jun 23 18:35:41 2022 +0800 fix: jira record not found and e2e test failed --- .../raw_tables/_raw_tapd_api_task_changelogs.csv | 2 +- plugins/tapd/e2e/task_changelog_test.go | 117 --------------------- 2 files changed, 1 insertion(+), 118 deletions(-) diff --git a/plugins/tapd/e2e/raw_tables/_raw_tapd_api_task_changelogs.csv b/plugins/tapd/e2e/raw_tables/_raw_tapd_api_task_changelogs.csv index b4e6d981..0c2ee550 100644 --- a/plugins/tapd/e2e/raw_tables/_raw_tapd_api_task_changelogs.csv +++ b/plugins/tapd/e2e/raw_tables/_raw_tapd_api_task_changelogs.csv @@ -15,4 +15,4 @@ id,params,data,url,input,created_at 14,"{""ConnectionId"":1,""CompanyId"":99,""WorkspaceId"":991}","{""WorkitemChange"":{""id"":""11991001000361"",""workspace_id"":""991"",""workitem_type_id"":""0"",""creator"":""test-11test-11test-11"",""created"":""2019-12-16 12:46:49"",""change_summary"":""open"",""comment"":null,""changes"":""[{\""field\"":\""priority\"",\""value_before\"":\""3\"",\""value_after\"":2}]"",""entity_type"":""Task"",""change_type"":"""",""change_type_text"":"""",""field_changes"":[{""field"":""priority""," [...] 15,"{""ConnectionId"":1,""CompanyId"":99,""WorkspaceId"":991}","{""WorkitemChange"":{""id"":""11991001000366"",""workspace_id"":""991"",""workitem_type_id"":""0"",""creator"":""test-11test-11test-11"",""created"":""2019-12-16 16:07:18"",""change_summary"":""open"",""comment"":null,""changes"":""[{\""field\"":\""status\"",\""value_before\"":\""open\"",\""value_after\"":\""progressing\""},{\""field\"":\""flows\"",\""value_before\"":\""|progressing\"",\""value_after\"":null}]"",""entity_typ [...] 16,"{""ConnectionId"":1,""CompanyId"":99,""WorkspaceId"":991}","{""WorkitemChange"":{""id"":""11991001000367"",""workspace_id"":""991"",""workitem_type_id"":""0"",""creator"":""test-11test-11test-11"",""created"":""2019-12-16 16:10:25"",""change_summary"":""progressing"",""comment"":null,""changes"":""[{\""field\"":\""status\"",\""value_before\"":\""progressing\"",\""value_after\"":\""done\""}]"",""entity_type"":""task"",""change_type"":"""",""change_type_text"":"""",""field_changes"":[{ [...] -17,"{""ConnectionId"":1,""CompanyId"":99,""WorkspaceId"":991}","{""WorkitemChange"":{""id"":""11991001000368"",""workspace_id"":""991"",""workitem_type_id"":""2"",""creator"":""test-11test-11test-11"",""created"":""2019-12-16 16:10:25"",""change_summary"":""progressing"",""comment"":null,""changes"":""[{\""field\"":\""modified\"",\""value_before\"":\""2019-12-13 14:53:08\"",\""value_after\"":\""2019-12-16 16:10:25\""},{\""field\"":\""status\"",\""value_before\"":\""progressing\"",\""valu [...] \ No newline at end of file +17,"{""ConnectionId"":1,""CompanyId"":99,""WorkspaceId"":991}","{""WorkitemChange"":{""id"":""11991001000368"",""workspace_id"":""991"",""workitem_type_id"":""2"",""creator"":""test-11test-11test-11"",""created"":""2019-12-16 16:10:25"",""change_summary"":""progressing"",""comment"":null,""changes"":""[{\""field\"":\""modified\"",\""value_before\"":\""2019-12-13 14:53:08\"",\""value_after\"":\""2019-12-16 16:10:25\""},{\""field\"":\""status\"",\""value_before\"":\""progressing\"",\""valu [...] diff --git a/plugins/tapd/e2e/task_changelog_test.go b/plugins/tapd/e2e/task_changelog_test.go deleted file mode 100644 index 9b659d3e..00000000 --- a/plugins/tapd/e2e/task_changelog_test.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -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 ( - "fmt" - "testing" - - "github.com/apache/incubator-devlake/models/domainlayer/ticket" - - "github.com/apache/incubator-devlake/helpers/e2ehelper" - "github.com/apache/incubator-devlake/plugins/tapd/impl" - "github.com/apache/incubator-devlake/plugins/tapd/models" - "github.com/apache/incubator-devlake/plugins/tapd/tasks" -) - -func TestTapdTaskChangelogDataFlow(t *testing.T) { - - var tapd impl.Tapd - dataflowTester := e2ehelper.NewDataFlowTester(t, "tapd", tapd) - - taskData := &tasks.TapdTaskData{ - Options: &tasks.TapdOptions{ - ConnectionId: 1, - CompanyId: 99, - WorkspaceId: 991, - }, - } - // import raw data table - dataflowTester.ImportCsvIntoRawTable("./raw_tables/_raw_tapd_api_task_changelogs.csv", - "_raw_tapd_api_task_changelogs") - - // verify extraction - dataflowTester.FlushTabler(&models.TapdTaskChangelog{}) - dataflowTester.FlushTabler(&models.TapdTaskChangelogItem{}) - dataflowTester.Subtask(tasks.ExtractTaskChangelogMeta, taskData) - dataflowTester.VerifyTable( - models.TapdTaskChangelog{}, - fmt.Sprintf("./snapshot_tables/%s.csv", models.TapdTaskChangelog{}.TableName()), - []string{"connection_id", "id"}, - []string{ - "workspace_id", - "workitem_type_id", - "creator", - "created", - "change_summary", - "comment", - "entity_type", - "change_type", - "change_type_text", - "task_id", - "_raw_data_params", - "_raw_data_table", - "_raw_data_id", - "_raw_data_remark", - }, - ) - dataflowTester.VerifyTable( - models.TapdTaskChangelogItem{}, - fmt.Sprintf("./snapshot_tables/%s.csv", models.TapdTaskChangelogItem{}.TableName()), - []string{ - "connection_id", - "changelog_id", - "field", - }, - []string{ - "value_before_parsed", - "value_after_parsed", - "iteration_id_from", - "iteration_id_to", - "_raw_data_params", - "_raw_data_table", - "_raw_data_id", - "_raw_data_remark", - }, - ) - - dataflowTester.FlushTabler(&ticket.Changelog{}) - dataflowTester.Subtask(tasks.ConvertTaskChangelogMeta, taskData) - dataflowTester.VerifyTable( - ticket.Changelog{}, - fmt.Sprintf("./snapshot_tables/%s_task.csv", ticket.Changelog{}.TableName()), - []string{"id"}, - []string{ - "_raw_data_params", - "_raw_data_table", - "_raw_data_id", - "_raw_data_remark", - "issue_id", - "author_id", - "author_name", - "field_id", - "field_name", - "from_value", - "to_value", - "created_date", - "original_from_value", - "original_to_value", - }, - ) - -}
