chenwei791129 opened a new pull request, #9224: URL: https://github.com/apache/devlake/pull/9224
### Summary `e2ehelper.DataFlowTester` runs no migrations, so a test only has the tables it flushes or imports. Several plugin e2e tests ran subtasks that read or write other tables. Those tables existed only because an earlier test, in the same package or in another plugin, created them on the shared CI database. On a fresh database these tests fail with `Error 1146: Table ... doesn't exist`. Details are in the issue. This PR changes only test code and fixtures: - **Missing tables:** before each subtask runs, the test flushes the tables that subtask writes or deletes from (`board_issues`, `board_sprints`, `sprint_issues`, `issue_labels`, `issue_assignees`, `pull_request_labels/assignees/reviewers`, and tool tables such as `_tool_gitlab_reviewers`, `_tool_github_repo_accounts`, `_tool_jira_issue_fields`). The lists match what sibling tests in the same package already flush for the same subtasks. - **Data left by earlier tests:** where a test used data an earlier test left behind, it now imports the same snapshot itself. This affects the bitbucket comment test (`_tool_bitbucket_issues`) and the tapd due date tests (statuses and workitem types). Each test now sees the same data whether it runs alone or in sequence. - **DORA:** new `change_lead_time/accounts.csv` with a normal account and a bot account. A bot comment on `pr1`, earlier than its first human review, is added to `pull_request_comments.csv`. The expected `project_pr_metrics.csv` does not change, so the test now checks that a bot comment is not counted as the first review (#9000). ### Does this close any open issues? Closes #9223 ### Other Information `FlushTabler` drops and recreates the table. None of the added flushes removes data that a later test needs: every test that reads one of these tables sets it up itself. The runs below confirm this. ### Tests All Go plugin e2e tests on MySQL 8 (`schema_e2e` was not run locally because it needs libgit2): | Run | main | this PR | |---|---|---| | Each package on its own fresh database | 6 packages fail | all pass | | Each test function on its own fresh database | — | 208 / 208 pass | | All packages in sequence on one shared database (as in CI) | pass | pass | Mutation check: with the `is_bot` condition removed from `change_lead_time_calculator.go`, the DORA test fails (`expected "comment02"`, `actual "comment01_bot"`). `golangci-lint` reports 0 issues on the changed packages. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
