Skip to content

test: fix drive cover download retries#1934

Merged
luozhixiong01 merged 1 commit into
mainfrom
fix/drive-cover-retry
Jul 17, 2026
Merged

test: fix drive cover download retries#1934
luozhixiong01 merged 1 commit into
mainfrom
fix/drive-cover-retry

Conversation

@luozhixiong01

@luozhixiong01 luozhixiong01 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Drive Cover live E2E configured eight attempts but stopped after the first non-zero exit code. This PR fixes the local retry condition so transient Cover download failures retry within the existing bounded backoff and timeout.

Changes

  • Add shouldRetryCoverDownload to tests/cli_e2e/drive/drive_preview_workflow_test.go for nil, success, and non-zero exit results.
  • Add credential-free regression coverage for actual invocation counts, immediate success, and the eight-attempt limit.
  • Preserve the existing retry delays, four-minute workflow timeout, and global RunCmdWithRetry behavior.

Test Plan

  • make unit-test passed through Harness validate.
  • Harness validate passed build, vet, unit, and integration checks.
  • Existing E2E regressions passed (2/2); skill eval is N/A.
  • Acceptance reviewer passed (2/2 cases).
  • Manual verification: go test ./tests/cli_e2e/drive -run 'TestShouldRetryCoverDownload' -count=1 and go test ./tests/cli_e2e -run 'TestRunCmdWithRetry' -count=1.
  • Live Drive workflow skipped because credentials are unavailable in the current environment.

Related Issues

N/A

Summary by CodeRabbit

  • Bug Fixes

    • Improved retry handling for Drive cover downloads when CLI commands fail.
    • Increased reliability of cover download workflows by retrying failed or unavailable command results.
  • Tests

    • Added coverage to verify retry behavior across repeated failures and eventual success.

@luozhixiong01 luozhixiong01 added the bugfix Bug fixes label Jul 17, 2026
@github-actions github-actions Bot added the size/S Low-risk docs, CI, test, or chore only changes label Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 680ef31b-8f64-4854-a149-c78f912448b7

📥 Commits

Reviewing files that changed from the base of the PR and between 27df16d and c8d1e93.

📒 Files selected for processing (1)
  • tests/cli_e2e/drive/drive_preview_workflow_test.go

📝 Walkthrough

Walkthrough

The Drive cover download e2e test now uses shouldRetryCoverDownload to retry nil or failed CLI results. New tests validate predicate outcomes and retry attempts using a configurable fake CLI script.

Changes

Drive cover download retry

Layer / File(s) Summary
Retry predicate and behavior validation
tests/cli_e2e/drive/drive_preview_workflow_test.go
The cover download workflow uses shouldRetryCoverDownload, with tests covering nil results, successful results, non-zero exit codes, and retry stopping/counting through a fake CLI.

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

Suggested labels: size/M

Suggested reviewers: fangshuyu-768

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change: fixing Drive cover download retries.
Description check ✅ Passed The description follows the required template with Summary, Changes, Test Plan, and Related Issues sections filled in.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/drive-cover-retry

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

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.96%. Comparing base (47dc003) to head (c8d1e93).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1934   +/-   ##
=======================================
  Coverage   74.96%   74.96%           
=======================================
  Files         892      892           
  Lines       94058    94077   +19     
=======================================
+ Hits        70506    70529   +23     
+ Misses      18139    18137    -2     
+ Partials     5413     5411    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@c8d1e93217b2205dcf329b75f5ade3361e251bf2

🧩 Skill update

npx skills add larksuite/cli#fix/drive-cover-retry -y -g

@luozhixiong01
luozhixiong01 merged commit e71c761 into main Jul 17, 2026
41 checks passed
@luozhixiong01
luozhixiong01 deleted the fix/drive-cover-retry branch July 17, 2026 09:53
@liangshuo-1 liangshuo-1 mentioned this pull request Jul 17, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fixes size/S Low-risk docs, CI, test, or chore only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants