Skip to content

Stop cloud backtests when the requested push fails #717

Closed

Description

Problem

In CLI 1.0.233, lean cloud backtest Example --push can compile and backtest the previous cloud files after the push fails. The command then exits 0. This gives a successful-looking test result for code other than the local changes.

Reproduction

  1. Push a project so its local configuration contains a cloud ID.
  2. Change the local algorithm.
  3. Have another collaborator control the cloud project write permission.
  4. Run lean cloud backtest Example --push.

Observed: the CLI prints Cannot push and the write-permission error, then prints Started compiling, runs the backtest, and exits 0. The compiler warning line numbers still correspond to the previous cloud file. The new local scenario was absent from that version and produced no orders.

Cause and expected behavior

lean/components/cloud/push_manager.py:79-87 catches the push exception and only logs a warning. lean/components/cloud/cloud_project_manager.py:70-77 then returns the existing cloud project because its cloud ID is present. lean/commands/cloud/backtest.py:44-60 proceeds with the run.

A failed requested push must prevent compilation and backtesting and return a nonzero exit status. This also needs a regression test for an existing cloud ID plus a failed upload. Suggestion: propagate push success or failure to callers rather than treating a logged warning as success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions