Skip to content

test(engine): cut the heaviest engine tests' work - #3641

Merged
Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:test/lighter-engine-sweeps
Dec 3, 2026
Merged

Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:test/lighter-engine-sweeps

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Cuts the work of the engine's heaviest tests, keeping what each one checks. CI's test run keeps all four of its runner's cores busy from start to end, so the wall time is about a quarter of the tests' summed time. These tests run in both the Linux test job and the GDAL and DuckDB job.

  • Command sweeps (hostile_params_never_panic_*, field_floors_hold_for_every_command_*): each command now runs once for each group of junk parameters that agree on every key the command names. The run uses the parameter set with the most other keys, so code that looks at keys a command doesn't name (a check for unexpected keys, a tool's own parameters) still sees them. Timing each command showed that commands taking few keys and accepting anything (map.zoomIn, info.project, map.new, …) ran all ~80 sets and rebuilt three fixtures after each one. That was most of the sweeps' time. params_name_every_key_a_command_reads checks that a command reads only the keys it names.
  • PDF layer tests: they draw a 50 mm page instead of A4, as test(engine): sweep a PDF's cancellation checks on a small page #3573 did for the cancellation sweep. The PDF reader draws each layer at 150 dpi, so an A4 page cost about a minute.
  • export_map_to_geotiff_places_the_view_on_the_ground: the fit checks draw views a few points high, since the fit follows the long side. They had drawn pictures of up to 8177 × 8177 pixels. One view turned 1° (4095 × 100 points, a box 4096.12 wide) covers three rules: a turned GeoTIFF counts its box, the box is rounded out at the edge (8192.24 pixels becomes 8193, fitted to 191 DPI), and a turned PNG is sized by the view itself (8190 pixels, which fits).
Tests Before (CI) After (box)
hostile_params_never_panic_* (8) 620 s 63 s
field_floors_hold_for_every_command_* (8) 125 s 15 s
the two PDF layer tests 93 s 6 s
export_map_to_geotiff_places_the_view_on_the_ground 85 s 5 s

That is about 830 test-seconds fewer, roughly 3.5 minutes of wall time in each of the two jobs. The "before" column is a Linux run on main (job 143827780096). On the box, the old hostile_params_never_panic_2 took 108 s against CI's 110 s, so the columns compare.

Reach: tests only. No command, saved file or interface changes.

Testing

  • The changed tests, each in its own process on the box: all pass, with the times above. params_name_every_key_a_command_reads passes too.
  • Fork CI on this commit (Linux, run 47021489423 on Mavrick-F/RustGIS): passed. The GDAL and DuckDB job's test run took 244 s for 5,838 tests; the median of the last 54 upstream runs is 9.6 min. The Linux test job's run took 468 s for 6,496 tests; recent upstream runs of that size took 8.6–11.2 min.

UI evidence

No visible UI change.

Related issue

Follows #3573.

Summary by CodeRabbit

  • Tests
    • Updated hostile-command test coverage to check representative inputs based on each command’s declared parameters, while still testing every input for commands without declared parameters.
    • Adjusted PDF layer-group tests to use smaller pages.
    • Expanded export-fitting checks for rotated GeoTIFF and PNG outputs near the pixel limit.

The engine's test run is bound by its four CI cores, so these tests' seconds are a quarter of
their sum in wall time, in both the Linux test job and the GDAL and DuckDB job.

- The command sweeps (`hostile_params_never_panic_*`, `field_floors_hold_for_every_command_*`)
  run each command once per set of junk parameters it can tell apart by the keys it names,
  keeping the one with the most keys besides. Commands that take few keys and accept anything
  ran all ~80, rebuilding three fixtures after each: most of the sweeps' time.
- The PDF layer tests draw a 50 mm page instead of A4: the reader draws each layer at 150 dpi.
- The export fit checks draw views a few points high: the fit follows the long side. One view
  turned 1° covers a turned GeoTIFF's box, its rounding at the edge, and a PNG's own size.
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Hostile-command sweeps now test representative inputs based on each command’s parameter keys. PDF layer-group tests use 50×50 pages, and export-fitting tests cover updated viewports and a slightly rotated GeoTIFF.

Changes: Hostile Command Parameter Sweeps

Layer / File(s) Summary
Select hostile-command inputs
crates/engine/src/tests.rs
The sweeps retain each command’s parameter keys and test distinct representatives. Commands without declared keys still use every input. The streamed sweep applies the same selection.

PDF and Export-Fitting Tests

Layer / File(s) Summary
Update PDF and export-fitting cases
crates/engine/src/tests.rs
The PDF layer-group tests use 50×50 pages. The fitting test adjusts viewport cases and checks that a slightly rotated view fits GeoTIFF at 191 DPI and PNG without a reported DPI.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Other

Suggested reviewers: elpidioassinaturas, giswqs, choupeanut

Merge Risk: Minimal · up to 0aa60

This change only reduces the work done by engine tests. It does not alter product behavior, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "test(engine): cut the heaviest engine tests' work" matches the changeset. The PR reduces runtime of the heaviest engine tests: command sweeps run once per distinct key projection, PDF layer…
Description check Passed The description follows the template. It has Summary, Testing, UI evidence, and Related issue sections. The UI evidence section keeps the required 'No visible UI change.' line, which is correct for th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(engine): cut the heaviest engine tests' work" matches the changeset. The PR reduces runtime of the heaviest engine tests: command sweeps run once per distinct key projection, PDF layer tests use 50x50 pages, and the GeoTIFF export-fit test uses smaller views. The title is concise, specific, and follows conventional-commit style.

Full details: Description check

Explanation

The description follows the template. It has Summary, Testing, UI evidence, and Related issue sections. The UI evidence section keeps the required 'No visible UI change.' line, which is correct for this test-only change. The Summary explains what changed and why, with timing data. The Testing section lists the local and fork CI verification. The Related issue section says 'Follows #3573', which is a reference rather than a closing link, and this is acceptable because the template only asks for an issue reference.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks each key with care,
And picks one input from each pair.
Small pages speed the PDF test,
A tilted map gets checked as well,
Then hops away to nibble grass.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 66c47497-c959-4338-a442-685564f058de
Commits

Reviewing files that changed from the base of the PR and between 19b049e and 0aa60ba.

Files selected for processing: 1

  • crates/engine/src/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@Mavrick-F
Mavrick-F added this pull request to the merge queue Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3641/
Web app https://preview.rustgis.app/pr-3641/app/
Commit 0aa60ba

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

Merged via the queue into opengeos:main with commit 32c7cb6 Dec 3, 2026
27 checks passed
@Mavrick-F
Mavrick-F deleted the test/lighter-engine-sweeps branch December 3, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant