Repository navigation
test(e2e): make plugin e2e tests pass on a fresh database - #9224
Open
chenwei791129 wants to merge 1 commit into
Open
chenwei791129 wants to merge 1 commit into
chenwei791129 wants to merge 1 commit into
Conversation
DataFlowTester runs no migrations, so a test only has the tables it flushes or imports. Several e2e tests ran subtasks that read or write other tables, which only existed because an earlier test (in the same package or another plugin) had created them on the shared CI database. Flush the tables those subtasks touch, and import the existing snapshots where a test relied on data left by an earlier test. Give the DORA change lead time test its own accounts fixture with a bot account, so the bot exclusion for the first review is now covered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
e2ehelper.DataFlowTesterruns 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 withError 1146: Table ... doesn't exist. Details are in the issue.This PR changes only test code and fixtures:
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._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.change_lead_time/accounts.csvwith a normal account and a bot account. A bot comment onpr1, earlier than its first human review, is added topull_request_comments.csv. The expectedproject_pr_metrics.csvdoes not change, so the test now checks that a bot comment is not counted as the first review (feat(dora): exclude bot/automation accounts from PR Pickup Time calcu… #9000).Does this close any open issues?
Closes #9223
Other Information
FlushTablerdrops 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_e2ewas not run locally because it needs libgit2):Mutation check: with the
is_botcondition removed fromchange_lead_time_calculator.go, the DORA test fails (expected "comment02",actual "comment01_bot").golangci-lintreports 0 issues on the changed packages.