MCPcopy
hub / github.com/apache/devlake / TestTapdBugDataFlow

Function TestTapdBugDataFlow

backend/plugins/tapd/e2e/bugs_test.go:31–167  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29)
30
31func TestTapdBugDataFlow(t *testing.T) {
32
33 var tapd impl.Tapd
34 dataflowTester := e2ehelper.NewDataFlowTester(t, "tapd", tapd)
35
36 taskData := &tasks.TapdTaskData{
37 Options: &tasks.TapdOptions{
38 ConnectionId: 1,
39 WorkspaceId: 991,
40 ScopeConfig: &models.TapdScopeConfig{
41 TypeMappings: map[string]string{
42 "BUG": "缺陷",
43 "TASK": "任务",
44 },
45 StatusMappings: map[string]string{
46 "已关闭": "完成",
47 "接受/处理": "处理中",
48 },
49 },
50 },
51 }
52
53 // bug status
54 dataflowTester.ImportCsvIntoTabler("./snapshot_tables/_tool_tapd_bug_statuses.csv", &models.TapdBugStatus{})
55
56 // import raw data table
57 dataflowTester.ImportCsvIntoRawTable("./raw_tables/_raw_tapd_api_bugs.csv", "_raw_tapd_api_bugs")
58
59 // verify extraction
60 dataflowTester.FlushTabler(&models.TapdBug{})
61 dataflowTester.FlushTabler(&models.TapdWorkSpaceBug{})
62 dataflowTester.FlushTabler(&models.TapdIterationBug{})
63 dataflowTester.FlushTabler(&models.TapdBugLabel{})
64 dataflowTester.Subtask(tasks.ExtractBugMeta, taskData)
65 dataflowTester.VerifyTableWithOptions(&models.TapdBug{}, e2ehelper.TableOptions{
66 CSVRelPath: "./snapshot_tables/_tool_tapd_bugs.csv",
67 IgnoreTypes: []interface{}{common.NoPKModel{}},
68 })
69 dataflowTester.VerifyTable(
70 models.TapdWorkSpaceBug{},
71 "./snapshot_tables/_tool_tapd_workspace_bugs.csv",
72 e2ehelper.ColumnWithRawData(
73 "connection_id",
74 "workspace_id",
75 "bug_id",
76 ),
77 )
78 dataflowTester.VerifyTable(
79 models.TapdIterationBug{},
80 "./snapshot_tables/_tool_tapd_iteration_bugs.csv",
81 e2ehelper.ColumnWithRawData(
82 "connection_id",
83 "workspace_id",
84 "iteration_id",
85 "bug_id",
86 "resolution_date",
87 "bug_created_date",
88 ),

Callers

nothing calls this directly

Calls 6

ImportCsvIntoTablerMethod · 0.95
ImportCsvIntoRawTableMethod · 0.95
FlushTablerMethod · 0.95
SubtaskMethod · 0.95
VerifyTableMethod · 0.95

Tested by

no test coverage detected