Repository navigation
refactor: remove unused fixtures, barrels and redundant code - #9686
aglinxinyuan merged 3 commits into
Conversation
Python tests drop two unused fixtures with their imports, unused fixture parameters and a loop variable, and constructs that repeat a default or an alias: dict() calls, fixtures that yield without teardown, empty fixture parentheses, nested with blocks and timezone.utc. The agent service drops two barrels nothing imports and two unused type imports. Three frontend specs drop TestBed modules their fixtures already provide. load-examples.sh drops a jq-failure check that errexit makes unreachable, the AsterixDB source drops two placeholder initializers, and RustFSContainer drops a comment that calls its console disabled.
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9686 +/- ##
============================================
+ Coverage 91.71% 91.77% +0.05%
- Complexity 5134 5139 +5
============================================
Files 1305 1306 +1
Lines 58211 58289 +78
Branches 7599 7595 -4
============================================
+ Hits 53391 53493 +102
+ Misses 2917 2896 -21
+ Partials 1903 1900 -3
☔ 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 | 360 | 0.219 | 24,993/53,989/53,989 us | 🔴 +14.0% / 🔴 +297.9% |
| 🟢 | bs=100 sw=10 sl=64 | 843 | 0.515 | 116,165/134,219/134,219 us | 🟢 -50.9% / 🔴 +48.8% |
| 🔴 | bs=1000 sw=10 sl=64 | 967 | 0.59 | 1,025,011/1,154,009/1,154,009 us | 🔴 +6.6% / 🔴 +36.7% |
Baseline details
Latest main 424b2a7 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 360 tuples/sec | 409 tuples/sec | 956.03 tuples/sec | -12.0% | -62.3% |
| bs=10 sw=10 sl=64 | MB/s | 0.219 MB/s | 0.249 MB/s | 0.584 MB/s | -12.0% | -62.5% |
| bs=10 sw=10 sl=64 | p50 | 24,993 us | 24,151 us | 10,527 us | +3.5% | +137.4% |
| bs=10 sw=10 sl=64 | p95 | 53,989 us | 47,339 us | 13,570 us | +14.0% | +297.9% |
| bs=10 sw=10 sl=64 | p99 | 53,989 us | 47,339 us | 16,510 us | +14.0% | +227.0% |
| bs=100 sw=10 sl=64 | throughput | 843 tuples/sec | 766 tuples/sec | 1,273 tuples/sec | +10.1% | -33.8% |
| bs=100 sw=10 sl=64 | MB/s | 0.515 MB/s | 0.467 MB/s | 0.777 MB/s | +10.3% | -33.7% |
| bs=100 sw=10 sl=64 | p50 | 116,165 us | 118,104 us | 82,483 us | -1.6% | +40.8% |
| bs=100 sw=10 sl=64 | p95 | 134,219 us | 273,246 us | 90,219 us | -50.9% | +48.8% |
| bs=100 sw=10 sl=64 | p99 | 134,219 us | 273,246 us | 102,794 us | -50.9% | +30.6% |
| bs=1000 sw=10 sl=64 | throughput | 967 tuples/sec | 962 tuples/sec | 1,318 tuples/sec | +0.5% | -26.6% |
| bs=1000 sw=10 sl=64 | MB/s | 0.59 MB/s | 0.587 MB/s | 0.804 MB/s | +0.5% | -26.6% |
| bs=1000 sw=10 sl=64 | p50 | 1,025,011 us | 1,039,815 us | 802,593 us | -1.4% | +27.7% |
| bs=1000 sw=10 sl=64 | p95 | 1,154,009 us | 1,082,857 us | 843,998 us | +6.6% | +36.7% |
| bs=1000 sw=10 sl=64 | p99 | 1,154,009 us | 1,082,857 us | 894,722 us | +6.6% | +29.0% |
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,556.17,200,128000,360,0.219,24992.84,53988.56,53988.56
1,100,10,64,20,2371.38,2000,1280000,843,0.515,116165.43,134219.34,134219.34
2,1000,10,64,20,20686.81,20000,12800000,967,0.590,1025010.62,1154008.66,1154008.66
kunwp1
left a comment
There was a problem hiding this comment.
LGTM! One optional suggestion and a nit below.
The file's other two empty byte strings already use the literal.
Under `set -euo pipefail`, a workflow file that jq cannot parse aborts load-examples.sh at `content=$(jq -c . "$workflow_file")` and skips every file after it, although the comment above FAILURES calls each failure deliberately non-fatal (main's `$?` check after the assignment could never fire). Testing the assignment in the `if` reports the file through print_error and moves on to the next one; main still exits non-zero at the end. test_load_examples_sh.sh gains a case with an unparseable workflow sorted ahead of a good one.
What changes were proposed in this PR?
Remove code that nothing uses, and constructs that repeat a default or an alias, from the Python tests, the agent service, three frontend specs, the AsterixDB source and the RustFS test container, and make an unreachable error check in the single-node example loader reachable (+84/−137 lines). Only the loader's behavior changes: a workflow file that
jqcannot parse is now reported and skipped instead of aborting the loader.test_console_message.pydrops the unusedinternal_queueandtimed_bufferfixtures and their imports. Two tests drop fixture parameters they never read (executor,a_timestamp), andtest_proxy_client.pynames an unused loop value_. The others writedict(...)calls as literals, return from fixtures that yield without teardown, drop empty@pytest.fixture()parentheses, merge nestedwithblocks, return a value directly instead of through a local, take the first element withnext(iter(...)), and spelldatetime.timezone.utc,socket.timeoutandbytes()asdatetime.UTC,TimeoutErrorandb""(Ruff targets Python 3.11).src/agent/index.tsandsrc/api/index.tsonly re-export modules that callers import directly. No file imports either barrel, and the package entry issrc/index.ts.workflow-system-metadata.tsdrops the unusedOperatorSchemaandValidationErrortype imports.FormsModuleandHttpClientTestingModule, whichcreateFormlyModalFixturealready provides, and the admin Gmail spec drops three modules that the standalone component and its stubbed service do not need.load-examples.sh: tests thecontent=$(jq -c . "$workflow_file")assignment in theifinstead of checking$?after it. The script runs underset -euo pipefailandmaincallsload_workflowsdirectly, so the old check could never fire: a workflow file thatjqcould not parse aborted the loader and skipped the files after it, although the comment aboveFAILUREScalls each failure deliberately non-fatal. Nowprint_errorcounts the file, the loop moves on, andmainstill exits non-zero at the end.test_load_examples_sh.shadds a case with an unparseable workflow sorted ahead of a good one.AsterixDBConnUtilandAsterixDBSourceOpExecassign the version response and the parsed row once asvals instead of overwritingnullandNoneplaceholders.RustFSContainer: drops the Scaladoc lines saying the console is left disabled. RustFS 1.0.0 enables the console by default, and the fixture does not override it.load-examples.sh: #4247 (2026-03-02); AsterixDB source: #1044 (2021-02-25);RustFSContainer: #8542 (2026-09-15)refactor(frontend): share dataset and model resource UI) moved both specs tocreateFormlyModalFixture. Everything else: unused, unreachable or redundant since introduction.As of 2026-11-24:
load-examples.shcheck has been unreachable for almost 9 months.Any related issues, documentation, discussions?
Closes #9685.
How was this PR tested?
Ran on this branch and on
mainat424b2a757a(Windows 11; Python 3.12 with CI's pinnedruff0.14.7; Node 24 with Yarn 4.14.1; Bun 1.3.13; JDK 17; the loader test in an Alpine container with Bash 5.2.21 and jq 1.7.1):test_ui_parameter_contract.pythat expect UTC and come out 8 hours off in this machine's time zone. They fail the same way onmain.source.sqlsuites, including the three AsterixDB specs, run 204 tests that all pass on both sides. WorkflowCore's tests compile, and scalafmt and scalafix pass on both modules.load-examples.sh:test_load_examples_sh.shpasses all 11 checks. Againstmain's loader, the 9 existing checks pass and the 2 new ones fail:jqexits 5 at the malformed file, and the loader stops there without creating the other workflow.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)