saucelabs / saucectl

A command line interface for the Sauce Labs platform.
Apache License 2.0
42 stars 16 forks source link

fix: Should download artifacts when no retries #943

Closed tianfeng92 closed 2 months ago

tianfeng92 commented 2 months ago

Description

The root cause is that when setting retries and downloading artifacts simultaneously, the code determines whether to proceed with the download by checking AllAttempts and whether it's the last attempt (attempts < total retries).

However, if the job doesn’t run out of retries (e.g., if the first job has passed or the job passes threshold before hitting the retry limit), the number of attempts is smaller than the total retries, leading to the download being skipped.

To fix this issue, I updated the download function as we've known if the job is the last attempt.

This solves https://github.com/saucelabs/saucectl/issues/939 and https://github.com/saucelabs/saucectl/issues/938