Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

@joshrotenberg joshrotenberg commented Nov 26, 2025

Summary

Adds unit tests for async_utils pure functions.

Changes

Unit Tests

  • Added 22 unit tests for pure functions in async_utils.rs
  • Tests cover:
    • extract_task_id - extracts task IDs from various API response formats
    • is_task_complete - checks task completion status
    • is_task_failed - checks task failure status
    • get_task_response - extracts response from completed tasks
    • get_task_error - extracts error details from failed tasks
  • All tests use mock JSON data, no API calls required

Testing

cargo test --package redisctl async_utils

Related

Add comprehensive unit tests for async operation utilities:
- Task state detection (completed, failed, cancelled, in-progress)
- Task state formatting with visual indicators
- Task details parsing from various API response formats
- Error handling for nested and alternative field names

Coverage: 22 new tests for critical polling/async logic
Related to #462
@joshrotenberg joshrotenberg added the testing Related to tests and test coverage label Nov 26, 2025
@joshrotenberg joshrotenberg force-pushed the test/async-utils-coverage branch from f45dfdf to 46ead3e Compare November 28, 2025 20:48
@joshrotenberg joshrotenberg changed the title test(redisctl): add async_utils unit tests and Cloud API testing strategy test(redisctl): add async_utils unit tests Nov 28, 2025
@joshrotenberg joshrotenberg merged commit 068d893 into main Dec 1, 2025
16 checks passed
@joshrotenberg joshrotenberg deleted the test/async-utils-coverage branch December 1, 2025 03:29
@joshrotenberg joshrotenberg mentioned this pull request Dec 1, 2025
This was referenced Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to tests and test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants