Skip to content

test: lint test code in CI and speed up the lasso tests - #365

Merged
Hakanbaban53 merged 1 commit into
Zarestia-Dev:masterfrom
repires:ci/clippy-all-targets
Nov 19, 2026
Merged

Hakanbaban53 merged 1 commit into
Zarestia-Dev:masterfrom
repires:ci/clippy-all-targets

Conversation

@repires

@repires repires commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #367. Part of the 🧪 Comprehensive Testing & QA roadmap item.

Clippy on test code

CI runs clippy on the library code only, so warnings in #[cfg(test)] code went unnoticed. A new Test code step (Linux, next to the unit tests) lints the same test builds CI already compiles:

cargo clippy --locked -p rclone-manager-core --all-targets --features desktop,tray,updater,notifications,autostart -- -D warnings
cargo clippy --locked -p rclone-manager --all-targets --no-default-features --features desktop,tray,tauri-test -- -D warnings

The server already gets --all-targets in the Embedded server UI job.

Findings fixed:

  • native/window.rs: a real test bug. portal_string_reads_plain_and_wrapped_layouts built its "wrapped" value with Variant::from(Variant::from(..)), which is an identity conversion (useless_conversion). The value was never wrapped, so the nested-variant branch wasn't tested. It now uses Variant::Variant(Box::new(..)).
  • engine/process.rs: struct update syntax instead of assigning a field after Default::default().
  • workflow/types.rs: std::slice::from_ref(&config) instead of &[config.clone()] (2×).
  • engine/run.rs: the panicking-node test's None.expect() goes through black_box, so the panic isn't known at compile time and the test still checks what it meant to.

Also removes dirs from core's dependencies. Nothing in core uses it (the server still does). Cargo.lock loses that one edge.

Lasso test timeout

In a full local test:ci run, "keeps selecting newly rendered batches during one list lasso gesture" took 7.3 s and failed on the 5 s timeout. It passes on its own. The test's getBoundingClientRect mock ran querySelectorAll over up to 650 items for every item, which is quadratic. Items are siblings, so the mock now takes the index among the parent's children. On their own, the grid and list cases go from 635/786 ms to 300/371 ms.

Checks

On Fedora 44:

  • cargo fmt: clean.
  • Both new clippy commands: clean.
  • Clippy for core and server with --all-targets: clean.
  • Core process and workflow tests: 166 passed.
  • Desktop native::window tests with tauri-test: pass.

Frontend: the nautilus view-pane spec passes (19 tests); Prettier and ESLint are clean.

For the maintainers: today #357 and #353 each passed CI but failed together on master (fixed in #364). Enabling "Require branches to be up to date before merging", or a merge queue, in the branch protection would catch that. It's a repository setting, so it isn't in this PR.

CI ran clippy only on the library code, so warnings in tests piled up
unseen. A new step lints the test builds CI already compiles (core
with the native features, and the desktop crate with tauri-test), and
the existing findings are fixed. One of them was a real test bug: the
"wrapped" button layout was Variant::from(Variant), an identity
conversion, so the nested-variant branch was never tested.

Also drops the unused dirs dependency from core, and makes the lasso
tests' getBoundingClientRect mock find an item's index among its
siblings instead of querying the container on every call. That halves
their time; under a full parallel run one exceeded the 5 s timeout.
@Hakanbaban53
Hakanbaban53 merged commit f62c883 into Zarestia-Dev:master Nov 19, 2026
6 checks passed
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.

CI doesn't lint test code, and the lasso test can time out under load

2 participants