Repository navigation
test(amber, common): share dashboard and Hub spec fixtures - #9718
Conversation
The dashboard, Hub, warehouse, workflow access, collaboration and result specs each opened the test database, seeded users, workflows, versions, datasets and executions, and checked search projections by hand. They now share DatabaseFlatSpec, UserDashboardFixtureSupport and VersionedSearchQuerySupport. HubEntityModelSpec drops the EntityType and EntityTables checks that the dedicated suites already make, and its empty-string case moves to EntityTypeSpec.
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9718 +/- ##
============================================
- Coverage 91.78% 91.77% -0.01%
+ Complexity 5137 5134 -3
============================================
Files 1306 1306
Lines 58240 58230 -10
Branches 7582 7579 -3
============================================
- Hits 53454 53441 -13
- Misses 2893 2894 +1
- Partials 1893 1895 +2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 577 | 0.352 | 17,203/21,434/21,434 us | 🟢 -16.1% / 🔴 +57.1% |
| 🟢 | bs=100 sw=10 sl=64 | 1,266 | 0.772 | 78,384/89,276/89,276 us | 🟢 -21.2% / 🟢 -16.5% |
| ⚪ | bs=1000 sw=10 sl=64 | 1,468 | 0.896 | 685,585/712,278/712,278 us | ⚪ within ±5% / 🟢 -23.6% |
Baseline details
Latest main 77112c8 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 577 tuples/sec | 591 tuples/sec | 928.7 tuples/sec | -2.4% | -37.9% |
| bs=10 sw=10 sl=64 | MB/s | 0.352 MB/s | 0.361 MB/s | 0.567 MB/s | -2.5% | -37.9% |
| bs=10 sw=10 sl=64 | p50 | 17,203 us | 15,404 us | 10,947 us | +11.7% | +57.1% |
| bs=10 sw=10 sl=64 | p95 | 21,434 us | 25,547 us | 14,027 us | -16.1% | +52.8% |
| bs=10 sw=10 sl=64 | p99 | 21,434 us | 25,547 us | 17,128 us | -16.1% | +25.1% |
| bs=100 sw=10 sl=64 | throughput | 1,266 tuples/sec | 1,254 tuples/sec | 1,228 tuples/sec | +1.0% | +3.1% |
| bs=100 sw=10 sl=64 | MB/s | 0.772 MB/s | 0.765 MB/s | 0.749 MB/s | +0.9% | +3.0% |
| bs=100 sw=10 sl=64 | p50 | 78,384 us | 78,003 us | 86,528 us | +0.5% | -9.4% |
| bs=100 sw=10 sl=64 | p95 | 89,276 us | 113,245 us | 93,707 us | -21.2% | -4.7% |
| bs=100 sw=10 sl=64 | p99 | 89,276 us | 113,245 us | 106,860 us | -21.2% | -16.5% |
| bs=1000 sw=10 sl=64 | throughput | 1,468 tuples/sec | 1,471 tuples/sec | 1,274 tuples/sec | -0.2% | +15.2% |
| bs=1000 sw=10 sl=64 | MB/s | 0.896 MB/s | 0.898 MB/s | 0.778 MB/s | -0.2% | +15.2% |
| bs=1000 sw=10 sl=64 | p50 | 685,585 us | 679,967 us | 839,397 us | +0.8% | -18.3% |
| bs=1000 sw=10 sl=64 | p95 | 712,278 us | 749,413 us | 880,591 us | -5.0% | -19.1% |
| bs=1000 sw=10 sl=64 | p99 | 712,278 us | 749,413 us | 932,549 us | -5.0% | -23.6% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,346.43,200,128000,577,0.352,17202.91,21434.33,21434.33
1,100,10,64,20,1580.40,2000,1280000,1266,0.772,78384.29,89276.11,89276.11
2,1000,10,64,20,13620.84,20000,12800000,1468,0.896,685585.06,712277.79,712277.79
kunwp1
left a comment
There was a problem hiding this comment.
LGTM! One optional suggestion and two nits below.
…c hooks - ExecutionDatabaseTestSupport inserts workflow ownership and access rows, and DashboardWorkflowFixtureSupport extends it. The admin-user and quota specs seed workflows, versions and executions with its helpers and clean up with cleanupWorkflowRecords, so the dashboard seed and delete helpers are gone. - The workflow access, collaboration and admin execution specs let DatabaseFlatSpec run cleanup() before each case instead of calling it. - ResultResourceSpec stops its resources in onAfterAll.
…source specs (apache#9726) ### What changes were proposed in this PR? Fourteen specs that use the embedded test database now extend `DatabaseFlatSpec` from apache#9718 instead of opening the database, closing its connection pool and running their cleanup by hand. Each spec keeps its own `cleanup()` and runs it at the same points as before: before each case, after each case or after the suite. - `AuthDatabaseSpec`, new in the `auth` test package, is the base of the Apple, Google and ORCID sign-in specs and the local and external account provisioning specs. It holds the user lookup and count by email, the provider-row query, the user cleanup by email domain or provider type and the invite-only switch that these specs each wrote out. The cleanup by email domain refuses an empty domain, which would match every user. - The feedback, Gmail, user config, email template and email code specs move the request, message or session user that they built in every case into a helper. `AuthResourceSpec` keeps its own setup and helpers for now because apache#9007 edits it. It can move onto `AuthDatabaseSpec` once apache#9007 lands. Every case keeps its name, inputs and expected values, in the same order. ### Any related issues, documentation, discussions? Closes apache#9725. ### How was this PR tested? - `sbt "WorkflowExecutionService/testOnly <the 11 suites under amber>"`, `"DAO/testOnly *SiteSettingsSpec"`, `"ComputingUnitManagingService/testOnly <the 3 resource suites>"` and `"NotebookMigrationService/testOnly *NotebookMigrationResourceSpec"`: main and this branch each run 266 cases in 16 suites, all passing, with the same names, outcomes and order, compared case by case from the JUnit XML reports. - Mutation check: five breaks, each reverted afterwards, made their guarding suites fail: - `providerIdOf` ignoring the provider type it is given: 9 of 58 cases in the five sign-in and provisioning suites. - `setInviteOnly` storing the opposite switch: 6 of 58. - `userCountByEmail` dropping the email domain: 5 cases in the two provisioning suites. - `GoogleAuthResourceSpec` left on the default empty domain: the suite aborts with the new `require` message instead of deleting every user. - `DatabaseFlatSpec` skipping its before-each cleanup: 19 cases in three suites, and `UserConfigResourceSpec` aborts when it seeds its two users a second time. - `sbt "<module>/Test/scalafmtCheck" "<module>/Test/scalafix --check"` for `WorkflowExecutionService`, `DAO`, `ComputingUnitManagingService` and `NotebookMigrationService`. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Codex (GPT-6) and Claude Code (Claude Opus 5.5)
What changes were proposed in this PR?
The dashboard, Hub, warehouse, workflow access, collaboration and result specs each set up the same fixtures by hand. They now share these helpers:
DatabaseFlatSpec(incommon/dao) opens the test database before a suite and closes its pool after it, and runs the suite'scleanup()before each case, after each case or after the suite, as the suite chooses.ExecutionDatabaseTestSupport, which the execution specs already use, now also inserts workflow ownership and access rows, and the dashboard and Hub specs seed their workflows, versions, executions and grants with its helpers.UserDashboardFixtureSupportbuilds their users and workflows and seeds datasets, andWarehouseAccountFixtureseeds warehouse accounts.VersionedSearchQuerySupportrenders a dataset or model search query and checks its projected columns.HubEntityModelSpecno longer repeats checks that live in the dedicated suites. Its sixEntityTypecases thatEntityTypeSpecalready covers and its eightEntityTablesdispatch cases thatEntityTablesSpeccovers are removed, and its empty-string case moves toEntityTypeSpecunder the same name. Every other case keeps its name, its inputs and its expected values, in the same order.Any related issues, documentation, discussions?
Closes #9717.
How was this PR tested?
sbt "WorkflowExecutionService/testOnly <the 28 suites under amber>" "Auth/testOnly *WorkflowAccessSpec" "WorkflowCore/testOnly *ExecutionResultUrisSpec" "ResultService/testOnly *ResultResourceSpec": main runs 726 cases in 31 suites and this branch 712, all passing. The 14 fewer are theHubEntityModelSpeccases above; every other case has the same name, outcome and order, compared case by case from the JUnit XML reports.insertWorkflowUserAccessgranting READ whatever privilege it is given (1 of 142 cases), the warehouse account fixture dropping the avatar (1 of 18),DatabaseFlatSpecskipping its before-each cleanup (30 of 669), andVersionedSearchQuerySupportexpecting a wrong alias forname(2 of 55).sbt "<module>/Test/scalafmtCheck" "<module>/Test/scalafix --check"forDAO,Auth,WorkflowExecutionService,WorkflowCoreandResultService.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Codex (GPT-6) and Claude Code (Claude Opus 5.5)