Skip to content

test(amber, common): share dashboard and Hub spec fixtures - #9718

Merged
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:test/dashboard-hub-fixtures
Nov 26, 2026
Merged

aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:test/dashboard-hub-fixtures

Conversation

@aglinxinyuan

@aglinxinyuan aglinxinyuan commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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 (in common/dao) opens the test database before a suite and closes its pool after it, and runs the suite's cleanup() 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. UserDashboardFixtureSupport builds their users and workflows and seeds datasets, and WarehouseAccountFixture seeds warehouse accounts.
  • VersionedSearchQuerySupport renders a dataset or model search query and checks its projected columns.

HubEntityModelSpec no longer repeats checks that live in the dedicated suites. Its six EntityType cases that EntityTypeSpec already covers and its eight EntityTables dispatch cases that EntityTablesSpec covers are removed, and its empty-string case moves to EntityTypeSpec under 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 the HubEntityModelSpec cases above; every other case has the same name, outcome and order, compared case by case from the JUnit XML reports.
  • Mutation check: four breaks, each reverted afterwards, made their guarding suites fail: insertWorkflowUserAccess granting READ whatever privilege it is given (1 of 142 cases), the warehouse account fixture dropping the avatar (1 of 18), DatabaseFlatSpec skipping its before-each cleanup (30 of 669), and VersionedSearchQuerySupport expecting a wrong alias for name (2 of 55).
  • sbt "<module>/Test/scalafmtCheck" "<module>/Test/scalafix --check" for DAO, Auth, WorkflowExecutionService, WorkflowCore and ResultService.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Codex (GPT-6) and Claude Code (Claude Opus 5.5)

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.
@aglinxinyuan
aglinxinyuan requested review from kunwp1 and a balanced review from Copilot November 26, 2026 05:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added engine common platform Non-amber Scala service paths labels Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @mengw15, @tanishqgandhi1908, @carloea2
    You can notify them by mentioning @mengw15, @tanishqgandhi1908, @carloea2 in a comment.

@codecov-commenter

codecov-commenter commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.77%. Comparing base (f4adf7f) to head (c86b482).
⚠️ Report is 6 commits behind head on main.

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     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.56% <ø> (ø) Carriedforward from f98a174
amber 85.94% <ø> (-0.03%) ⬇️
computing-unit-managing-service 63.81% <ø> (ø)
config-service 87.50% <ø> (ø)
file-service 82.16% <ø> (ø)
frontend 96.43% <ø> (ø) Carriedforward from f98a174
notebook-migration-service 83.84% <ø> (ø)
pyamber 98.66% <ø> (ø) Carriedforward from f98a174
result-service 86.48% <ø> (ø)
workflow-compiling-service 80.90% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 4 better · 🔴 1 worse · ⚪ 10 noise (<±5%) · 0 without baseline

Compared against main 77112c8 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

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 kunwp1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Nov 26, 2026
Merged via the queue into apache:main with commit 410c55e Nov 26, 2026
39 checks passed
@aglinxinyuan
aglinxinyuan deleted the test/dashboard-hub-fixtures branch November 26, 2026 20:24
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 27, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common engine platform Non-amber Scala service paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Share dashboard, Hub and result spec fixtures

4 participants