You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop cloud backtests when the requested push fails #717
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
Push a project so its local configuration contains a cloud ID.
Change the local algorithm.
Have another collaborator control the cloud project write permission.
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.
Activity