[Bug][e2e] Several plugin e2e tests fail on a fresh database because they depend on tables created by other tests
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with e2ehelper.DataFlowTester and the failing TestCalculateCLTimeDataFlow in plugins/dora/e2e/, then check scripts/e2e-test-go-plugins.sh to see the shared-database order. Reproduce on an empty database with go test -count=1 ./plugins/<plugin>/e2e/..., and make each test create the tables its subtasks read or write. Done means every listed package and test passes alone on a fresh database.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Search before asking
- I had searched in the issues and found no similar issues.
What happened
Several Go plugin e2e tests fail when they run on a fresh, empty database, for example when you run one plugin's e2e package or one test on its own:
--- FAIL: TestCalculateCLTimeDataFlow
panic: failed to batch fetch first reviews (500)
Wraps: (3) Error 1146 (42S02): Table 'lake_test.accounts' doesn't exist
e2ehelper.DataFlowTester runs no migrations. A test only has the tables it flushes or imports. Some tests run subtasks that read or write other tables, for example a converter that deletes old board_issues rows, or a query that joins accounts. Those tables exist in CI only because an earlier test created them: scripts/e2e-test-go-plugins.sh runs every plugin's e2e package in go list order on one shared database.
Packages that fail on their own (fresh database per package):
| Package | Missing table | Test |
|---|---|---|
dora/e2e |
accounts |
TestCalculateCLTimeDataFlow (the first review query joins accounts since #9000) |
customize/e2e |
board_issues |
TestImportIssueChangelogDataFlow, TestImportIssueCommitDataFlow |
gitlab/e2e |
issue_labels |
TestGitlabIssueDataFlow |
opsgenie/e2e |
board_issues |
TestIncidentDataFlow |
pagerduty/e2e |
board_issues |
TestIncidentDataFlow |
teambition/e2e |
board_sprints |
TestTeambitionSprints |
Tests that fail with go test -run <Test> (fresh database per test), because an earlier test in the same package created the tables:
customize:TestImportIssueWorklogDataFlowgitlab:TestGitlabMrDataFlow,TestGitlabMrDetailDataFlow,TestGitlabMrNoteDataFlowteambition:TestTeambitionTaskbitbucket:TestCommentDataFlowgithub:TestMilestoneDataFlow,TestPrReviewDataFlowjira:TestEpicDataflow,TestIssueRelationshipDataFlow,TestIssueSubtaskWithoutMappinglinear:TestLinearIssueHistoryDataFlowtapd:TestTapdBugCustomizeDueDate,TestTapdStoryCustomizeDueDate,TestTapdTaskCustomizeDueDate
Some of these tests also read data that an earlier test left behind, not only the table:
- The bitbucket issue comment converter joins
_tool_bitbucket_issues, whichaccount_test.gofills. - The tapd due date tests use the statuses and workitem types that the test before them imports.
Also, the DORA fixture has no bot account, so nothing in the e2e tests covers the bot exclusion added in #9000.
What do you expect to happen
Each e2e package and each e2e test passes on a fresh database. A test sets up every table its subtasks use and does not depend on the order tests run in.
How to reproduce
- Create an empty MySQL database.
- From
backend/:
export E2E_DB_URL='mysql://merico:[email protected]:3306/lake_test?charset=utf8mb4&parseTime=True&loc=UTC'
TZ=UTC go test -count=1 ./plugins/dora/e2e/...
The other packages fail the same way. For the per-test failures, run e.g. go test -count=1 -run '^TestCommentDataFlow$' ./plugins/bitbucket/e2e/ on an empty database.
Anything else
CI passes today only because of the order the tests run in. It would break if the e2e tests ran in parallel or on a database per package.
Version
main (4ad2f66df)
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Go
- Star
- 3.2k
- Fork
- 824
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/devlake
-
[Bug][Project] Invalid metric plugin options are accepted on project save and only fail at the next pipeline runCó thể đã có người làm @chenwei791129 đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 22/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug][Dashboard] Engineering Throughput PR time panels count PRs without a project_pr_metrics row as 0 hoursCó thể đã có người làm @chenwei791129 đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 22/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Feature][dora] Allow filtering which pull requests count toward Lead Time for Changes by branch nameCó thể đã có người làm @chenwei791129 đã nhận 1 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/devlake
Issue tương tự
-
Named Tuple element with a space in its name fails to parseCó thể đã có người làm @spicysharkco đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ClickHouse/clickhouse-go#2073 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
ci: nothing regenerates the Go contract types, so a hand-edit to types.gen.go passesCó thể đã có người làm @shaiknoorullah đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
shaiknoorullah/hg-mono#993 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
CarlosDanielDev/aiacc#78 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100