Commit Graph
14 Commits
Author SHA1 Message Date
TechnoPorg ee3c9f4417 Update non-default feature code 2026-01-22 00:30:48 +01:00
TechnoPorg 85ccd7e507 Update tests, examples, benches 2026-01-22 00:30:48 +01:00
TechnoPorg f4160d2387 Update docs 2026-01-22 00:30:48 +01:00
swaits 8ee4092f9a test: increase coverage for error paths and conversions
Add targeted coverage tests to maintain >80% code coverage minimum:

- ExtractInput error paths (14 tests): Type mismatch errors for Result,
  Option, Vec, HashMap, Arc, and primitive types. Directly exercises
  error formatting code that was previously uncovered.

- DagRunner::get() type mismatch (6 tests): Covers the type mismatch
  error path when attempting to retrieve task output with wrong type.
  Tests various type combinations to ensure robust error handling.

- TaskBuilder conversions (9 tests): Covers the From<TaskBuilder> to
  TaskHandle conversion for unit-type tasks, ensuring ID preservation
  and correct handling of mixed task types.

Also fixes timing test threshold from 10ms to 50ms to account for
tarpaulin instrumentation overhead while still validating parallel
execution.

Coverage increased from ~78% to 82.04% (above 80% minimum requirement).
2025-10-10 17:06:59 -06:00
swaits fad97dbf16 fix: support arbitrary types in task dependencies
Enable tasks to accept ANY type implementing Clone + Send + Sync as
dependencies, without requiring users to implement ExtractInput trait.

The #[task] macro now generates task-specific extraction logic inline
via a new extract_and_run() method. This leverages the macro's perfect
compile-time knowledge of parameter types to handle extraction for:
- Zero parameters (unit type, source tasks)
- Single parameter (any Clone + Send + Sync type)
- Multiple parameters (tuples, awaited concurrently)

Previously, only hardcoded primitive types and specific stdlib types
worked. Custom user types required manual ExtractInput implementations.
Now custom types work automatically with zero API changes.

Changes:
- Add extract_and_run() method to Task trait (internal/hidden)
- Generate inline extraction in #[task] macro based on parameter count
- Remove ExtractInput bound from DagRunner::add_task()
- Retain ExtractInput for internal task_fn() test helper
- Add comprehensive custom type tests

No breaking changes - purely internal implementation improvement.
2025-10-10 17:06:38 -06:00
swaits bec2f9e4c9 fix: lint, disable wonky timing test on macos 2025-10-08 14:52:32 -06:00
swaits 802e584646 refactor: remove cycle checking becuase API prevents cycles 2025-10-08 14:28:54 -06:00
swaits 02eac133bd fix: force threads on arc test (fixes MacOS CI failure) 2025-10-08 12:20:04 -07:00
swaits 4e891ebd5a chore: bump crate to 0.2.3, update CHANGELOG 2025-10-07 21:30:05 -07:00
swaits ec94ade329 chore: add logging under tracing feature 2025-10-07 21:16:04 -07:00
swaits 504347a46a fix: force tokio:test("multi_thread") so tests pass on macOS 2025-10-07 19:53:05 -07:00
swaits 400c01d73c test: increase coverage to 93% 2025-10-07 17:29:08 -07:00
swaits 98b8bcfd6e chore: remove inappropriate tests from tarpaulin runs 2025-10-07 16:56:35 -07:00
swaits 7412287ee4 feat: dagrunner, initial version 2025-10-07 16:31:03 -07:00