Skip to content

test: add option behavior e2e coverage and smoke checks#40

Merged
overtrue merged 1 commit intomainfrom
overtrue/e2e-option-behavior-phase3
Mar 8, 2026
Merged

test: add option behavior e2e coverage and smoke checks#40
overtrue merged 1 commit intomainfrom
overtrue/e2e-option-behavior-phase3

Conversation

@overtrue
Copy link
Contributor

@overtrue overtrue commented Mar 8, 2026

Summary

This PR continues the test hardening effort by adding behavior-level integration coverage for key command options and extending smoke validation to include option semantics.

What Changed

  • Added a new integration test module in crates/cli/tests/integration.rs:
    • option_behavior_operations
  • Added 6 option behavior tests:
    • test_cp_dry_run_does_not_create_target_object
    • test_mv_dry_run_keeps_source_and_skips_target
    • test_rm_dry_run_does_not_delete_object
    • test_head_bytes_returns_prefix_bytes
    • test_find_count_json_reports_match_count
    • test_share_upload_generates_upload_url_with_expiration
  • Extended smoke suite in .github/workflows/integration.yml with 2 fast option-behavior checks:
    • option_behavior_operations::test_cp_dry_run_does_not_create_target_object
    • option_behavior_operations::test_head_bytes_returns_prefix_bytes

Why

The previous round established command/option discoverability contracts (--help) but still lacked runtime verification that options actually change behavior correctly. This PR closes that gap for high-risk and high-frequency options (--dry-run, --bytes, --count, upload URL generation).

Validation

All required checks passed locally:

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace
  • cargo test --package rustfs-cli --test integration --features integration

Real-backend verification against RustFS latest-compatible endpoint:

  • TEST_S3_ENDPOINT=http://localhost:9000
  • TEST_S3_ACCESS_KEY=accesskey
  • TEST_S3_SECRET_KEY=secretkey
  • cargo test --package rustfs-cli --test integration --features integration option_behavior_operations:: -- --test-threads=1
    • result: 6 passed, 0 failed

Smoke sequence replay (same env) with updated list:

  • object_operations::test_upload_and_download_small_file
  • object_operations::test_move_recursive_prefix_s3_to_s3
  • quota_operations::test_bucket_quota_set_info_clear
  • option_behavior_operations::test_cp_dry_run_does_not_create_target_object
  • option_behavior_operations::test_head_bytes_returns_prefix_bytes

All smoke items passed.

Scope

  • No protected files modified
  • No schema/config contract changes
  • Test and workflow hardening only

Copilot AI review requested due to automatic review settings March 8, 2026 20:20
@overtrue overtrue merged commit dfbbb79 into main Mar 8, 2026
16 of 17 checks passed
@overtrue overtrue deleted the overtrue/e2e-option-behavior-phase3 branch March 8, 2026 20:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds behavior-level integration tests that verify key CLI options change runtime behavior as intended, and extends the GitHub Actions smoke suite to exercise a couple of these option semantics against RustFS “latest”.

Changes:

  • Added option_behavior_operations integration test module covering --dry-run, head --bytes, find --count, and share --upload --expire.
  • Implemented 6 new end-to-end option behavior tests that validate results by querying the backend (e.g., ls, JSON outputs).
  • Extended .github/workflows/integration.yml smoke test list with 2 fast option-behavior checks.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/cli/tests/integration.rs Adds new integration test module verifying option semantics for cp/mv/rm/head/find/share.
.github/workflows/integration.yml Adds two option behavior tests to the RustFS-latest smoke test set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants